-
Notifications
You must be signed in to change notification settings - Fork 59
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: fetch addresses from chain #10
Conversation
tasks/addresses.ts
Outdated
await fetchForeignCoinsData(chainObject); | ||
await fetchAthensAddresses(chainObject, hre); | ||
|
||
console.log(JSON.stringify(chainObject, null, 2)); |
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.
those functions are great, but maybe should be in another file and exported alone, so you can use the task or import the function to use it programmatically
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@zetachain/[email protected] |
Updated the script. It now produces an array of addresses in an updated format: [
{
"chain_id": "18332",
"chain_name": "btc_testnet",
"type": "tss",
"category": "omnichain",
"address": "bcrt1qy9pqmk2pd9sv63g27jt8r657wy0d9uee4x2dt2"
},
{
"chain_id": "80001",
"chain_name": "mumbai_testnet",
"type": "tss",
"category": "omnichain",
"address": "0x8531a5aB847ff5B22D855633C25ED1DA3255247e"
},
{
"chain_id": "97",
"chain_name": "bsc_testnet",
"type": "tss",
"category": "omnichain",
"address": "0x8531a5aB847ff5B22D855633C25ED1DA3255247e"
},
{
"chain_id": "5",
"chain_name": "goerli_testnet",
"type": "tss",
"category": "omnichain",
"address": "0x8531a5aB847ff5B22D855633C25ED1DA3255247e"
},
{
"chain_id": 7001,
"chain_name": "zeta_testnet",
"type": "systemContract",
"category": "omnichain",
"address": "0xEdf1c3275d13489aCdC6cD6eD246E72458B8795B"
},
{
"chain_id": 7001,
"chain_name": "zeta_testnet",
"type": "connectorZEVM",
"category": "messaging",
"address": "0x239e96c8f17C85c30100AC26F635Ea15f23E9c67"
},
{
"chain_id": "5",
"chain_name": "goerli_testnet",
"coin_type": "ERC20",
"address": "0x07865c6e87b9f70255377e024ace6630c1eaa37f",
"symbol": "USDC",
"zrc20": "0x0cbe0dF132a6c6B4a2974Fa1b7Fb953CF0Cc798a",
"category": "omnichain",
"decimals": 6
},
{
"chain_id": 7001,
"chain_name": "zeta_testnet",
"coin_type": "ZRC20",
"address": "0x0cbe0dF132a6c6B4a2974Fa1b7Fb953CF0Cc798a",
"symbol": "USDC-goerli_testnet",
"asset": "0x07865c6e87b9f70255377e024ace6630c1eaa37f",
"category": "omnichain",
"decimals": 18
},
{
"chain_id": "5",
"chain_name": "goerli_testnet",
"coin_type": "Gas",
"address": "",
"symbol": "gETH",
"zrc20": "0x13A0c5930C028511Dc02665E7285134B6d11A5f4",
"category": "omnichain",
"decimals": 18
},
{
"chain_id": 7001,
"chain_name": "zeta_testnet",
"coin_type": "ZRC20",
"address": "0x13A0c5930C028511Dc02665E7285134B6d11A5f4",
"symbol": "ETH-goerli_testnet",
"asset": "",
"category": "omnichain",
"decimals": 18
},
{
"chain_id": "80001",
"chain_name": "mumbai_testnet",
"coin_type": "Gas",
"address": "",
"symbol": "tMATIC",
"zrc20": "0x48f80608B672DC30DC7e3dbBd0343c5F02C738Eb",
"category": "omnichain",
"decimals": 18
},
{
"chain_id": 7001,
"chain_name": "zeta_testnet",
"coin_type": "ZRC20",
"address": "0x48f80608B672DC30DC7e3dbBd0343c5F02C738Eb",
"symbol": "MATIC-mumbai_testnet",
"asset": "",
"category": "omnichain",
"decimals": 18
},
{
"chain_id": "18332",
"chain_name": "btc_testnet",
"coin_type": "Gas",
"address": "",
"symbol": "tBTC",
"zrc20": "0x65a45c57636f9BcCeD4fe193A602008578BcA90b",
"category": "omnichain",
"decimals": 8
},
{
"chain_id": 7001,
"chain_name": "zeta_testnet",
"coin_type": "ZRC20",
"address": "0x65a45c57636f9BcCeD4fe193A602008578BcA90b",
"symbol": "BTC-btc_testnet-btc_testnet",
"asset": "",
"category": "omnichain",
"decimals": 18
},
{
"chain_id": "97",
"chain_name": "bsc_testnet",
"coin_type": "ERC20",
"address": "0x64544969ed7EBf5f083679233325356EbE738930",
"symbol": "USDC",
"zrc20": "0x7c8dDa80bbBE1254a7aACf3219EBe1481c6E01d7",
"category": "omnichain",
"decimals": 6
},
{
"chain_id": 7001,
"chain_name": "zeta_testnet",
"coin_type": "ZRC20",
"address": "0x7c8dDa80bbBE1254a7aACf3219EBe1481c6E01d7",
"symbol": "USDC-bsc_testnet",
"asset": "0x64544969ed7EBf5f083679233325356EbE738930",
"category": "omnichain",
"decimals": 18
},
{
"chain_id": "80001",
"chain_name": "mumbai_testnet",
"coin_type": "ERC20",
"address": "0x9999f7fea5938fd3b1e26a12c3f2fb024e194f97",
"symbol": "USDC",
"zrc20": "0x91d4F0D54090Df2D81e834c3c8CE71C6c865e79F",
"category": "omnichain",
"decimals": 6
},
{
"chain_id": 7001,
"chain_name": "zeta_testnet",
"coin_type": "ZRC20",
"address": "0x91d4F0D54090Df2D81e834c3c8CE71C6c865e79F",
"symbol": "USDC-mumbai_testnet",
"asset": "0x9999f7fea5938fd3b1e26a12c3f2fb024e194f97",
"category": "omnichain",
"decimals": 18
},
{
"chain_id": "97",
"chain_name": "bsc_testnet",
"coin_type": "Gas",
"address": "",
"symbol": "tBNB",
"zrc20": "0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891",
"category": "omnichain",
"decimals": 18
},
{
"chain_id": 7001,
"chain_name": "zeta_testnet",
"coin_type": "ZRC20",
"address": "0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891",
"symbol": "BNB-bsc_testnet",
"asset": "",
"category": "omnichain",
"decimals": 18
},
{
"chain_id": 7001,
"chain_name": "zeta_testnet",
"category": "omnichain",
"type": "uniswapv2FactoryAddress",
"address": "0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c"
},
{
"chain_id": 7001,
"chain_name": "zeta_testnet",
"category": "omnichain",
"type": "wZetaContractAddress",
"address": "0x5F0b1a82749cb4E2278EC87F8BF6B618dC71a8bf"
},
{
"chain_id": 7001,
"chain_name": "zeta_testnet",
"category": "omnichain",
"type": "uniswapv2Router02Address",
"address": "0x2ca7d64A7EFE2D62A725E2B35Cf7230D6677FfEe"
},
{
"chain_id": 7001,
"chain_name": "zeta_testnet",
"category": "omnichain",
"type": "zetaConnectorZEVMAddress",
"address": "0x0000000000000000000000000000000000000000"
},
{
"chain_id": 7001,
"chain_name": "zeta_testnet",
"category": "omnichain",
"type": "fungibleModuleAddress",
"address": "0x735b14BB79463307AAcBED86DAf3322B1e6226aB"
},
{
"chain_id": "80001",
"chain_name": "mumbai_testnet",
"category": "messaging",
"type": "zetaToken",
"address": "0x0000c9ec4042283e8139c74f4c64bcd1e0b9b54f"
},
{
"chain_id": "80001",
"chain_name": "mumbai_testnet",
"category": "messaging",
"type": "connector",
"address": "0x0000ecb8cdd25a18f12daa23f6422e07fbf8b9e1"
},
{
"chain_id": "80001",
"category": "omnichain",
"chain_name": "mumbai_testnet",
"type": "erc20Custody",
"address": "0x0000a7db254145767262c6a81a7ee1650684258e"
},
{
"chain_id": "5",
"chain_name": "goerli_testnet",
"category": "messaging",
"type": "zetaToken",
"address": "0x0000c304d2934c00db1d51995b9f6996affd17c0"
},
{
"chain_id": "5",
"chain_name": "goerli_testnet",
"category": "messaging",
"type": "connector",
"address": "0x00005e3125aba53c5652f9f0ce1a4cf91d8b15ea"
},
{
"chain_id": "5",
"category": "omnichain",
"chain_name": "goerli_testnet",
"type": "erc20Custody",
"address": "0x000047f11c6e42293f433c82473532e869ce4ec5"
},
{
"chain_id": "97",
"chain_name": "bsc_testnet",
"category": "messaging",
"type": "zetaToken",
"address": "0x0000c9ec4042283e8139c74f4c64bcd1e0b9b54f"
},
{
"chain_id": "97",
"chain_name": "bsc_testnet",
"category": "messaging",
"type": "connector",
"address": "0x0000ecb8cdd25a18f12daa23f6422e07fbf8b9e1"
},
{
"chain_id": "97",
"category": "omnichain",
"chain_name": "bsc_testnet",
"type": "erc20Custody",
"address": "0x0000a7db254145767262c6a81a7ee1650684258e"
},
{
"chain_id": "80001",
"chain_name": "mumbai_testnet",
"category": "omnichain",
"type": "tssUpdater",
"address": "0x55122f7590164Ac222504436943FAB17B62F5d7d"
},
{
"chain_id": "5",
"chain_name": "goerli_testnet",
"category": "omnichain",
"type": "tssUpdater",
"address": "0x55122f7590164Ac222504436943FAB17B62F5d7d"
},
{
"chain_id": "97",
"chain_name": "bsc_testnet",
"category": "omnichain",
"type": "tssUpdater",
"address": "0x55122f7590164Ac222504436943FAB17B62F5d7d"
}
] The only thing that's missing is zeta token consumer. |
If we're ok with this format, I can modify it to generate types as well. And of course getters. We can probably write getters manually, because the ones we could generate (get by category, get by coin type, are not really needed, it's just an array, one can just use find or filter). |
fwiw this address is not Uniswap, but a ZetaChain connector: protocol-contracts/data/addresses.json Line 117 in 5b7c26d
This just proves again that we need to automate this. |
|
[ | ||
{ | ||
"address": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", | ||
"category": "messaging", |
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.
Uniswap pool can be used for omnichain smart contract call as well if a ERC20 deposit reverts.
I think we should have a category: general/misc/common
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.
You mean if a smart contract on a connected chain deposits an ERC-20 token to ZetaChain, this reverts, the contract can then use the Uniswap address to swap the token and return it to the user?
see #10 (comment)