1

What are the consequences of using "safeTransferFrom" for ERC20 instead of "transferFrom"?

1 Answer 1

2

SafeTransferFrom performs a check to see it the token was indeed received by the other side (i.e. the 'to' address).

Some tokens do not return a bool on success, and if you use a wrong address for the erc20 (i.e. an address on the blockchain where there isn't a smart contract), the transferFrom will return bool true event if no transfer happened.

So it's always better practice to use safeTransferFrom when using someone else erc20.

Hope this helps!

1
  • Thank you so much for your help. Commented Nov 5, 2022 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.