diff --git a/scripts/build.tokens.ckerc20.mjs b/scripts/build.tokens.ckerc20.mjs index 4bb0220f5..919d85330 100755 --- a/scripts/build.tokens.ckerc20.mjs +++ b/scripts/build.tokens.ckerc20.mjs @@ -24,7 +24,10 @@ const orchestratorInfo = async ({ orchestratorId: canisterId }) => { const buildOrchestratorInfo = async (orchestratorId) => { const { managed_canisters } = await orchestratorInfo({ orchestratorId }); - const mapManagedCanisters = (acc, { ledger, index, ckerc20_token_symbol }) => { + const mapManagedCanisters = ( + acc, + { ledger, index, ckerc20_token_symbol, erc20_contract: { address: erc20ContractAddress } } + ) => { const ledgerCanister = fromNullable(ledger); const indexCanister = fromNullable(index); @@ -44,7 +47,8 @@ const buildOrchestratorInfo = async (orchestratorId) => { ...(acc[ckerc20_token_symbol] ?? []), { ledgerCanisterId: ledgerCanisterId.toText(), - indexCanisterId: indexCanisterId.toText() + indexCanisterId: indexCanisterId.toText(), + erc20ContractAddress } ] }; diff --git a/src/frontend/src/env/tokens.ckerc20.json b/src/frontend/src/env/tokens.ckerc20.json index cdf72fd82..92db2d343 100644 --- a/src/frontend/src/env/tokens.ckerc20.json +++ b/src/frontend/src/env/tokens.ckerc20.json @@ -1 +1 @@ -{"production":{"ckLINK":{"ledgerCanisterId":"g4tto-rqaaa-aaaar-qageq-cai","indexCanisterId":"gvqys-hyaaa-aaaar-qagfa-cai"},"ckUSDC":{"ledgerCanisterId":"xevnm-gaaaa-aaaar-qafnq-cai","indexCanisterId":"xrs4b-hiaaa-aaaar-qafoa-cai"}},"staging":{"ckSepoliaUSDC":{"ledgerCanisterId":"yfumr-cyaaa-aaaar-qaela-cai","indexCanisterId":"ycvkf-paaaa-aaaar-qaelq-cai"},"ckSepoliaPEPE":{"ledgerCanisterId":"hw4ru-taaaa-aaaar-qagdq-cai","indexCanisterId":"g3sv2-4iaaa-aaaar-qagea-cai"},"ckSepoliaLINK":{"ledgerCanisterId":"r52mc-qaaaa-aaaar-qafzq-cai","indexCanisterId":"ri55p-riaaa-aaaar-qaf2a-cai"}}} \ No newline at end of file +{"production":{"ckLINK":{"ledgerCanisterId":"g4tto-rqaaa-aaaar-qageq-cai","indexCanisterId":"gvqys-hyaaa-aaaar-qagfa-cai","erc20ContractAddress":"0x514910771AF9Ca656af840dff83E8264EcF986CA"},"ckUSDC":{"ledgerCanisterId":"xevnm-gaaaa-aaaar-qafnq-cai","indexCanisterId":"xrs4b-hiaaa-aaaar-qafoa-cai","erc20ContractAddress":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"}},"staging":{"ckSepoliaUSDC":{"ledgerCanisterId":"yfumr-cyaaa-aaaar-qaela-cai","indexCanisterId":"ycvkf-paaaa-aaaar-qaelq-cai","erc20ContractAddress":"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"},"ckSepoliaPEPE":{"ledgerCanisterId":"hw4ru-taaaa-aaaar-qagdq-cai","indexCanisterId":"g3sv2-4iaaa-aaaar-qagea-cai","erc20ContractAddress":"0x560eF9F39E4B08f9693987cad307f6FBfd97B2F6"},"ckSepoliaLINK":{"ledgerCanisterId":"r52mc-qaaaa-aaaar-qafzq-cai","indexCanisterId":"ri55p-riaaa-aaaar-qaf2a-cai","erc20ContractAddress":"0x779877A7B0D9E8603169DdbD7836e478b4624789"}}} \ No newline at end of file diff --git a/src/frontend/src/icp/types/env-token-ckerc20.ts b/src/frontend/src/icp/types/env-token-ckerc20.ts index 142681ae1..09b756d04 100644 --- a/src/frontend/src/icp/types/env-token-ckerc20.ts +++ b/src/frontend/src/icp/types/env-token-ckerc20.ts @@ -1,8 +1,12 @@ +import { isEthAddress } from '$lib/utils/account.utils'; import { z } from 'zod'; +const envErc20ContractAddress = z.custom(isEthAddress, 'Invalid ERC20 Contract Address'); + const envTokenData = z.object({ ledgerCanisterId: z.string(), - indexCanisterId: z.string() + indexCanisterId: z.string(), + erc20ContractAddress: envErc20ContractAddress }); const envTokenSymbol = z.string();