0

I would like to know if an address can give approval to spend his tokens to another address or contract by calling the function approve in the same contract (not the token contract but another). Thank you!

1 Answer 1

1

It all depends on your token implementation. As an example an ERC20 token has an approval function. This approval function uses the msg.sender value to give approval to spend tokens, which would make your approval scenario impossible. I think ERC-721 contracts follow the same logical flow. You could deploy a modified token contract that doesn't use msg.sender to identify the address. Here is a link to the openzeppelin ERC-20 implementation

1
  • So, could I modify the erc-20 contract? Oct 31, 2023 at 11:58

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.