0

I have 20 ERC 20 tokens. I use Permit and give my signature to allow a contract to spend 20 of my tokens. However, I move these tokens to another wallet before transferFrom happens.

What happens when the contract tries to move my nonexistent tokens? Is there any safeguard to prevent bad signatures from being generated?

1 Answer 1

0

You can put a condition to check the balance of the tokens (using the balanceOf() function of the corresponding ERC20 token contract) available in the wallet.

2
  • ah that's straightforward. so basically before attempting transferFrom, just adding an additional check and otherwise throwing a clientside error Commented May 6 at 15:16
  • Yes exactly. Kindly please accept the answer if it helped you. Happy coding! Commented May 6 at 15:38

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.