Skip to content

Add token validation script and GitHub Actions workflow #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 20, 2025

Conversation

PablitoAmaral
Copy link
Contributor

This pull request introduces a new Rust-based script to validate token metadata and a CI workflow to automate the validation process.

What's included:

  • validate-tokens script (scripts/validate-tokens):
    A Rust script that reads token lists for different networks (Ethereum, BOB, CORN, Babylon) and validates that the symbol, name, and decimals fields match the actual on-chain data.
    • Uses the alloy library to interact with EVM-based networks.
    • Uses HTTP queries for Babylon (Cosmos SDK).

Comment on lines 44 to 49
let files = vec![
("ethereum", "../../data/ethereum.1/tokenlist.json"),
("bob", "../../data/bob.60808/tokenlist.json"),
("corn", "../../data/corn.21000000/tokenlist.json"),
("babylon", "../../data/babylon.bbn-1/tokenlist.json"),
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably good to make this a cli param to make it easier to configure this with new files

Some(provider)
}

async fn verify_on_babylon(token: &Token) -> Result<u32, Box<dyn std::error::Error>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note for later: this will need to be generalized to any cosmos network, and both cosmwasm and tokenfactory

@PablitoAmaral PablitoAmaral merged commit 2792a75 into main May 20, 2025
2 checks passed
@PablitoAmaral PablitoAmaral deleted the validation branch May 20, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants