I'm developing a dapp with smart contract that can accept ERC20 tokens from users. To have the smart contract get a user's tokens, I want to use the permit function by getting a signature from the user; but if permit()
doesn't exist in the token, then I'll resort to having the user do an approve
transaction.
What is the best way to use web3
or ethers
to check that a token has permit()
?