I need a smart contract with Openzeppelin that will allow me to send any ERC20 token from one account to the account that made the contract. This is my frontend code to approve and transfer If there are any problems please notify me and show a solution as well.
enterPool will encompass the transferFrom function.
abi = current token ABI Ex: UDST
address = current token Address, these will change if the user decides to change the token.
Is it not working because Im deploying it on the Polygon Mumbai Net? Do we need to change some things around for Polygon/MATIC? I'm also still getting this error when I confirm this transaction:
'Please allow fund first'
This is the full frontend code, I dont understand how its not approving when Im approving in the code:
Ok turns out commenting that out made the function work, you can ignore everything above the last problem now is this error I get for the abi in the contract instantiation:
Unhandled Rejection (Error): You must provide the json interface of the contract when instantiating a contract object.
How do I fix this? Currently I have to press the buy button twice, once to get the error then one more time to get the MetaMask popup. I want just one click for my users