MCPcopy Create free account
hub / github.com/PolymathNetwork/polymath-core / getGasLimit

Function getGasLimit

CLI/commands/common/common_functions.js:43–48  ·  view source on GitHub ↗
(options, action)

Source from the content-addressed store, hash-verified

41};
42
43async function getGasLimit(options, action) {
44 let block = await web3.eth.getBlock('latest');
45 let networkGasLimit = block.gasLimit;
46 let gas = Math.round(options.factor * (await action.estimateGas({ from: options.from.address, value: options.value })));
47 return (gas > networkGasLimit) ? networkGasLimit : gas;
48}
49
50async function checkPermissions(action) {
51 let contractRegistry = await connect(action._parent.options.jsonInterface, action._parent._address);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected