Get an real entertainment lawyer to draw up a real contract for you. Probably cost you $600 but you can use it for multiple beats. You need someone who knows the law in your corner of you want to do this for real.
Lots of people say this, because it is technically the right thing to do, but in reality...very few people do it because $600 is an insane amount of money for a bedroom producer who may not not make it big.
It's the same with copyright...technically you should copyright everything you do, but I'd guess that 90%+ of music producers have never copyrighted their beats and are just hoping that they can retrospectively argue their case in court (which is possible).
I would suggest to get a contract, even if it one you write yourself or use a template online, so that you can cover as many eventualities as you can.
I agree to lease you X beat for $Y, for up to Z records sold. X% of royalties will be due after this figure has been reached. The songs are allowed to each Y number of Youtube/Soundcloud clicks before $Z is due.
Try to cover as much as you can. So long as the artist agrees to it (and preferably signs and returns the contract to you), it is legally binding - whether an entertainment lawyer writes it out or not.
Then, when you make more money from your music and can justify a $600 lawyer to write up a full professional contract, you can consider it.