0

I see Uniswap and a lot of other frontend UIs can check if an ERC20 token has approved the contract to use the address's funds, and dynamically change their buttons to "Swap" from "Approve" (since Approve does not need to be called again after a token has called the function once). What is the standard way to do this? I am using React right now. Thank you for any advice.

2
0

You will need to use a Web3 library such as Web3.js.

Regarding any smart contract, call the allowance method.

AND/OR

Specific to a farm, you can check with Zapper API by following this link:

https://api.zapper.fi/api/static/index.html#/Farm%20Transactions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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