Uniswap / Uniswap/interface

Gas estimation errors generate incomprehensible error messages.

Open
#1,560 11 comments 0 reactions 1 assignee View on GitHub

@moodysalem is already working on this.

Since May 14, 2021.

bug p1
Dominant language
TypeScript
Stars
5.5k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Bug Description
image

Steps to Reproduce

  1. Do something that results in gas estimation failing (transaction reverted).
  2. Notice the unintelligible error that doesn't even include the revert reason.

Expected Behavior
A useful error message that includes the revert reason.

Additional Context
As an example, if you try to estimate gas for a fee on transfer token when transferring away all of the assets you'll get an error like the linked one. Here is an example transaction being estimated:

{
	data: "0x791ac94700000000000000000000000000000000000000ecda0cabf00dfea3a07db86cef000000000000000000000000000000000000000000000000107620968dbe39f000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000fe4b7d18c0acb4f7498d637ebc13c396ade3d0ff00000000000000000000000000000000000000000000000000000000609d133f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cdb8ceabf7f5ca49039404f6a20f54421aca983e000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
	from: "0xfe4b7d18c0acb4f7498d637ebc13c396ade3d0ff",
	to: "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
}

which reverts with

revert: TransferHelper: TRANSFER_FROM_FAILED

and you'll notice that in the screenshot, it is complaining about an invalid BigNumber (because eth_estimateGas returns the revert reason, not a number I believe).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.