I checked the following link: how to estimate gas cost?
My contract is:
pragma solidity ^0.5.1;
contract TransferGC{
uint public testVal = 97 ether;
function testFunc(address payable addr) public returns (uint) {
addr.transfer(testVal);
return testVal;
}
function deposit() payable public{}
}
I did the following:
TGC = await TransferGC.at('0xE4F90Ef2e5815cf24eea956b1f5781601859cb90')
truffle(development)> await web3.eth.getGasPrice()
'20000000000'
await TGC.testFunc('0x3e1D6ef576d19A6D28f3755acDb754E37aFe6E4A').estimateGas(1)
I am getting the following error:
Thrown: TypeError: TGC.testFunc(...).estimateGas is not a function
Somebody please guide me.
Zulfi.