-
Notifications
You must be signed in to change notification settings - Fork 87
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
feat: validation script to run when new tokens are pushed #128
base: main
Are you sure you want to change the base?
Conversation
0b5279d
to
f926ea1
Compare
8a065a7
to
c595dc9
Compare
"gateway", | ||
]; | ||
const ITSAddress = "0xB5FB4BE02232B1bBA4dC8f81dc24C26980dE9e3C"; | ||
const COINGECKO_API_KEY = "CG-3VGxh1K3Qk7jAvpt4DJA3LvB"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that this is a free api key which doesn't matter if it gets exposed, also it makes it possible to run the validation locally without having to create a .env
file.
we need to delete the new token added before merging. |
} | ||
} | ||
|
||
async function validateTokenId( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the async
declaration not necessary in this function
import { ethers } from "ethers"; | ||
import axios from "axios"; | ||
|
||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
each of these types, constants, and ABIs can be externalized to a different directory
const ITSAddress = "0xB5FB4BE02232B1bBA4dC8f81dc24C26980dE9e3C"; | ||
const COINGECKO_API_KEY = "CG-3VGxh1K3Qk7jAvpt4DJA3LvB"; | ||
const COINGECKO_URL = "https://api.coingecko.com/api/v3/coins/"; | ||
const CHAIN_CONFIGS_URL = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testnet validations will fail on this. can these be environmentalized? try using the @axelarjs/api/getAxelarConfigs
import instead of hard-coding the download like this
); | ||
|
||
const coinData = response.data; | ||
if (coinData.symbol.toLowerCase() !== prettySymbol.toLowerCase()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't need to match prettySymbol. so long as coinGeckoId
exists, that's enough validation for the coingecko stuff we would need
Description
Runs a validation whenever a new token is pushed to the
squid.tokenlist.json
file.⛑️ What was done:
Create a github action that fails if any of the tested fields do not match the on-chain information, or the CoinGecko information.
Also make it possible to run the script locally.
Type of change
Please delete options that are not relevant.
🧪 How to test:
Test script: create a json file with a token config and run the script locally with the command
pnpm validate
.Test all the flow: Create a pull request to this branch with a new token in the
squid.tokenlist.json
file, or modify this pull request to include a new token.🗒️ Notes: