Skip to content

Commit

Permalink
use identity manager
Browse files Browse the repository at this point in the history
  • Loading branch information
lukachi committed Apr 2, 2024
1 parent 7d6b107 commit 3ee3501
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/assets/fallback-supported-chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 5 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<SUPPORTED_CHAINS, string> = {
Expand Down Expand Up @@ -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
}),
})

Expand Down
4 changes: 2 additions & 2 deletions src/pages/AuthConfirmation/AuthConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const AuthConfirmation: FC<Props> = () => {
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}`]),
),
[],
)
Expand Down Expand Up @@ -101,7 +101,7 @@ const AuthConfirmation: FC<Props> = () => {

const tx = await provider?.signAndSendTx?.({
to: config?.[
`SEMAPHORE_VERIFIER_CONTRACT_ADDRESS_${selectedChainToPublish}`
`IDENTITY_MANAGER_CONTRACT_ADDRESS_${selectedChainToPublish}`
],
data: txBody,
})
Expand Down

0 comments on commit 3ee3501

Please sign in to comment.