I woudlike to estimateGas after an approve contract :
WETH = weth.address;
USDC = usdc.address;
await usdc.approve(addr1, addr2).estimateGas;
When I try this I have this error :
TypeError: usdt.approve(...).estimateGas is not a function
Truffle uses different syntax. You need to pass the function params to the estimateGas()
, not to the approve()
function.
await usdc.approve.estimateGas(addr1, addr2);
Note: Your code defines usdc
and then the error message states usdt
. I'm assuming that's just a typo while creating the question, unrelated to the original issue.