Suppress pre-flight check
See original GitHub issueI am trying to mimic a web3 batched transaction with ethers, and having some trouble with what I presume are pre-flight checks that are being made on ethers side?
I am basically running two transactions consecutively, with the second depending on the first. When I do this with a web3 batched transaction, using metamask as the provider, there are two permission modals that pop up, the first for an ERC20 approval, the second for the transaction that depends on the ERC20 approval. With a web3 batched transaction, the permission modal for the second transaction warns that the EVM has reverted code, but I can still send that transaction.
When I attempt the same with ethers, the second transaction throws with a Revert EVM error
0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000015746f6b656e207472616e73666572206661696c65640000000000000000000000
This I believe is a token transfer error, something that our code requires. It seems as though ethers is running a .call
on the transaction first, and if this fails, it throws an exception. We are trying to make that approval first, then the second tx but mined in the same block with different nonces (a batched transaction).
Question, is there any way to suppress this check and send the transaction that may well revert?
toby
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
Are you setting a gasLimit? If there is no gasLimit set, ethers will use estimateGas, which can throw a CALL_EXCEPTION if the call would fail, which in this case it would.
Try adding a gasLimit override or including the
"gas"
key in the ABI (or@
directive for human-readable ABI)?I think this is stale now (and therefore probably resolved 😉), so I’m going to close it. If you are still having problems though, please re-open.
Thanks! 😃