We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
6.13.14
Etherscan, maxFeePerGs, maxFeePerGas, transaction overrides
Hello!
When using transaction override property "maxFeePerGas", the following cast error is raised:
TypeError: invalid BytesLike value (argument="value", value=60000000015, code=INVALID_ARGUMENT, version=6.13.4)
The error occurs sometimes only (when using the getDefaultProvider). And everytimes when using the EtherscanProvider.
getDefaultProvider
EtherscanProvider
This seems to be caused by this check in EtherscanProvider: https://github.com/ethers-io/ethers.js/blob/48cdcef2925ffca4f60412697791dac268f06d0d/src.ts/providers/provider-etherscan.ts#L341C69-L341C80
Where the keys of the override properties are checked to defined if they need to be cast using toQuantity or hexlify.
toQuantity
hexlify
In the list of properties keys maxFeePerGs is used instead of maxFeePerGas.
maxFeePerGs
maxFeePerGas
The line of properties to match for toQuantity should probably be:
if ((<any>{ type: true, gasLimit: true, gasPrice: true, maxFeePerGas: true, maxPriorityFeePerGas: true, nonce: true, value: true })[key]) {
Have a nice day!
const etherscan = new ethers.EtherscanProvider('matic-amoy'); const wallet = new ethers.Wallet('<>', etherscan); const signer = new ethers.NonceManager(wallet); const contract = new ethers.Contract('address', ["function someFunction(address old, address new)"], signer); const tx = await contract.someFunction('0x8701766278803a9b3460c78d8cb22df0ab132952', '0x70b98e54160bd632b404d329951d371d8fe647bd', { maxFeePerGas: 6500000000n, });
- Non relevant.
Altcoin - Please specify (e.g. Polygon)
Polygon Amoy
The text was updated successfully, but these errors were encountered:
ricmoo
No branches or pull requests
Ethers Version
6.13.14
Search Terms
Etherscan, maxFeePerGs, maxFeePerGas, transaction overrides
Describe the Problem
Hello!
When using transaction override property "maxFeePerGas", the following cast error is raised:
The error occurs sometimes only (when using the
getDefaultProvider
). And everytimes when using theEtherscanProvider
.This seems to be caused by this check in EtherscanProvider: https://github.com/ethers-io/ethers.js/blob/48cdcef2925ffca4f60412697791dac268f06d0d/src.ts/providers/provider-etherscan.ts#L341C69-L341C80
Where the keys of the override properties are checked to defined if they need to be cast using
toQuantity
orhexlify
.In the list of properties keys
maxFeePerGs
is used instead ofmaxFeePerGas
.The line of properties to match for
toQuantity
should probably be:Have a nice day!
Code Snippet
Contract ABI
Errors
TypeError: invalid BytesLike value (argument="value", value=60000000015, code=INVALID_ARGUMENT, version=6.13.4)
Environment
Altcoin - Please specify (e.g. Polygon)
Environment (Other)
Polygon Amoy
The text was updated successfully, but these errors were encountered: