V5 Beta, Overrides for Contract transactions not working
See original GitHub issueI’m using the Ethersjs ^5.0.0-beta.188
, and wondering if this is something I’m doing wrong, or what. The code worked previously when using V4, so not sure what I’ve done differently.
...
const overrides = {
gasLimit: estimatedGas,
gasPrice,
value: ethers.utils.parseEther("0"),
}
try {
const methodResult = await method(...methodParams, overrides)
} catch...
Gives the following error:
{
"reason": "contract method is not payable",
"code": "INVALID_ARGUMENT",
"argument": "sendTransaction:shouldNotRevert(string)",
"value": {
"gasLimit": {
"_hex": "0xa906",
"_isBigNumber": true
},
"gasPrice": {
"_hex": "0x3b9aca00",
"_isBigNumber": true
},
"value": {
"_hex": "0x00",
"_isBigNumber": true
},
"to": {},
"data": "0xd87f6dac00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004706c706c00000000000000000000000000000000000000000000000000000000"
}
}
The argument I am passing is is a normal string. (It is not the string value listed as the argument) It is true this function method is not payable, but I am also not sending any value to it. (Value is 0). Additionally I think there might be a bug because the argument is listed as the function selector itself, which doesn’t make sense to me.
Thoughts?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
ethers-io/Lobby - Gitter
The docs for contract methods have [, overrides ] but I don't see where that is defined anywhere. https://docs.ethers.io/v5/api/contract/contract/#Contract- ...
Read more >Access to inherited variable in solidity to overwrite it
The _setBaseURI() function alone can be overridden because it's visible from your contract. Private functions and state variables are only ...
Read more >web3.eth API — Web3.py 5.31.3 documentation - Read the Docs
The parameter values will override the pending transaction's values to create the replacement transaction to send. The same validation and defaulting rules of ......
Read more >How to Build a Full Stack NFT Marketplace - V2 (2022)
Was having the same problem and going crazy, my code was exactly like the ... This causes the NFT contract to not approve...
Read more >Compile contracts - Truffle Suite
If you'd like to override this behavior, run the above command with the --all ... You should not edit these files as they'll...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems to work! Thank you!
This should be fixed in 5.0.0-beta.189. Please try it out and let me know if you are still having problems.