Skip to content

Commit

Permalink
chain IDs to ints
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Feb 6, 2024
1 parent 5b48d1e commit 72b277f
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 58 deletions.
28 changes: 14 additions & 14 deletions data/addresses.mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@
{
"address": "0x70e967acFcC17c3941E87562161406d41676FD83",
"category": "omnichain",
"chain_id": "1",
"chain_id": 1,
"chain_name": "eth_mainnet",
"type": "tss"
},
{
"address": "0x70e967acFcC17c3941E87562161406d41676FD83",
"category": "omnichain",
"chain_id": "56",
"chain_id": 56,
"chain_name": "bsc_mainnet",
"type": "tss"
},
{
"address": "0x70e967acFcC17c3941E87562161406d41676FD83",
"category": "omnichain",
"chain_id": "8332",
"chain_id": 8332,
"chain_name": "btc_mainnet",
"type": "tss"
},
{
"address": "0x70e967acFcC17c3941E87562161406d41676FD83",
"category": "omnichain",
"chain_id": "7000",
"chain_id": 7000,
"chain_name": "zeta_mainnet",
"type": "tss"
},
Expand Down Expand Up @@ -184,70 +184,70 @@
{
"address": "0x0000028a2eB8346cd5c0267856aB7594B7a55308",
"category": "messaging",
"chain_id": "56",
"chain_id": 56,
"chain_name": "bsc_mainnet",
"type": "zetaToken"
},
{
"address": "0x000063A6e758D9e2f438d430108377564cf4077D",
"category": "messaging",
"chain_id": "56",
"chain_id": 56,
"chain_name": "bsc_mainnet",
"type": "connector"
},
{
"address": "0x00000fF8fA992424957F97688015814e707A0115",
"category": "omnichain",
"chain_id": "56",
"chain_id": 56,
"chain_name": "bsc_mainnet",
"type": "erc20Custody"
},
{
"address": "0xf091867EC603A6628eD83D274E835539D82e9cc8",
"category": "messaging",
"chain_id": "1",
"chain_id": 1,
"chain_name": "eth_mainnet",
"type": "zetaToken"
},
{
"address": "0x000007Cf399229b2f5A4D043F20E90C9C98B7C6a",
"category": "messaging",
"chain_id": "1",
"chain_id": 1,
"chain_name": "eth_mainnet",
"type": "connector"
},
{
"address": "0x0000030Ec64DF25301d8414eE5a29588C4B0dE10",
"category": "omnichain",
"chain_id": "1",
"chain_id": 1,
"chain_name": "eth_mainnet",
"type": "erc20Custody"
},
{
"address": "0xaeB6dDB7708467814D557e340283248be8E43124",
"category": "omnichain",
"chain_id": "1",
"chain_id": 1,
"chain_name": "eth_mainnet",
"type": "tssUpdater"
},
{
"address": "0xaf28a257D292e7f0E531073f70a175b57E0261a8",
"category": "omnichain",
"chain_id": "56",
"chain_id": 56,
"chain_name": "bsc_mainnet",
"type": "tssUpdater"
},
{
"address": "0xaf28a257D292e7f0E531073f70a175b57E0261a8",
"category": "messaging",
"chain_id": "56",
"chain_id": 56,
"chain_name": "bsc_mainnet",
"type": "pauser"
},
{
"address": "0xaeB6dDB7708467814D557e340283248be8E43124",
"category": "messaging",
"chain_id": "1",
"chain_id": 1,
"chain_name": "eth_mainnet",
"type": "pauser"
},
Expand Down
68 changes: 34 additions & 34 deletions data/addresses.testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,28 @@
{
"address": "0x8531a5aB847ff5B22D855633C25ED1DA3255247e",
"category": "omnichain",
"chain_id": "5",
"chain_id": 5,
"chain_name": "goerli_testnet",
"type": "tss"
},
{
"address": "0x8531a5aB847ff5B22D855633C25ED1DA3255247e",
"category": "omnichain",
"chain_id": "97",
"chain_id": 97,
"chain_name": "bsc_testnet",
"type": "tss"
},
{
"address": "0x8531a5aB847ff5B22D855633C25ED1DA3255247e",
"category": "omnichain",
"chain_id": "80001",
"chain_id": 80001,
"chain_name": "mumbai_testnet",
"type": "tss"
},
{
"address": "tb1qy9pqmk2pd9sv63g27jt8r657wy0d9ueeh0nqur",
"category": "omnichain",
"chain_id": "18332",
"chain_id": 18332,
"chain_name": "btc_testnet",
"type": "tss"
},
Expand Down Expand Up @@ -224,107 +224,107 @@
"type": "fungibleModule"
},
{
"address": "0x0000c9ec4042283e8139c74f4c64bcd1e0b9b54f",
"address": "0x0000c304d2934c00db1d51995b9f6996affd17c0",
"category": "messaging",
"chain_id": "97",
"chain_name": "bsc_testnet",
"chain_id": 5,
"chain_name": "goerli_testnet",
"type": "zetaToken"
},
{
"address": "0x0000ecb8cdd25a18f12daa23f6422e07fbf8b9e1",
"address": "0x00005e3125aba53c5652f9f0ce1a4cf91d8b15ea",
"category": "messaging",
"chain_id": "97",
"chain_name": "bsc_testnet",
"chain_id": 5,
"chain_name": "goerli_testnet",
"type": "connector"
},
{
"address": "0x0000a7db254145767262c6a81a7ee1650684258e",
"address": "0x000047f11c6e42293f433c82473532e869ce4ec5",
"category": "omnichain",
"chain_id": "97",
"chain_name": "bsc_testnet",
"chain_id": 5,
"chain_name": "goerli_testnet",
"type": "erc20Custody"
},
{
"address": "0x0000c304d2934c00db1d51995b9f6996affd17c0",
"address": "0x0000c9ec4042283e8139c74f4c64bcd1e0b9b54f",
"category": "messaging",
"chain_id": "5",
"chain_name": "goerli_testnet",
"chain_id": 80001,
"chain_name": "mumbai_testnet",
"type": "zetaToken"
},
{
"address": "0x00005e3125aba53c5652f9f0ce1a4cf91d8b15ea",
"address": "0x0000ecb8cdd25a18f12daa23f6422e07fbf8b9e1",
"category": "messaging",
"chain_id": "5",
"chain_name": "goerli_testnet",
"chain_id": 80001,
"chain_name": "mumbai_testnet",
"type": "connector"
},
{
"address": "0x000047f11c6e42293f433c82473532e869ce4ec5",
"address": "0x0000a7db254145767262c6a81a7ee1650684258e",
"category": "omnichain",
"chain_id": "5",
"chain_name": "goerli_testnet",
"chain_id": 80001,
"chain_name": "mumbai_testnet",
"type": "erc20Custody"
},
{
"address": "0x0000c9ec4042283e8139c74f4c64bcd1e0b9b54f",
"category": "messaging",
"chain_id": "80001",
"chain_name": "mumbai_testnet",
"chain_id": 97,
"chain_name": "bsc_testnet",
"type": "zetaToken"
},
{
"address": "0x0000ecb8cdd25a18f12daa23f6422e07fbf8b9e1",
"category": "messaging",
"chain_id": "80001",
"chain_name": "mumbai_testnet",
"chain_id": 97,
"chain_name": "bsc_testnet",
"type": "connector"
},
{
"address": "0x0000a7db254145767262c6a81a7ee1650684258e",
"category": "omnichain",
"chain_id": "80001",
"chain_name": "mumbai_testnet",
"chain_id": 97,
"chain_name": "bsc_testnet",
"type": "erc20Custody"
},
{
"address": "0x55122f7590164Ac222504436943FAB17B62F5d7d",
"category": "omnichain",
"chain_id": "97",
"chain_id": 97,
"chain_name": "bsc_testnet",
"type": "tssUpdater"
},
{
"address": "0x55122f7590164Ac222504436943FAB17B62F5d7d",
"category": "omnichain",
"chain_id": "80001",
"chain_id": 80001,
"chain_name": "mumbai_testnet",
"type": "tssUpdater"
},
{
"address": "0x55122f7590164Ac222504436943FAB17B62F5d7d",
"category": "omnichain",
"chain_id": "5",
"chain_id": 5,
"chain_name": "goerli_testnet",
"type": "tssUpdater"
},
{
"address": "0x55122f7590164Ac222504436943FAB17B62F5d7d",
"category": "messaging",
"chain_id": "5",
"chain_id": 5,
"chain_name": "goerli_testnet",
"type": "pauser"
},
{
"address": "0x55122f7590164Ac222504436943FAB17B62F5d7d",
"category": "messaging",
"chain_id": "80001",
"chain_id": 80001,
"chain_name": "mumbai_testnet",
"type": "pauser"
},
{
"address": "0x55122f7590164Ac222504436943FAB17B62F5d7d",
"category": "messaging",
"chain_id": "97",
"chain_id": 97,
"chain_name": "bsc_testnet",
"type": "pauser"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"scripts": {
"build": "yarn compile && npx del-cli dist abi && tsc || exit 0 && npx del-cli './dist/typechain-types/**/*.js' && npx cpx './data/**/*' dist/data && npx cpx './artifacts/contracts/**/*' ./abi && npx del-cli './abi/**/*.dbg.json'",
"compile": "npx hardhat compile --force",
"generate": "yarn compile && ./scripts/generate_go.sh || exit 0 && ./scripts/generate_addresses.sh",
"generate": "yarn compile && ./scripts/generate_go.sh || exit 0 && ./scripts/generate_addresses.sh && yarn lint:fix",
"lint": "npx eslint . --ext .js,.ts",
"lint:fix": "npx eslint . --ext .js,.ts,.json --fix",
"prepublishOnly": "yarn build",
Expand Down
4 changes: 1 addition & 3 deletions scripts/generate_addresses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ npx hardhat addresses --network zeta_mainnet > ./data/addresses.mainnet.json

echo "Generating protocol addresses types..."

npx ts-node scripts/generate_addresses_types.ts > ./lib/types.d.ts

yarn lint:fix
npx ts-node scripts/generate_addresses_types.ts > ./lib/types.d.ts
12 changes: 6 additions & 6 deletions tasks/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const fetchTssData = async (chains: any, addresses: any, network: Network) => {
addresses.push({
address: chain.chain_name === "btc_testnet" ? btc : eth,
category: "omnichain",
chain_id: chain.chain_id,
chain_id: parseInt(chain.chain_id),
chain_name: chain.chain_name,
type: "tss",
});
Expand Down Expand Up @@ -157,7 +157,7 @@ const fetchChainSpecificAddresses = async (chains: any, addresses: any, network:
addresses.push({
address: zetaToken,
category: "messaging",
chain_id: chain.chain_id,
chain_id: parseInt(chain.chain_id),
chain_name: chain.chain_name,
type: "zetaToken",
});
Expand All @@ -167,7 +167,7 @@ const fetchChainSpecificAddresses = async (chains: any, addresses: any, network:
addresses.push({
address: connector,
category: "messaging",
chain_id: chain.chain_id,
chain_id: parseInt(chain.chain_id),
chain_name: chain.chain_name,
type: "connector",
});
Expand All @@ -177,7 +177,7 @@ const fetchChainSpecificAddresses = async (chains: any, addresses: any, network:
addresses.push({
address: data.chain_params.erc20_custody_contract_address,
category: "omnichain",
chain_id: chain.chain_id,
chain_id: parseInt(chain.chain_id),
chain_name: chain.chain_name,
type: "erc20Custody",
});
Expand All @@ -202,7 +202,7 @@ const fetchTSSUpdater = async (chains: any, addresses: any) => {
addresses.push({
address,
category: "omnichain",
chain_id: chain.chain_id,
chain_id: parseInt(chain.chain_id),
chain_name: chain.chain_name,
type: "tssUpdater",
});
Expand All @@ -227,7 +227,7 @@ const fetchPauser = async (chains: any, addresses: any) => {
addresses.push({
address,
category: "messaging",
chain_id: chain.chain_id,
chain_id: parseInt(chain.chain_id),
chain_name: chain.chain_name,
type: "pauser",
});
Expand Down

0 comments on commit 72b277f

Please sign in to comment.