From 189d6a26ab2ff1c09fcd9de8a28011cc2066541e Mon Sep 17 00:00:00 2001 From: mehditorabiv Date: Tue, 3 Dec 2024 14:17:12 +0300 Subject: [PATCH] add arb --- src/App.tsx | 4 +- src/hooks/useAttestations.tsx | 1 + src/main.tsx | 6 +- src/services/eas/index.ts | 2 +- src/utils/contracts/app/contracts.ts | 234 +++++++++++++++++++++++++++ src/utils/contracts/eas/constants.ts | 1 + src/utils/contracts/eas/contracts.ts | 7 + src/utils/contracts/oid/contracts.ts | 159 ++++++++++++++++++ 8 files changed, 408 insertions(+), 6 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index d7d99d9..2b621ef 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -10,7 +10,7 @@ import { } from '@rainbow-me/rainbowkit'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { Navigate, Route, Routes } from 'react-router-dom'; -import { baseSepolia } from 'viem/chains'; +import { arbitrum } from 'viem/chains'; import { useAccount } from 'wagmi'; import MobileScreensContainer from './components/layouts/MobileScreensContainer'; @@ -54,7 +54,7 @@ const App: React.FC = () => { status={authStatus} > { const { address, chainId } = useAccount(); + const { data: attestationsResponse, error, diff --git a/src/main.tsx b/src/main.tsx index 5fdecdb..7c0a301 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -6,7 +6,7 @@ import { CssBaseline } from '@mui/material'; import { getDefaultConfig } from '@rainbow-me/rainbowkit'; import ReactDOM from 'react-dom/client'; import { BrowserRouter } from 'react-router-dom'; -import { baseSepolia, optimismSepolia } from 'viem/chains'; +import { arbitrum, baseSepolia, optimismSepolia } from 'viem/chains'; import { http, WagmiProvider } from 'wagmi'; import App from './App'; @@ -17,12 +17,12 @@ if (!import.meta.env.VITE_PROJECT_ID) { } const projectID = import.meta.env.VITE_PROJECT_ID; -export const SUPPORTED_CHAINS = [baseSepolia, optimismSepolia]; +export const SUPPORTED_CHAINS = [baseSepolia, optimismSepolia, arbitrum]; const config = getDefaultConfig({ appName: 'Identity on chain platform', projectId: projectID, - chains: [optimismSepolia, baseSepolia], + chains: [optimismSepolia, baseSepolia, arbitrum], transports: SUPPORTED_CHAINS.reduce( (obj, chain) => ({ ...obj, [chain.id]: http() }), {} diff --git a/src/services/eas/index.ts b/src/services/eas/index.ts index 4886341..b0c2a4a 100644 --- a/src/services/eas/index.ts +++ b/src/services/eas/index.ts @@ -4,8 +4,8 @@ export const chainIdToGraphQLEndpoint: { [key: number]: string } = { 11155111: 'https://sepolia.easscan.org/graphql', 11155420: 'https://optimism-sepolia-bedrock.easscan.org/graphql', 84532: 'https://base-sepolia.easscan.org/graphql', + 42161: 'https://arbitrum.easscan.org/graphql', // 1: "https://easscan.org/graphql", - // 42161: "https://arbitrum.easscan.org/graphql", // 42170: "https://arbitrum-nova.easscan.org/graphql", // 8453: "https://base.easscan.org/graphql", // 10: "https://optimism.easscan.org/graphql", diff --git a/src/utils/contracts/app/contracts.ts b/src/utils/contracts/app/contracts.ts index 9303a14..b21b89d 100644 --- a/src/utils/contracts/app/contracts.ts +++ b/src/utils/contracts/app/contracts.ts @@ -467,4 +467,238 @@ export const appContracts = [ }, ], }, + { + chainId: 42_161, + address: '0x8006cCF2b3240bB716c86E5a16A9dD9b32eC5c53', + abi: [ + { + inputs: [ + { + internalType: 'address', + name: 'initialAuthority', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { internalType: 'address', name: 'authority', type: 'address' }, + ], + name: 'AccessManagedInvalidAuthority', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'caller', type: 'address' }, + { internalType: 'uint32', name: 'delay', type: 'uint32' }, + ], + name: 'AccessManagedRequiredDelay', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'caller', type: 'address' }], + name: 'AccessManagedUnauthorized', + type: 'error', + }, + { inputs: [], name: 'ReentrancyGuardReentrantCall', type: 'error' }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + components: [ + { internalType: 'uint256', name: 'id', type: 'uint256' }, + { internalType: 'string', name: 'name', type: 'string' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + indexed: false, + internalType: 'struct IApplicationManager.Application', + name: 'application', + type: 'tuple', + }, + ], + name: 'ApplicationCreated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + components: [ + { internalType: 'uint256', name: 'id', type: 'uint256' }, + { internalType: 'string', name: 'name', type: 'string' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + indexed: false, + internalType: 'struct IApplicationManager.Application', + name: 'application', + type: 'tuple', + }, + ], + name: 'ApplicationDeleted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + components: [ + { internalType: 'uint256', name: 'id', type: 'uint256' }, + { internalType: 'string', name: 'name', type: 'string' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + indexed: false, + internalType: 'struct IApplicationManager.Application', + name: 'application', + type: 'tuple', + }, + ], + name: 'ApplicationUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'authority', + type: 'address', + }, + ], + name: 'AuthorityUpdated', + type: 'event', + }, + { + inputs: [], + name: 'authority', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + components: [ + { internalType: 'string', name: 'name', type: 'string' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + internalType: 'struct IApplicationManager.ApplicationDto', + name: 'dto', + type: 'tuple', + }, + ], + name: 'createApplication', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'id', type: 'uint256' }], + name: 'deleteApplication', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [{ internalType: 'uint256', name: 'id', type: 'uint256' }], + name: 'getApplication', + outputs: [ + { + components: [ + { internalType: 'uint256', name: 'id', type: 'uint256' }, + { internalType: 'string', name: 'name', type: 'string' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + internalType: 'struct IApplicationManager.Application', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'start', type: 'uint256' }, + { internalType: 'uint256', name: 'limit', type: 'uint256' }, + ], + name: 'getApplications', + outputs: [ + { + components: [ + { internalType: 'uint256', name: 'id', type: 'uint256' }, + { internalType: 'string', name: 'name', type: 'string' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + internalType: 'struct IApplicationManager.Application[]', + name: '', + type: 'tuple[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getNextApplicationId', + outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'isConsumingScheduledOp', + outputs: [{ internalType: 'bytes4', name: '', type: 'bytes4' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'newAuthority', type: 'address' }, + ], + name: 'setAuthority', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'uint256', name: 'id', type: 'uint256' }, + { + components: [ + { internalType: 'string', name: 'name', type: 'string' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + internalType: 'struct IApplicationManager.ApplicationDto', + name: 'dto', + type: 'tuple', + }, + ], + name: 'updateApplication', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, ]; diff --git a/src/utils/contracts/eas/constants.ts b/src/utils/contracts/eas/constants.ts index 753ab96..2a10914 100644 --- a/src/utils/contracts/eas/constants.ts +++ b/src/utils/contracts/eas/constants.ts @@ -5,4 +5,5 @@ export const EAS_SCHEMA_ID: { [key: string | number]: string } = { 11155420: '0x2c988095892ea57c600e5cc6fb62531502bc0c8d038ac39dc3fab161b6f122db', 84532: '0xe8c59f8de4cdf61c8ebefa3ed83d714acc767dda3bbff00623e73f5a8bf5255f', + 42161: '0x6b5b50f2de8b387664838bd3c751e21f6b9aac7cf4bf5b2fb86e760b89a8a22d', }; diff --git a/src/utils/contracts/eas/contracts.ts b/src/utils/contracts/eas/contracts.ts index ae97aaf..a20726b 100644 --- a/src/utils/contracts/eas/contracts.ts +++ b/src/utils/contracts/eas/contracts.ts @@ -13,4 +13,11 @@ export const contracts = [ easContractAddress: '0x4200000000000000000000000000000000000021', abi: [], }, + { + chainId: 42_161, + easSchemaUUID: + '0x6b5b50f2de8b387664838bd3c751e21f6b9aac7cf4bf5b2fb86e760b89a8a22d', + easContractAddress: '0xbD75f629A22Dc1ceD33dDA0b68c546A1c035c458', + abi: [], + }, ]; diff --git a/src/utils/contracts/oid/contracts.ts b/src/utils/contracts/oid/contracts.ts index 9e2d948..23380a0 100644 --- a/src/utils/contracts/oid/contracts.ts +++ b/src/utils/contracts/oid/contracts.ts @@ -317,4 +317,163 @@ export const oidContracts = [ }, ], }, + { + chainId: 42_161, + address: '0x9a85Bb58CFb60ABd205c4Af7039fF73C86b41bd8', + abi: [ + { + inputs: [ + { + internalType: 'address', + name: 'initialAuthority', + type: 'address', + }, + { + internalType: 'contract IEAS', + name: 'initialEAS', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { internalType: 'address', name: 'authority', type: 'address' }, + ], + name: 'AccessManagedInvalidAuthority', + type: 'error', + }, + { + inputs: [ + { internalType: 'address', name: 'caller', type: 'address' }, + { internalType: 'uint32', name: 'delay', type: 'uint32' }, + ], + name: 'AccessManagedRequiredDelay', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'caller', type: 'address' }], + name: 'AccessManagedUnauthorized', + type: 'error', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'attestation_uid', type: 'bytes32' }, + ], + name: 'AttestationNotFound', + type: 'error', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'attestation_uid', type: 'bytes32' }, + ], + name: 'AttestationRevoked', + type: 'error', + }, + { + inputs: [{ internalType: 'address', name: 'caller', type: 'address' }], + name: 'UnauthorizedAccess', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'authority', + type: 'address', + }, + ], + name: 'AuthorityUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bytes32', + name: 'key', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'granted', + type: 'bool', + }, + ], + name: 'PermissionUpdated', + type: 'event', + }, + { + inputs: [], + name: 'authority', + outputs: [{ internalType: 'address', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'eas', + outputs: [{ internalType: 'contract IEAS', name: '', type: 'address' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'attestation_uid', type: 'bytes32' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + name: 'grantPermission', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'key', type: 'bytes32' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + name: 'hasPermission', + outputs: [{ internalType: 'bool', name: '', type: 'bool' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'isConsumingScheduledOp', + outputs: [{ internalType: 'bytes4', name: '', type: 'bytes4' }], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { internalType: 'bytes32', name: 'attestation_uid', type: 'bytes32' }, + { internalType: 'address', name: 'account', type: 'address' }, + ], + name: 'revokePermission', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { internalType: 'address', name: 'newAuthority', type: 'address' }, + ], + name: 'setAuthority', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + ], + }, ];