Repository navigation
fix(send): don't treat ETH as the native coin on chains where it isn't - #126
Open
Ehsan-saradar wants to merge 1 commit into
Open
Ehsan-saradar wants to merge 1 commit into
Ehsan-saradar wants to merge 1 commit into
Conversation
The "ETH" alias in resolve-token.js carried the native-asset sentinel address, so on polygon (POL), bsc (BNB), avalanche (AVAX) and similar chains `send ETH` built a plain value transfer of the chain's own coin and labelled it ETH. The catalog lookup already decides whether ETH is the chain's native asset. The alias now leaves `address` unset, so on those chains send resolves the chain's ETH token contract like any other token (or fails with no_contract). Chains where ETH is native are unchanged. Fixes zeriontech#125
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #125
send ETHon polygon was sending POL. TheETHalias inresolve-token.jshad the native asset address, so on any chain where the native coin is not ETH (polygon, bsc, avalanche, ...) it was treated as a native transfer of that coin.Now the alias has no address. The native check from the chain catalog already decides if ETH is the native coin, so on polygon
send ETHresolves the ETH token contract for that chain like other tokens do, or gives ano_contracterror if there is none.Chains where ETH is native (ethereum, base, arbitrum, ...) are not changed, they still match in the native lookup.