fix(tokens): remove duplicate CHAIN_IDs.PLASMA key in WETH.addresses#5
Open
Nexory wants to merge 1 commit into
Open
fix(tokens): remove duplicate CHAIN_IDs.PLASMA key in WETH.addresses#5Nexory wants to merge 1 commit into
Nexory wants to merge 1 commit into
Conversation
The WETH.addresses object literal contained two entries for [CHAIN_IDs.PLASMA] with the same address. JavaScript silently overwrites the earlier entry with the later one at parse time, so this had no runtime effect, but it triggers no-dupe-keys linting and signals confusion about intent. Both keys mapped to the same address so removing the duplicate is safe.
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.
Summary
WETH.addressescontains the key[CHAIN_IDs.PLASMA]twice, with both entries mapping to the same address (0x9895D81bB462A195b4922ED7De0e3ACD007c32CB). JavaScript silently overwrites the earlier entry with the later one at parse time, so this has no runtime effect, but it triggersno-dupe-keyslint warnings and signals confusion about intent.What changed
Removed the duplicate
[CHAIN_IDs.PLASMA]entry at line 600 ofsrc/tokens.ts. The first occurrence (also at the same address) remains in the alphabetized chain order.Impact
no-dupe-keysissueVerification
```
$ grep -c "CHAIN_IDs.PLASMA" src/tokens.ts
4 before, 3 after (PLASMA still present once in WETH, plus 2 in other token entries)
```
Notes
This issue was found during an audit of the across-protocol SDK ecosystem. The same pattern (PLASMA duplicate key in WETH.addresses) exists at
src/tokens.ts:649,652inacross-protocol/constantsand may warrant a parallel fix there. Happy to send a follow-up PR for that repo if helpful.