spy_relayer: Terra 2 support (#1417)
This commit is contained in:
parent
a9363027e7
commit
d50ef1c28b
|
@ -1,5 +1,5 @@
|
|||
SPY_SERVICE_HOST=spy:7072
|
||||
SPY_SERVICE_FILTERS=[{"chainId":1,"emitterAddress":"B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE"},{"chainId":2,"emitterAddress":"0x0290FB167208Af455bB137780163b7B7a9a10C16"},{"chainId":3,"emitterAddress":"terra10pyejy66429refv3g35g2t7am0was7ya7kz2a4"},{"chainId":4,"emitterAddress":"0x0290FB167208Af455bB137780163b7B7a9a10C16"}]
|
||||
SPY_SERVICE_FILTERS=[{"chainId":1,"emitterAddress":"B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE"},{"chainId":2,"emitterAddress":"0x0290FB167208Af455bB137780163b7B7a9a10C16"},{"chainId":3,"emitterAddress":"terra10pyejy66429refv3g35g2t7am0was7ya7kz2a4"},{"chainId":4,"emitterAddress":"0x0290FB167208Af455bB137780163b7B7a9a10C16"},{"chainId":18,"emitterAddress":"terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6"}]
|
||||
SPY_NUM_WORKERS=5
|
||||
|
||||
REDIS_HOST=redis
|
||||
|
@ -10,4 +10,4 @@ PROM_PORT=8082
|
|||
READINESS_PORT=2000
|
||||
|
||||
LOG_LEVEL=debug
|
||||
SUPPORTED_TOKENS=[{"chainId":1,"address":"So11111111111111111111111111111111111111112"},{"chainId":1,"address":"2WDq7wSs9zYrpx2kbHDA4RUTRch2CCTP6ZWaH4GNfnQQ"},{"chainId":2,"address":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":2,"address":"0x2D8BE6BF0baA74e0A907016679CaE9190e80dD0A"},{"chainId":3,"address":"uluna"},{"chainId":4,"address":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"}]
|
||||
SUPPORTED_TOKENS=[{"chainId":1,"address":"So11111111111111111111111111111111111111112"},{"chainId":1,"address":"2WDq7wSs9zYrpx2kbHDA4RUTRch2CCTP6ZWaH4GNfnQQ"},{"chainId":2,"address":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":2,"address":"0x2D8BE6BF0baA74e0A907016679CaE9190e80dD0A"},{"chainId":3,"address":"uluna"},{"chainId":4,"address":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":18,"address":"uluna"}]
|
|
@ -1,4 +1,4 @@
|
|||
SUPPORTED_CHAINS=[{"chainId":1,"chainName":"Solana","nodeUrl":"http://solana-devnet:8899","nativeCurrencySymbol":"SOL","tokenBridgeAddress":"B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE","bridgeAddress":"Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o","wrappedAsset":"So11111111111111111111111111111111111111112"},{"chainId":2,"chainName":"ETH","nativeCurrencySymbol":"ETH","nodeUrl":"http://eth-devnet:8545","tokenBridgeAddress":"0x0290FB167208Af455bB137780163b7B7a9a10C16","wrappedAsset":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":3,"chainName":"Terra","isTerraClassic":true,"nativeCurrencySymbol":"LUNA","nodeUrl":"http://terra-terrad:1317","tokenBridgeAddress":"terra10pyejy66429refv3g35g2t7am0was7ya7kz2a4","terraName":"localterra","terraChainId":"localterra","terraCoin":"uluna","terraGasPriceUrl":"http://terra-fcd:3060/v1/txs/gas_prices"},{"chainId":4,"chainName":"BSC","nativeCurrencySymbol":"BNB","nodeUrl":"http://eth-devnet2:8545","tokenBridgeAddress":"0x0290FB167208Af455bB137780163b7B7a9a10C16","wrappedAsset":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"}]
|
||||
SUPPORTED_CHAINS=[{"chainId":1,"chainName":"Solana","nodeUrl":"http://solana-devnet:8899","nativeCurrencySymbol":"SOL","tokenBridgeAddress":"B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE","bridgeAddress":"Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o","wrappedAsset":"So11111111111111111111111111111111111111112"},{"chainId":2,"chainName":"ETH","nativeCurrencySymbol":"ETH","nodeUrl":"http://eth-devnet:8545","tokenBridgeAddress":"0x0290FB167208Af455bB137780163b7B7a9a10C16","wrappedAsset":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":3,"chainName":"Terra Classic","isTerraClassic":true,"nativeCurrencySymbol":"LUNC","nodeUrl":"http://terra-terrad:1317","tokenBridgeAddress":"terra10pyejy66429refv3g35g2t7am0was7ya7kz2a4","terraName":"localterra","terraChainId":"localterra","terraCoin":"uluna","terraGasPriceUrl":"http://terra-fcd:3060/v1/txs/gas_prices"},{"chainId":4,"chainName":"BSC","nativeCurrencySymbol":"BNB","nodeUrl":"http://eth-devnet2:8545","tokenBridgeAddress":"0x0290FB167208Af455bB137780163b7B7a9a10C16","wrappedAsset":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":18,"chainName":"Terra","isTerraClassic":false,"nativeCurrencySymbol":"LUNA","nodeUrl":"http://terra2-terrad:1317","tokenBridgeAddress":"terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6","terraName":"localterra","terraChainId":"localterra","terraCoin":"uluna","terraGasPriceUrl":"http://terra2-fcd:3060/v1/txs/gas_prices"}]
|
||||
REDIS_HOST=redis
|
||||
REDIS_PORT=6379
|
||||
PROM_PORT=8083
|
||||
|
@ -6,5 +6,5 @@ READINESS_PORT=2000
|
|||
CLEAR_REDIS_ON_INIT=true
|
||||
DEMOTE_WORKING_ON_INIT=true
|
||||
LOG_LEVEL=debug
|
||||
SUPPORTED_TOKENS=[{"chainId":1,"address":"So11111111111111111111111111111111111111112"},{"chainId":1,"address":"2WDq7wSs9zYrpx2kbHDA4RUTRch2CCTP6ZWaH4GNfnQQ"},{"chainId":2,"address":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":2,"address":"0x2D8BE6BF0baA74e0A907016679CaE9190e80dD0A"},{"chainId":3,"address":"uluna"},{"chainId":4,"address":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"}]
|
||||
PRIVATE_KEYS=[{"chainId":1,"privateKeys":[[14,173,153,4,176,224,201,111,32,237,183,185,159,247,22,161,89,84,215,209,212,137,10,92,157,49,29,192,101,164,152,70,87,65,8,174,214,157,175,126,98,90,54,24,100,177,247,77,19,112,47,44,165,109,233,102,14,86,109,29,134,145,132,141]]},{"chainId":2,"privateKeys":["0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d"]},{"chainId":3,"privateKeys":["notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius"]},{"chainId":4,"privateKeys":["0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d"]}]
|
||||
SUPPORTED_TOKENS=[{"chainId":1,"address":"So11111111111111111111111111111111111111112"},{"chainId":1,"address":"2WDq7wSs9zYrpx2kbHDA4RUTRch2CCTP6ZWaH4GNfnQQ"},{"chainId":2,"address":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":2,"address":"0x2D8BE6BF0baA74e0A907016679CaE9190e80dD0A"},{"chainId":3,"address":"uluna"},{"chainId":4,"address":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":18,"address":"uluna"}]
|
||||
PRIVATE_KEYS=[{"chainId":1,"privateKeys":[[14,173,153,4,176,224,201,111,32,237,183,185,159,247,22,161,89,84,215,209,212,137,10,92,157,49,29,192,101,164,152,70,87,65,8,174,214,157,175,126,98,90,54,24,100,177,247,77,19,112,47,44,165,109,233,102,14,86,109,29,134,145,132,141]]},{"chainId":2,"privateKeys":["0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d"]},{"chainId":3,"privateKeys":["notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius"]},{"chainId":4,"privateKeys":["0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d"]},{"chainId":18,"privateKeys":["symbol force gallery make bulk round subway violin worry mixture penalty kingdom boring survey tool fringe patrol sausage hard admit remember broken alien absorb"]}]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
SUPPORTED_CHAINS=[{"chainId":1,"chainName":"Solana","nodeUrl":"http://solana-devnet:8899","nativeCurrencySymbol":"SOL","tokenBridgeAddress":"B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE","bridgeAddress":"Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o","wrappedAsset":"So11111111111111111111111111111111111111112"},{"chainId":2,"chainName":"ETH","nativeCurrencySymbol":"ETH","nodeUrl":"http://eth-devnet:8545","tokenBridgeAddress":"0x0290FB167208Af455bB137780163b7B7a9a10C16","wrappedAsset":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":3,"chainName":"Terra","isTerraClassic":true,"nativeCurrencySymbol":"LUNA","nodeUrl":"http://terra-terrad:1317","tokenBridgeAddress":"terra10pyejy66429refv3g35g2t7am0was7ya7kz2a4","terraName":"localterra","terraChainId":"localterra","terraCoin":"uluna","terraGasPriceUrl":"http://terra-fcd:3060/v1/txs/gas_prices"},{"chainId":4,"chainName":"BSC","nativeCurrencySymbol":"BNB","nodeUrl":"http://eth-devnet2:8545","tokenBridgeAddress":"0x0290FB167208Af455bB137780163b7B7a9a10C16","wrappedAsset":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"}]
|
||||
SUPPORTED_CHAINS=[{"chainId":1,"chainName":"Solana","nodeUrl":"http://solana-devnet:8899","nativeCurrencySymbol":"SOL","tokenBridgeAddress":"B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE","bridgeAddress":"Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o","wrappedAsset":"So11111111111111111111111111111111111111112"},{"chainId":2,"chainName":"ETH","nativeCurrencySymbol":"ETH","nodeUrl":"http://eth-devnet:8545","tokenBridgeAddress":"0x0290FB167208Af455bB137780163b7B7a9a10C16","wrappedAsset":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":3,"chainName":"Terra Classic","isTerraClassic":true,"nativeCurrencySymbol":"LUNC","nodeUrl":"http://terra-terrad:1317","tokenBridgeAddress":"terra10pyejy66429refv3g35g2t7am0was7ya7kz2a4","terraName":"localterra","terraChainId":"localterra","terraCoin":"uluna","terraGasPriceUrl":"http://terra-fcd:3060/v1/txs/gas_prices"},{"chainId":4,"chainName":"BSC","nativeCurrencySymbol":"BNB","nodeUrl":"http://eth-devnet2:8545","tokenBridgeAddress":"0x0290FB167208Af455bB137780163b7B7a9a10C16","wrappedAsset":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":18,"chainName":"Terra","isTerraClassic":false,"nativeCurrencySymbol":"LUNA","nodeUrl":"http://terra2-terrad:1317","tokenBridgeAddress":"terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6","terraName":"localterra","terraChainId":"localterra","terraCoin":"uluna","terraGasPriceUrl":"http://terra2-fcd:3060/v1/txs/gas_prices"}]
|
||||
REDIS_HOST=redis
|
||||
REDIS_PORT=6379
|
||||
PROM_PORT=8084
|
||||
|
@ -6,5 +6,5 @@ READINESS_PORT=2000
|
|||
CLEAR_REDIS_ON_INIT=true
|
||||
DEMOTE_WORKING_ON_INIT=true
|
||||
LOG_LEVEL=debug
|
||||
SUPPORTED_TOKENS=[{"chainId":1,"address":"So11111111111111111111111111111111111111112"},{"chainId":1,"address":"2WDq7wSs9zYrpx2kbHDA4RUTRch2CCTP6ZWaH4GNfnQQ"},{"chainId":2,"address":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":2,"address":"0x2D8BE6BF0baA74e0A907016679CaE9190e80dD0A"},{"chainId":3,"address":"uluna"},{"chainId":4,"address":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"}]
|
||||
PRIVATE_KEYS=[{"chainId":1,"privateKeys":[[14,173,153,4,176,224,201,111,32,237,183,185,159,247,22,161,89,84,215,209,212,137,10,92,157,49,29,192,101,164,152,70,87,65,8,174,214,157,175,126,98,90,54,24,100,177,247,77,19,112,47,44,165,109,233,102,14,86,109,29,134,145,132,141]]},{"chainId":2,"privateKeys":["0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d"]},{"chainId":3,"privateKeys":["notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius"]},{"chainId":4,"privateKeys":["0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d"]}]
|
||||
SUPPORTED_TOKENS=[{"chainId":1,"address":"So11111111111111111111111111111111111111112"},{"chainId":1,"address":"2WDq7wSs9zYrpx2kbHDA4RUTRch2CCTP6ZWaH4GNfnQQ"},{"chainId":2,"address":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":2,"address":"0x2D8BE6BF0baA74e0A907016679CaE9190e80dD0A"},{"chainId":3,"address":"uluna"},{"chainId":4,"address":"0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E"},{"chainId":18,"address":"uluna"}]
|
||||
PRIVATE_KEYS=[{"chainId":1,"privateKeys":[[14,173,153,4,176,224,201,111,32,237,183,185,159,247,22,161,89,84,215,209,212,137,10,92,157,49,29,192,101,164,152,70,87,65,8,174,214,157,175,126,98,90,54,24,100,177,247,77,19,112,47,44,165,109,233,102,14,86,109,29,134,145,132,141]]},{"chainId":2,"privateKeys":["0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d"]},{"chainId":3,"privateKeys":["notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius"]},{"chainId":4,"privateKeys":["0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d"]},{"chainId":18,"privateKeys":["symbol force gallery make bulk round subway violin worry mixture penalty kingdom boring survey tool fringe patrol sausage hard admit remember broken alien absorb"]}]
|
|
@ -18,14 +18,15 @@
|
|||
},
|
||||
{
|
||||
"chainId": 3,
|
||||
"chainName": "Terra",
|
||||
"nativeCurrencySymbol": "LUNA",
|
||||
"nodeUrl": "https://fcd.terra.dev OR SOMETHING ELSE... ALSO UPDATE GAS PRICE URL",
|
||||
"chainName": "Terra Classic",
|
||||
"nativeCurrencySymbol": "LUNC",
|
||||
"nodeUrl": "https://columbus-fcd.terra.dev OR SOMETHING ELSE... ALSO UPDATE GAS PRICE URL",
|
||||
"tokenBridgeAddress": "terra10nmmwe8r3g99a9newtqa7a75xfgs2e8z87r2sf",
|
||||
"terraName": "mainnet",
|
||||
"terraChainId": "columbus-5",
|
||||
"terraCoin": "uluna",
|
||||
"terraGasPriceUrl": "https://fcd.terra.dev/v1/txs/gas_prices <- SHOULD BE SAME AS NODE URL"
|
||||
"terraGasPriceUrl": "https://columbus-fcd.terra.dev/v1/txs/gas_prices <- SHOULD BE SAME AS NODE URL",
|
||||
"isTerraClassic": true
|
||||
},
|
||||
{
|
||||
"chainId": 4,
|
||||
|
@ -90,5 +91,17 @@
|
|||
"nodeUrl": "https://forno.celo.org",
|
||||
"tokenBridgeAddress": "0x796Dff6D74F3E27060B71255Fe517BFb23C93eed",
|
||||
"wrappedAsset": "0x0000000000000000000000000000000000000000"
|
||||
},
|
||||
{
|
||||
"chainId": 18,
|
||||
"chainName": "Terra",
|
||||
"nativeCurrencySymbol": "LUNA",
|
||||
"nodeUrl": "https://phoenix-fcd.terra.dev OR SOMETHING ELSE... ALSO UPDATE GAS PRICE URL",
|
||||
"tokenBridgeAddress": "terra153366q50k7t8nn7gec00hg66crnhkdggpgdtaxltaq6xrutkkz3s992fw9",
|
||||
"terraName": "mainnet",
|
||||
"terraChainId": "phoenix-1",
|
||||
"terraCoin": "uluna",
|
||||
"terraGasPriceUrl": "https://phoenix-fcd.terra.dev/v1/txs/gas_prices <- SHOULD BE SAME AS NODE URL",
|
||||
"isTerraClassic": false
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
[
|
||||
{"chainId":1,"address":"So11111111111111111111111111111111111111112"},
|
||||
{"chainId":2,"address":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"},
|
||||
{"chainId":3,"address":"uluna"},
|
||||
{"chainId":3,"address":"uusd"},
|
||||
{"chainId":4,"address":"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"},
|
||||
{"chainId":5,"address":"0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270"},
|
||||
{"chainId":6,"address":"0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7"},
|
||||
{"chainId":7,"address":"0x21C718C22D52d0F3a789b752D4c2fD5908a8A733"},
|
||||
{"chainId":9,"address":"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB"},
|
||||
{"chainId":10,"address":"0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83"},
|
||||
{"chainId":13,"address":"0xe4f05a66ec68b54a58b17c22107b02e0232cc817"},
|
||||
{"chainId":14,"address":"0x471ece3750da237f93b8e339c536989b8978a438"},
|
||||
|
||||
|
||||
{"chainId":2,"address":"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"},
|
||||
{"chainId":2,"address":"0xdac17f958d2ee523a2206206994597c13d831ec7"}
|
||||
{ "chainId": 1, "address": "So11111111111111111111111111111111111111112" },
|
||||
{ "chainId": 2, "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" },
|
||||
{ "chainId": 3, "address": "uluna" },
|
||||
{ "chainId": 3, "address": "uusd" },
|
||||
{ "chainId": 4, "address": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c" },
|
||||
{ "chainId": 5, "address": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270" },
|
||||
{ "chainId": 6, "address": "0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7" },
|
||||
{ "chainId": 7, "address": "0x21C718C22D52d0F3a789b752D4c2fD5908a8A733" },
|
||||
{ "chainId": 9, "address": "0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB" },
|
||||
{ "chainId": 10, "address": "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83" },
|
||||
{ "chainId": 13, "address": "0xe4f05a66ec68b54a58b17c22107b02e0232cc817" },
|
||||
{ "chainId": 14, "address": "0x471ece3750da237f93b8e339c536989b8978a438" },
|
||||
{ "chainId": 2, "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" },
|
||||
{ "chainId": 2, "address": "0xdac17f958d2ee523a2206206994597c13d831ec7" },
|
||||
{ "chainId": 18, "address": "uluna" }
|
||||
]
|
||||
|
|
|
@ -22,12 +22,16 @@ export const SOLANA_CORE_BRIDGE_ADDRESS =
|
|||
export const SOLANA_TOKEN_BRIDGE_ADDRESS =
|
||||
"B6RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE";
|
||||
export const TERRA_NODE_URL = "http://localhost:1317";
|
||||
export const TERRA2_NODE_URL = "http://localhost:1318";
|
||||
export const TERRA_CHAIN_ID = "localterra";
|
||||
export const TERRA_GAS_PRICES_URL = "http://localhost:3060/v1/txs/gas_prices";
|
||||
export const TERRA2_GAS_PRICES_URL = "http://localhost:3061/v1/txs/gas_prices";
|
||||
export const TERRA_CORE_BRIDGE_ADDRESS =
|
||||
"terra18vd8fpwxzck93qlwghaj6arh4p7c5n896xzem5";
|
||||
export const TERRA_TOKEN_BRIDGE_ADDRESS =
|
||||
"terra10pyejy66429refv3g35g2t7am0was7ya7kz2a4";
|
||||
export const TERRA2_TOKEN_BRIDGE_ADDRESS =
|
||||
"terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6";
|
||||
export const TERRA_PRIVATE_KEY =
|
||||
"notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius";
|
||||
export const TEST_ERC20 = "0x2D8BE6BF0baA74e0A907016679CaE9190e80dD0A";
|
||||
|
|
|
@ -21,6 +21,7 @@ import {
|
|||
parseSequenceFromLogSolana,
|
||||
transferFromEth,
|
||||
transferFromSolana,
|
||||
CHAIN_ID_TERRA2,
|
||||
} from "@certusone/wormhole-sdk";
|
||||
|
||||
import getSignedVAAWithRetry from "@certusone/wormhole-sdk/lib/cjs/rpc/getSignedVAAWithRetry";
|
||||
|
@ -50,6 +51,9 @@ import {
|
|||
SOLANA_PRIVATE_KEY,
|
||||
SOLANA_TOKEN_BRIDGE_ADDRESS,
|
||||
SPY_RELAY_URL,
|
||||
TERRA2_GAS_PRICES_URL,
|
||||
TERRA2_NODE_URL,
|
||||
TERRA2_TOKEN_BRIDGE_ADDRESS,
|
||||
TERRA_CHAIN_ID,
|
||||
TERRA_GAS_PRICES_URL,
|
||||
TERRA_NODE_URL,
|
||||
|
@ -467,8 +471,8 @@ describe("Ethereum to Solana", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("Ethereum to Terra", () => {
|
||||
test("Attest Ethereum ERC-20 to Terra", (done) => {
|
||||
describe("Ethereum to Terra Classic", () => {
|
||||
test("Attest Ethereum ERC-20 to Terra Classic", (done) => {
|
||||
(async () => {
|
||||
try {
|
||||
// create a signer for Eth
|
||||
|
@ -539,12 +543,14 @@ describe("Ethereum to Terra", () => {
|
|||
done();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
done("An error occurred while trying to attest from Ethereum to Terra");
|
||||
done(
|
||||
"An error occurred while trying to attest from Ethereum to Terra Classic"
|
||||
);
|
||||
}
|
||||
})();
|
||||
});
|
||||
// TODO: it is attested
|
||||
test("Send Ethereum ERC-20 to Terra", (done) => {
|
||||
test("Send Ethereum ERC-20 to Terra Classic", (done) => {
|
||||
(async () => {
|
||||
try {
|
||||
// create a signer for Eth
|
||||
|
@ -600,12 +606,14 @@ describe("Ethereum to Terra", () => {
|
|||
done();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
done("An error occurred while trying to send from Ethereum to Terra");
|
||||
done(
|
||||
"An error occurred while trying to send from Ethereum to Terra Classic"
|
||||
);
|
||||
}
|
||||
})();
|
||||
});
|
||||
|
||||
test("Spy Relay redeemed on Terra", (done) => {
|
||||
test("Spy Relay redeemed on Terra Classic", (done) => {
|
||||
(async () => {
|
||||
try {
|
||||
const lcd = new LCDClient({
|
||||
|
@ -634,6 +642,183 @@ describe("Ethereum to Terra", () => {
|
|||
}
|
||||
expect(success).toBe(true);
|
||||
done();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
done(
|
||||
"An error occurred while checking to see if redeem on Terra Classic was successful"
|
||||
);
|
||||
}
|
||||
})();
|
||||
});
|
||||
});
|
||||
|
||||
describe("Ethereum to Terra", () => {
|
||||
test("Attest Ethereum ERC-20 to Terra", (done) => {
|
||||
(async () => {
|
||||
try {
|
||||
// create a signer for Eth
|
||||
const provider = new ethers.providers.WebSocketProvider(ETH_NODE_URL);
|
||||
const signer = new ethers.Wallet(ETH_PRIVATE_KEY, provider);
|
||||
// attest the test token
|
||||
const receipt = await attestFromEth(
|
||||
ETH_TOKEN_BRIDGE_ADDRESS,
|
||||
signer,
|
||||
TEST_ERC20
|
||||
);
|
||||
// get the sequence from the logs (needed to fetch the vaa)
|
||||
const sequence = parseSequenceFromLogEth(
|
||||
receipt,
|
||||
ETH_CORE_BRIDGE_ADDRESS
|
||||
);
|
||||
const emitterAddress = getEmitterAddressEth(ETH_TOKEN_BRIDGE_ADDRESS);
|
||||
// poll until the guardian(s) witness and sign the vaa
|
||||
const { vaaBytes: signedVAA } = await getSignedVAAWithRetry(
|
||||
WORMHOLE_RPC_HOSTS,
|
||||
CHAIN_ID_ETH,
|
||||
emitterAddress,
|
||||
sequence,
|
||||
{
|
||||
transport: NodeHttpTransport(),
|
||||
}
|
||||
);
|
||||
const lcd = new LCDClient({
|
||||
URL: TERRA2_NODE_URL,
|
||||
chainID: TERRA_CHAIN_ID,
|
||||
isClassic: false,
|
||||
});
|
||||
const mk = new MnemonicKey({
|
||||
mnemonic: TERRA_PRIVATE_KEY,
|
||||
});
|
||||
const wallet = lcd.wallet(mk);
|
||||
const msg = await createWrappedOnTerra(
|
||||
TERRA2_TOKEN_BRIDGE_ADDRESS,
|
||||
wallet.key.accAddress,
|
||||
signedVAA
|
||||
);
|
||||
const gasPrices = await axios
|
||||
.get(TERRA2_GAS_PRICES_URL)
|
||||
.then((result) => result.data);
|
||||
const account = await lcd.auth.accountInfo(wallet.key.accAddress);
|
||||
const feeEstimate = await lcd.tx.estimateFee(
|
||||
[
|
||||
{
|
||||
sequenceNumber: account.getSequenceNumber(),
|
||||
publicKey: account.getPublicKey(),
|
||||
},
|
||||
],
|
||||
{
|
||||
msgs: [msg],
|
||||
feeDenoms: ["uluna"],
|
||||
gasPrices,
|
||||
}
|
||||
);
|
||||
const tx = await wallet.createAndSignTx({
|
||||
msgs: [msg],
|
||||
memo: "test",
|
||||
feeDenoms: ["uluna"],
|
||||
gasPrices,
|
||||
fee: feeEstimate,
|
||||
});
|
||||
await lcd.tx.broadcast(tx);
|
||||
provider.destroy();
|
||||
done();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
done("An error occurred while trying to attest from Ethereum to Terra");
|
||||
}
|
||||
})();
|
||||
});
|
||||
// TODO: it is attested
|
||||
test("Send Ethereum ERC-20 to Terra", (done) => {
|
||||
(async () => {
|
||||
try {
|
||||
// create a signer for Eth
|
||||
const provider = new ethers.providers.WebSocketProvider(ETH_NODE_URL);
|
||||
const signer = new ethers.Wallet(ETH_PRIVATE_KEY, provider);
|
||||
const amount = parseUnits("1", 18);
|
||||
const fee = parseUnits("1", 12);
|
||||
const transferAmount = amount.add(fee);
|
||||
// approve the bridge to spend tokens
|
||||
await approveEth(
|
||||
ETH_TOKEN_BRIDGE_ADDRESS,
|
||||
TEST_ERC20,
|
||||
signer,
|
||||
transferAmount
|
||||
);
|
||||
const lcd = new LCDClient({
|
||||
URL: TERRA2_NODE_URL,
|
||||
chainID: TERRA_CHAIN_ID,
|
||||
isClassic: false,
|
||||
});
|
||||
const mk = new MnemonicKey({
|
||||
mnemonic: TERRA_PRIVATE_KEY,
|
||||
});
|
||||
const wallet = lcd.wallet(mk);
|
||||
// transfer tokens
|
||||
const receipt = await transferFromEth(
|
||||
ETH_TOKEN_BRIDGE_ADDRESS,
|
||||
signer,
|
||||
TEST_ERC20,
|
||||
transferAmount,
|
||||
CHAIN_ID_TERRA2,
|
||||
hexToUint8Array(
|
||||
nativeToHexString(wallet.key.accAddress, CHAIN_ID_TERRA2) || ""
|
||||
),
|
||||
fee
|
||||
);
|
||||
// get the sequence from the logs (needed to fetch the vaa)
|
||||
sequence = parseSequenceFromLogEth(receipt, ETH_CORE_BRIDGE_ADDRESS);
|
||||
emitterAddress = getEmitterAddressEth(ETH_TOKEN_BRIDGE_ADDRESS);
|
||||
// poll until the guardian(s) witness and sign the vaa
|
||||
const { vaaBytes: signedVAA } = await getSignedVAAWithRetry(
|
||||
WORMHOLE_RPC_HOSTS,
|
||||
CHAIN_ID_ETH,
|
||||
emitterAddress,
|
||||
sequence,
|
||||
{
|
||||
transport: NodeHttpTransport(),
|
||||
}
|
||||
);
|
||||
console.log("Got signed vaa: ", signedVAA);
|
||||
transferSignedVAA = signedVAA;
|
||||
provider.destroy();
|
||||
done();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
done("An error occurred while trying to send from Ethereum to Terra");
|
||||
}
|
||||
})();
|
||||
});
|
||||
|
||||
test("Spy Relay redeemed on Terra", (done) => {
|
||||
(async () => {
|
||||
try {
|
||||
const lcd = new LCDClient({
|
||||
URL: TERRA2_NODE_URL,
|
||||
chainID: TERRA_CHAIN_ID,
|
||||
isClassic: false,
|
||||
});
|
||||
var success: boolean = false;
|
||||
for (let count = 0; count < 5 && !success; ++count) {
|
||||
console.log(
|
||||
"sleeping before querying spy relay",
|
||||
new Date().toLocaleString()
|
||||
);
|
||||
await sleep(5000);
|
||||
success = await await getIsTransferCompletedTerra(
|
||||
TERRA2_TOKEN_BRIDGE_ADDRESS,
|
||||
transferSignedVAA,
|
||||
lcd,
|
||||
TERRA2_GAS_PRICES_URL
|
||||
);
|
||||
console.log(
|
||||
"getIsTransferCompletedTerra returned %d, count is %d",
|
||||
success,
|
||||
count
|
||||
);
|
||||
}
|
||||
expect(success).toBe(true);
|
||||
done();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
done(
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
import {
|
||||
ChainId,
|
||||
CHAIN_ID_SOLANA,
|
||||
CHAIN_ID_TERRA,
|
||||
uint8ArrayToHex,
|
||||
tryHexToNativeString,
|
||||
getEmitterAddressEth,
|
||||
getEmitterAddressSolana,
|
||||
getEmitterAddressTerra,
|
||||
parseTransferPayload,
|
||||
isTerraChain,
|
||||
} from "@certusone/wormhole-sdk";
|
||||
import { getListenerEnvironment } from "../../configureEnv";
|
||||
import { getScopedLogger, ScopedLogger } from "../../helpers/logHelper";
|
||||
|
@ -37,7 +37,7 @@ async function encodeEmitterAddress(
|
|||
return await getEmitterAddressSolana(emitterAddressStr);
|
||||
}
|
||||
|
||||
if (myChainId === CHAIN_ID_TERRA) {
|
||||
if (isTerraChain(myChainId)) {
|
||||
return await getEmitterAddressTerra(emitterAddressStr);
|
||||
}
|
||||
|
||||
|
@ -229,19 +229,6 @@ export class TokenBridgeListener implements Listener {
|
|||
}
|
||||
const parsedVaa: ParsedVaa<ParsedTransferPayload> = validationResults;
|
||||
|
||||
const originChain = parsedVaa.payload.originChain;
|
||||
const originAddress = parsedVaa.payload.originAddress;
|
||||
|
||||
let originAddressNative: string;
|
||||
try {
|
||||
originAddressNative = tryHexToNativeString(originAddress, originChain);
|
||||
} catch (e: any) {
|
||||
this.logger.error(
|
||||
`Failure to convert address "${originAddress}" on chain "${originChain}" to the native address`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const redisKey: StoreKey = storeKeyFromParsedVAA(parsedVaa);
|
||||
const isQueued = await checkQueue(storeKeyToJson(redisKey));
|
||||
if (isQueued) {
|
||||
|
|
|
@ -8,6 +8,7 @@ import {
|
|||
isEVMChain,
|
||||
parseTransferPayload,
|
||||
CHAIN_ID_UNSET,
|
||||
isTerraChain,
|
||||
} from "@certusone/wormhole-sdk";
|
||||
|
||||
import { REDIS_RETRY_MS, AUDIT_INTERVAL_MS, Relayer } from "../definitions";
|
||||
|
@ -357,7 +358,7 @@ export class TokenBridgeRelayer implements Relayer {
|
|||
return rResult;
|
||||
}
|
||||
|
||||
if (transferPayload.targetChain === CHAIN_ID_TERRA) {
|
||||
if (isTerraChain(transferPayload.targetChain)) {
|
||||
let rResult: RelayResult = { status: Status.Error, result: "" };
|
||||
const retVal = await relayTerra(
|
||||
chainConfigInfo,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
ChainId,
|
||||
CHAIN_ID_SOLANA,
|
||||
CHAIN_ID_TERRA,
|
||||
isTerraChain,
|
||||
nativeToHexString,
|
||||
} from "@certusone/wormhole-sdk";
|
||||
import { getLogger } from "./helpers/logHelper";
|
||||
|
@ -345,7 +345,7 @@ export function loadChainConfig(): ChainConfigInfo[] {
|
|||
supportedChains.push(
|
||||
createSolanaChainConfig(element, privateKeyObj.privateKeys)
|
||||
);
|
||||
} else if (element.chainId === CHAIN_ID_TERRA) {
|
||||
} else if (isTerraChain(element.chainId)) {
|
||||
supportedChains.push(
|
||||
createTerraChainConfig(element, privateKeyObj.privateKeys)
|
||||
);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require("../helpers/loadConfig");
|
||||
process.env.LOG_DIR = ".";
|
||||
|
||||
import { CHAIN_ID_TERRA } from "@certusone/wormhole-sdk";
|
||||
import { CHAIN_ID_TERRA, CHAIN_ID_TERRA2 } from "@certusone/wormhole-sdk";
|
||||
import { jest, test } from "@jest/globals";
|
||||
import { LCDClient } from "@terra-money/terra.js";
|
||||
import { ChainConfigInfo } from "../configureEnv";
|
||||
|
@ -41,49 +41,52 @@ jest.setTimeout(300000);
|
|||
// }
|
||||
// });
|
||||
|
||||
const terraChainConfig: ChainConfigInfo = {
|
||||
const terraClassicChainConfig: ChainConfigInfo = {
|
||||
chainId: CHAIN_ID_TERRA,
|
||||
chainName: "Terra",
|
||||
nativeCurrencySymbol: "UST",
|
||||
nodeUrl: "https://fcd.terra.dev",
|
||||
chainName: "Terra Classic",
|
||||
nativeCurrencySymbol: "LUNC",
|
||||
nodeUrl: "https://columbus-fcd.terra.dev",
|
||||
tokenBridgeAddress: "terra10nmmwe8r3g99a9newtqa7a75xfgs2e8z87r2sf",
|
||||
terraName: "mainnet",
|
||||
terraChainId: "columbus-5",
|
||||
terraCoin: "uluna",
|
||||
terraGasPriceUrl: "https://fcd.terra.dev/v1/txs/gas_prices",
|
||||
terraGasPriceUrl: "https://columbus-fcd.terra.dev/v1/txs/gas_prices",
|
||||
};
|
||||
|
||||
const supportedTokens = require("../../config/mainnet/supportedTokens.json");
|
||||
|
||||
test("should pull Terra token balances", async () => {
|
||||
test("should pull Terra Classic token balances", async () => {
|
||||
if (
|
||||
!(
|
||||
terraChainConfig.terraChainId &&
|
||||
terraChainConfig.terraCoin &&
|
||||
terraChainConfig.terraGasPriceUrl &&
|
||||
terraChainConfig.terraName
|
||||
terraClassicChainConfig.terraChainId &&
|
||||
terraClassicChainConfig.terraCoin &&
|
||||
terraClassicChainConfig.terraGasPriceUrl &&
|
||||
terraClassicChainConfig.terraName
|
||||
)
|
||||
) {
|
||||
throw new Error("Terra relay was called without proper instantiation.");
|
||||
throw new Error(
|
||||
"Terra Classic relay was called without proper instantiation."
|
||||
);
|
||||
}
|
||||
const lcdConfig = {
|
||||
URL: terraChainConfig.nodeUrl,
|
||||
chainID: terraChainConfig.terraChainId,
|
||||
name: terraChainConfig.terraName,
|
||||
URL: terraClassicChainConfig.nodeUrl,
|
||||
chainID: terraClassicChainConfig.terraChainId,
|
||||
name: terraClassicChainConfig.terraName,
|
||||
isClassic: true,
|
||||
};
|
||||
const lcd = new LCDClient(lcdConfig);
|
||||
const localAddresses = await calcLocalAddressesTerra(
|
||||
lcd,
|
||||
supportedTokens,
|
||||
terraChainConfig
|
||||
terraClassicChainConfig
|
||||
);
|
||||
expect(localAddresses.length).toBeGreaterThan(0);
|
||||
for (const tokenAddress of localAddresses) {
|
||||
const balance = await pullTerraBalance(
|
||||
lcd,
|
||||
terraChainConfig.tokenBridgeAddress,
|
||||
tokenAddress
|
||||
terraClassicChainConfig.tokenBridgeAddress,
|
||||
tokenAddress,
|
||||
CHAIN_ID_TERRA
|
||||
);
|
||||
console.log(balance);
|
||||
expect(balance).toBeDefined();
|
||||
|
|
|
@ -2,11 +2,12 @@ import {
|
|||
Bridge__factory,
|
||||
ChainId,
|
||||
CHAIN_ID_SOLANA,
|
||||
CHAIN_ID_TERRA,
|
||||
getForeignAssetTerra,
|
||||
hexToUint8Array,
|
||||
isEVMChain,
|
||||
isTerraChain,
|
||||
nativeToHexString,
|
||||
TerraChainId,
|
||||
WSOL_DECIMALS,
|
||||
} from "@certusone/wormhole-sdk";
|
||||
import { TOKEN_PROGRAM_ID } from "@solana/spl-token";
|
||||
|
@ -89,7 +90,7 @@ async function pullBalances(metrics: PromHelper): Promise<WalletBalance[]> {
|
|||
// TODO one day this will spin up independent watchers that time themselves
|
||||
// purposefully not awaited
|
||||
pullAllEVMTokens(env.supportedTokens, chainInfo, metrics);
|
||||
} else if (chainInfo.chainId === CHAIN_ID_TERRA) {
|
||||
} else if (isTerraChain(chainInfo.chainId)) {
|
||||
// TODO one day this will spin up independent watchers that time themselves
|
||||
// purposefully not awaited
|
||||
pullAllTerraBalances(env.supportedTokens, chainInfo, metrics);
|
||||
|
@ -118,7 +119,8 @@ async function pullBalances(metrics: PromHelper): Promise<WalletBalance[]> {
|
|||
export async function pullTerraBalance(
|
||||
lcd: LCDClient,
|
||||
walletAddress: string,
|
||||
tokenAddress: string
|
||||
tokenAddress: string,
|
||||
chainId: TerraChainId
|
||||
): Promise<WalletBalance | undefined> {
|
||||
try {
|
||||
const tokenInfo: any = await lcd.wasm.contractQuery(tokenAddress, {
|
||||
|
@ -135,7 +137,7 @@ export async function pullTerraBalance(
|
|||
}
|
||||
|
||||
return {
|
||||
chainId: CHAIN_ID_TERRA,
|
||||
chainId,
|
||||
balanceAbs: balanceInfo?.balance?.toString() || "0",
|
||||
balanceFormatted: formatUnits(
|
||||
balanceInfo?.balance?.toString() || "0",
|
||||
|
@ -247,7 +249,7 @@ async function pullTerraNativeBalance(
|
|||
chainId: chainInfo.chainId,
|
||||
balanceAbs: balance[key],
|
||||
balanceFormatted: formatUnits(balance[key], 6).toString(),
|
||||
currencyName: formatNativeDenom(key),
|
||||
currencyName: formatNativeDenom(key, chainInfo.chainId as TerraChainId),
|
||||
currencyAddressNative: key,
|
||||
isNative: true,
|
||||
walletAddress: walletAddress,
|
||||
|
@ -518,7 +520,12 @@ async function pullAllTerraBalances(
|
|||
...(await pullTerraNativeBalance(lcd, chainConfig, walletAddress)),
|
||||
];
|
||||
for (const address of localAddresses) {
|
||||
const balance = await pullTerraBalance(lcd, walletAddress, address);
|
||||
const balance = await pullTerraBalance(
|
||||
lcd,
|
||||
walletAddress,
|
||||
address,
|
||||
chainConfig.chainId as TerraChainId
|
||||
);
|
||||
if (balance) {
|
||||
balances.push(balance);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { hexToUint8Array, parseTransferPayload } from "@certusone/wormhole-sdk";
|
||||
import { hexToUint8Array } from "@certusone/wormhole-sdk";
|
||||
import { importCoreWasm } from "@certusone/wormhole-sdk/lib/cjs/solana/wasm";
|
||||
import { getRelayerEnvironment, RelayerEnvironment } from "../configureEnv";
|
||||
import { getLogger, getScopedLogger, ScopedLogger } from "../helpers/logHelper";
|
||||
|
|
|
@ -1,12 +1,23 @@
|
|||
import { isNativeTerra } from "@certusone/wormhole-sdk";
|
||||
import {
|
||||
CHAIN_ID_TERRA2,
|
||||
isNativeTerra,
|
||||
TerraChainId,
|
||||
} from "@certusone/wormhole-sdk";
|
||||
|
||||
// inspired by https://github.com/terra-money/station/blob/dca7de43958ce075c6e46605622203b9859b0e14/src/lib/utils/format.ts#L38
|
||||
export const formatNativeDenom = (denom = ""): string => {
|
||||
export const LUNA_SYMBOL = "LUNA";
|
||||
export const LUNA_CLASSIC_SYMBOL = "LUNC";
|
||||
|
||||
export const formatNativeDenom = (
|
||||
denom: string,
|
||||
chainId: TerraChainId
|
||||
): string => {
|
||||
const unit = denom.slice(1).toUpperCase();
|
||||
const isValidTerra = isNativeTerra(denom);
|
||||
return denom === "uluna"
|
||||
? "Luna"
|
||||
? chainId === CHAIN_ID_TERRA2
|
||||
? LUNA_SYMBOL
|
||||
: LUNA_CLASSIC_SYMBOL
|
||||
: isValidTerra
|
||||
? unit.slice(0, 2) + "T"
|
||||
? unit.slice(0, 2) + "TC"
|
||||
: "";
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue