From 3ee3501036d293b5a1c5da45c8854a75e86f473b Mon Sep 17 00:00:00 2001 From: lukachi Date: Tue, 2 Apr 2024 15:15:37 +0300 Subject: [PATCH] use identity manager --- src/assets/fallback-supported-chains.json | 4 ++-- src/config.ts | 8 +++++--- src/pages/AuthConfirmation/AuthConfirmation.tsx | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/assets/fallback-supported-chains.json b/src/assets/fallback-supported-chains.json index bb612e4..b8a3eb0 100644 --- a/src/assets/fallback-supported-chains.json +++ b/src/assets/fallback-supported-chains.json @@ -40,12 +40,12 @@ }, "POLYGON_TESTNET": { "id": "80001", - "name": "Polygon Testnet", + "name": "Polygon Mumbai", "rpcUrl": "https://endpoints.omniatech.io/v1/matic/mumbai/public", "explorerUrl": "https://mumbai.polygonscan.com/", "token": { "name": "Matic", - "symbol": "Matic", + "symbol": "MATIC", "decimals": 18 }, "type": "EVM", diff --git a/src/config.ts b/src/config.ts index 7d3c132..628e290 100644 --- a/src/config.ts +++ b/src/config.ts @@ -10,7 +10,9 @@ import packageJson from '../package.json' export type SUPPORTED_CHAINS = keyof typeof FALLBACK_SUPPORTED_CHAINS type ContractAddresses = { - [k in `SEMAPHORE_VERIFIER_CONTRACT_ADDRESS_${SUPPORTED_CHAINS}`]: string + [k in + | `SEMAPHORE_VERIFIER_CONTRACT_ADDRESS_${SUPPORTED_CHAINS}` + | `IDENTITY_MANAGER_CONTRACT_ADDRESS_${SUPPORTED_CHAINS}`]: string } export const RELAYER_RELAY_CHAIN_NAMES: Record = { @@ -69,13 +71,13 @@ Object.assign(config, { /* prettier-ignore */ [`SEMAPHORE_VERIFIER_CONTRACT_ADDRESS_${curr}`]: import.meta.env[`VITE_SEMAPHORE_VERIFIER_CONTRACT_ADDRESS_${curr}`] || '', /* prettier-ignore */ - [`VERIFIED_SBT_CONTRACT_ADDRESS_${curr}`]: import.meta.env[`VITE_VERIFIED_SBT_CONTRACT_ADDRESS_${curr}`] || '', + [`IDENTITY_MANAGER_CONTRACT_ADDRESS_${curr}`]: import.meta.env[`VITE_IDENTITY_MANAGER_CONTRACT_ADDRESS_${curr}`] || '', }), {}, ) as { [k in | `SEMAPHORE_VERIFIER_CONTRACT_ADDRESS_${SUPPORTED_CHAINS}` - | `VERIFIED_SBT_CONTRACT_ADDRESS_${SUPPORTED_CHAINS}`]: string + | `IDENTITY_MANAGER_CONTRACT_ADDRESS_${SUPPORTED_CHAINS}`]: string }), }) diff --git a/src/pages/AuthConfirmation/AuthConfirmation.tsx b/src/pages/AuthConfirmation/AuthConfirmation.tsx index 89ca03d..7428fce 100644 --- a/src/pages/AuthConfirmation/AuthConfirmation.tsx +++ b/src/pages/AuthConfirmation/AuthConfirmation.tsx @@ -43,7 +43,7 @@ const AuthConfirmation: FC = () => { config.SUPPORTED_CHAINS_DETAILS, ) as (keyof typeof config.SUPPORTED_CHAINS_DETAILS)[] )?.filter(el => - Boolean(config?.[`SEMAPHORE_VERIFIER_CONTRACT_ADDRESS_${el}`]), + Boolean(config?.[`IDENTITY_MANAGER_CONTRACT_ADDRESS_${el}`]), ), [], ) @@ -101,7 +101,7 @@ const AuthConfirmation: FC = () => { const tx = await provider?.signAndSendTx?.({ to: config?.[ - `SEMAPHORE_VERIFIER_CONTRACT_ADDRESS_${selectedChainToPublish}` + `IDENTITY_MANAGER_CONTRACT_ADDRESS_${selectedChainToPublish}` ], data: txBody, })