Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Check onchain metadata #1528

Merged
merged 9 commits into from
Feb 19, 2024
Merged

Check onchain metadata #1528

merged 9 commits into from
Feb 19, 2024

Conversation

randomshinichi
Copy link
Collaborator

$ yarn validate-PR (validated-tokens.csv contains an invalid mint)
FATAL ERROR: could not find metadata for one of these tokens (6JQq2qS67K4L5xQ3xUTinCyxzdPeZQG1R1ipK8jrY7gc). This means there was an account that wasn't a token mint.
No More Duplicate Symbols: 0 (18 exceptions)
Duplicate Mints: 0
Attempts to Add Multiple Tokens: 0
Invalid Mint Addresses: 0
Not Community Validated: 0 (612 exceptions)
Edits to Existing Tokens: 0
Issues with Symbols in Added Tokens: 0
Onchain Metadata Mismatches: 1
error Command failed with exit code 1.

Sample output (from unittests)

Metadata does not match on-chain data: 8A9HYfj9WAMgjxARWVCJHAeq9i8vdN9cerBmqUamDj7U Name mismatch Expected: Elementerra, Found: Elementum

stdout | src/utils/validate.spec.ts > newTokensHaveMatchingOnchainMeta() works
Metadata does not match on-chain data: DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263 Name mismatch Expected: KiKI Token, Found: Bonk
Metadata does not match on-chain data: DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263 Symbol mismatch Expected: KIKI, Found: Bonk

stdout | src/utils/validate.spec.ts > newTokensHaveMatchingOnchainMeta() works
Metadata does not match on-chain data: DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263 URI mismatch Expected: https://arweave.net/8mAKLjGGmjKTnmcXeyr3pr7iX13xXVjJJiL6RujDbSPV, Found: https://arweave.net/QPC6FYdUn-3V8ytFNuoCS85S2tHAuiDblh6u3CIZLsw
Metadata does not match on-chain data: DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263 Decimals mismatch Expected: 9, Found: 5

@randomshinichi randomshinichi changed the title Check metadata Check onchain metadata Feb 15, 2024
… and Name, Symbol with Metaplex metadata (token 2022 not ready yet)
…k RPC calling and missing token metadata trickledown instead of throwing loud errors
moved to metadata.ts
newTokensHaveMatchinOnchainMeta() untested
… runner should solve this, but for now just move tests to a different file and use vitest for testing and normal TS for running.

newTokensHaveMatchinOnchainMeta() now throws an error if an address is provided that isn't a mint.
9yoi
9yoi previously approved these changes Feb 16, 2024
@9yoi 9yoi merged commit f153578 into main Feb 19, 2024
1 check passed
@9yoi 9yoi deleted the check-metadata branch February 19, 2024 06:28
vishalsinghji pushed a commit to vishalsinghji/token-list that referenced this pull request May 25, 2024
* WIP newTokensHaveMatchingOnchainMeta() checks decimals against Solana and Name, Symbol with Metaplex metadata (token 2022 not ready yet)

* newTokensHaveMatchingOnchainMeta() works with unittests for findAddedTokens()

* removed dummy data in newTokensHaveMatchingOnchainMeta()

* working Token2022, Token+metaplex fetching. going to refactor for bulk RPC calling and missing token metadata trickledown instead of throwing loud errors

* Token metadata getting works and is robust with unittests
moved to metadata.ts
newTokensHaveMatchinOnchainMeta() untested

* token metadata validation is good to go

* inlined tests were messing up typescript compilation. using vite as a runner should solve this, but for now just move tests to a different file and use vitest for testing and normal TS for running.

newTokensHaveMatchinOnchainMeta() now throws an error if an address is provided that isn't a mint.

* add WHALES as exception for duplicate-symbols check

---------

Co-authored-by: mei <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants