You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I figure out that is a smart-order-router API query, and then I try it by smart-order-router CLI.
~ ./bin/cli quote --tokenIn 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 --tokenOut 0x9469d013805bffb7d3debe5e7839237e535ec483 --amount 1000 --exactIn --recipient 0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B --protocols v2,v3 --debug
INFO: [Metric]: TokenListLoad: 1 | Milliseconds
key: "TokenListLoad"
value: 1
unit: "Milliseconds"
INFO: Found 1 out of 2 tokens inlocal cache. Checking primary token provider for 1 tokens
addressesToFindInPrimary: ["0x9469d013805bffb7d3debe5e7839237e535ec483"]
INFO: Found 0 tokens in primary. Checking secondary token provider for 1 tokens
addressesToFindInSecondary: ["0x9469d013805bffb7d3debe5e7839237e535ec483"]
DEBUG: About to multicall for symbol across 1 addresses
calls: [{"target":"0x9469d013805bffb7d3debe5e7839237e535ec483","callData":"0x95d89b41...DEBUG: About to multicall for decimals across 1 addresses calls: [{"target":"0x9469d013805bffb7d3debe5e7839237e535ec483","callData":"0x313ce567...
DEBUG: Results for multicall on decimals across 1 addresses as of block 13900877
results: [{"success":true,"result":[18]}]
Error: call revert exception (method="symbol()", errorArgs=null, errorName=null,
errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.5.0)
Code: CALL_EXCEPTION
A call revert error occurred, I think the reason is RING's symbol type is bytes32 not the string. This is a historical reason. dapphub/ds-token#28
And there is a lot of token like MKR have the same issue, but the MKR token is in the @uniswap/default-token-list, so it has no effect on MRK.
But other tokens like RING got hit. And I file an issue at Uniswap/default-token-list#1031.
To verify my idea, I added RING to @uniswap/default-token-list locally. It works 🚀
~ ./bin/cli quote --tokenIn 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 --tokenOut 0x9469d013805bffb7d3debe5e7839237e535ec483 --amount 1000 --exactIn --recipient 0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B --protocols v2,v3
Best Route:
[V2] 85.00% = WETH --> RING, [V3] 15.00% = WETH -- 0.3% --> RING
Raw Quote Exact In:
16472715.82
Gas Adjusted Quote In:
16470330.17
Gas Used Quote Token: 2385.644467
Gas Used USD: 104.133692
Calldata: 0x5ae401dc0000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000e4472b43f300000000000000000000000000000000000000000000002e141ea081ca0800000000000000000000000000000000000000000000000b658b561723e7673ef0a70000000000000000000000000000000000000000000000000000000000000080000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009469d013805bffb7d3debe5e7839237e535ec4830000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e404e45aaf000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000009469d013805bffb7d3debe5e7839237e535ec4830000000000000000000000000000000000000000000000000000000000000bb8000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b00000000000000000000000000000000000000000000000821ab0d44149800000000000000000000000000000000000000000000000238f21b6c7dcd9b6dd4cb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Value: 0x00
blockNumber: "13900919"
estimatedGasUsed: "228000"
gasPriceWei: "121520560130"
Thanks for digging into this and providing such a detailed report!
It would be best to support ERC20 with symbol() view returns (bytes32) but I can't think of an elegant way to do this given the current code (without adding retries).
We generally do not add tokens to the Uniswap default list and prefer users to use community owned lists, so that option is unlikely.
For now, I went with a third option which adds the token to the smart-order-router's hardcoded list of known tokens. We use this list, and the uniswap default token list, to seed our cache of token metadata. 5e60d46
We will release this to the API in the next few days so RING should be swappable soon
It would be best to support ERC20 with symbol() view returns (bytes32) but I can't think of an elegant way to do this given the current code (without adding retries).
I agree with this approach. Because of there is a lot of token still have this issue.
When I trade with
RING/ETH
pair atapp.uniswap.org
. An HTTP 500 error occur.I figure out that is a
smart-order-router
API query, and then I try it bysmart-order-router
CLI.A
call revert error
occurred, I think the reason is RING's symbol type isbytes32
not thestring
. This is a historical reason. dapphub/ds-token#28And there is a lot of token like MKR have the same issue, but the
MKR
token is in the@uniswap/default-token-list
, so it has no effect onMRK
.But other tokens like
RING
got hit. And I file an issue at Uniswap/default-token-list#1031.To verify my idea, I added
RING
to@uniswap/default-token-list
locally. It works 🚀There are two ways to fix the issue, Add
RING
token to@uniswap/default-token-list
Add RING: Darwinia Network Native Token for savingsmart-order-router
is not support token which has bytes32 returned insymbol()
default-token-list#1031 or support ERC20 which isfunction symbol() view returns (bytes32)
The text was updated successfully, but these errors were encountered: