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.


1 Answer 1


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

Regarding any smart contract, call the allowance method.


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


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.