Do I need a written contract if I loan money to a friend?

r/

Location: Canada A close friend of mine asked to borrow some money. It’s not a huge amount, but it’s money I worked hard to save up and I don’t want to risk losing it or damaging the friendship if things go wrong. I’ve read mixed advice online some say a handshake and trust is fine, others say you always need something in writing no matter how close you are. Since this is money I’ve been saving for a while finally felt like a win for me financially, I want to make sure I handle it the right way. Do I legally need a written contract or even something simple like an IOU or would texts/emails count as enough proof if things ever got messy?