My problem is that when I try to approve the marketplace contract to spend DAI in BSC testnet (BEP 20 token), the gas fee is very high (80$) and it fails when I accept (limit error).
We're trying to buy an erc1155 token using a given erc20 token as the currency with which we buy the nft. ABI for the ERC20 token and contract address are correct so I don't know why it's not working and the gas fee is so high
const userAddress = user.get("ethAddress")
const marketplaceContract = new web3.eth.Contract(marketplaceContractAbi, MARKETPLACE_CONTRACT_ADDRESS)
params = { currencyId: itemToBuy.currencyId };
const currencyContractAddress = await Moralis.Cloud.run("getERC20Token", params)
const currencyContract = new web3.eth.Contract(abiDAI, currencyContractAddress.contractAddress)
await currencyContract.methods.approve(MARKETPLACE_CONTRACT_ADDRESS, itemToBuy.askingPrice).send({ from: userAddress })
I used the ABI of the DAI contract in BSC mainnet which I assume is the same as in testnet, just like in this link below.
[https://bscscan.com/address/0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3#code#L434](https://bscscan dai)
Thanks in advance