Replies: 1 comment 1 reply
-
For gasLimit, if you wish to specify a default gas limit, you can include it in the ABI: const abi = [
// Human-Readable
"function transfer(address, uint) @123456",
// JSON
{ name: "transfer", inputs: [ ... ], ..., gas: 123456 }
]; In either of these cases, the gas specified (123,456 gas) will be added to the intrinsic gas cost of the transaction (which accounts for the base fee, calldata zero/non-zero bytes, account creation, etc). To override But keep in mind you should not be using You should almost never be overriding fee data, as the network provides stable and reliable values for this now. But if you have a rare case that requires it, sub-classing Signer is the way to go, is quite simple and allows for a lot of flexibility. Does that make sense? (moving to discussion) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Now the callOverrides can only be passed in via transactions. Just like this:
But in web3.js it is possible to specify gasLimit when creating a contract .
https://web3js.readthedocs.io/en/v1.2.11/web3-eth-contract.html#new-contract
I think this is very useful. For example, when using hardhat, I can specify the default gasLimit and gasPrice through the config file (this feature is not available now).
Beta Was this translation helpful? Give feedback.
All reactions