-2

I actually need a very simple smart contract using the following functions "transferfrom" and "approve".

I just need a smart contract that will be able to request approval to spend a token ( example -- bake ) from a wallet if the user calls the "approve" function.

It will also be able to withdraw the particular token from the user's wallet to the "address to" set by the contract's onwer, if the onwer calls the "transferfrom" function.

  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Apr 24 '22 at 17:55

1 Answers1

0

There's a design limitation of the ERC20 standard that disallows approval through a contract in between.

The user always needs to invoke the approve() function on the token contract directly - not through your contract.

Petr Hejda
  • 40,554
  • 8
  • 72
  • 100