Skip to content
New issue

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

Get revert reason of any tx and especially for failed trades #15

Closed
miohtama opened this issue Mar 21, 2022 · 3 comments
Closed

Get revert reason of any tx and especially for failed trades #15

miohtama opened this issue Mar 21, 2022 · 3 comments
Assignees
Labels
priority: P2 Default priority. An issue might not yet be fixed in the next release.

Comments

@miohtama
Copy link
Contributor

Uniswap trade analyzer should be able to tell why the trade failed

  • Too much slippage
  • Some internal Uniswap error
  • (There should be no other reasons if the tokens are not scam tokens)

As a bonus, trade analyzer should able to tell if the trade was reverted because of slippage. Though not sure how we can pick up this from the transaction receipt, I believe is going to be quite hard. The ”real” EVM nodes do not store the revert reason for very long time (few hundreds of blocks) and one might need to replay the transaction.

https://snakecharmers.ethereum.org/web3py-revert-reason-parsing/

This would be a research task of doing some little trades with Ganache and see what kind of data we can get out of JSON-RPC for the revert reason -if any. And then do the transaction replay trick.

@miohtama
Copy link
Contributor Author

Also Geth and Erigon behave differently. The latter might have much better JSON-RPC support for extracting revert reasons. Erigon only supported Ethereum mainnet and BSC though.

@miohtama miohtama added the priority: P2 Default priority. An issue might not yet be fixed in the next release. label Mar 21, 2022
@miohtama
Copy link
Contributor Author

Ganache and Ethereum Tester unit tests should support this, so at least we can use this feature for internal testing even though we would need to look up the actual revert reasons on Etherscan on production.

@miohtama
Copy link
Contributor Author

Added in the master.

servatj pushed a commit that referenced this issue May 6, 2022
Remove the horizontal scroll showing in datatable sometimes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: P2 Default priority. An issue might not yet be fixed in the next release.
Projects
None yet
Development

No branches or pull requests

2 participants