DEV Community

Discussion on: How to create a smart contract to receive payments

Collapse
 
cibrax profile image
Cibrax

A few things. The owner might be who deployed the contract but not the one expecting the donations. Anyone can call your donate method. If the address points to another contract that could give errors, your eth will be burned/lost. Transfer is not recommended anymore. You should use Call and check for the result. If the result is false, you revert the transaction. Great start anyways!

Collapse
 
emanuelferreira profile image
Emanuel Ferreira

thanks, i will make these fixes!!

Collapse
 
emanuelferreira profile image
Emanuel Ferreira

I made these corrections in case you want to check

Collapse
 
cibrax profile image
Cibrax

Yes, that is perfect!