Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (options.from) {
from = this.utils.toChecksumAddress(formatters.inputAddressFormatter(options.from));
}
options.from = from || web3Package.contractOptions.from;
options.gasPrice = gasPrice || web3Package.contractOptions.gasPrice;
options.gas = options.gas || options.gasLimit || web3Package.contractOptions.gas;
// TODO replace with only gasLimit?
delete options.gasLimit;
return options;
};
EstimateGasOfContractMethodModel.prototype = Object.create(EstimateGasMethodModel.prototype);
EstimateGasOfContractMethodModel.prototype.constructor = EstimateGasOfContractMethodModel;
module.exports = EstimateGasOfContractMethodModel;
EstimateGasOfContractMethodModel.prototype.beforeExecution = function (web3Package) {
this.parameters[0]['data'] = self.methodEncoder.encode(
this.contractMethodParameters,
this.abiItem,
this.signature,
web3Package.contractOptions.data
);
this.parameters[0] = this.getOrSetDefaultOptions(this.parameters[0], web3Package);
EstimateGasMethodModel.prototype.beforeExecution.call(this, web3Package);
};