I'm trying to follow a tutorial for estimating the gas cost of a function.
Thus after deploying my contract I type in this code in the Remix console to get the gas estimate of calling an arbitrary funtion (substituting in my contract details):
var contractABI = [ ... ]; var contractAddress = '0xxxxx'; var contract = web3.eth.contract(contractABI); var contractInstance = contract.at(contractAddress); var estimatedGas = contractInstance._mint.estimateGas('0x123', '5');
I get this response in the Remix console window:
Cannot read property 'estimateGas' of undefined
Am I doing something wrong? Or is Remix unable to fully utilize web3 in the console?