From e4fdc6269ce53a62672bafec52c7484341696157 Mon Sep 17 00:00:00 2001 From: Jan-Felix Date: Wed, 9 Oct 2024 13:58:42 +0200 Subject: [PATCH 1/2] add support for zkevm --- packages/app/src/utils/networks.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/app/src/utils/networks.ts b/packages/app/src/utils/networks.ts index 4440caa..355d180 100644 --- a/packages/app/src/utils/networks.ts +++ b/packages/app/src/utils/networks.ts @@ -4,6 +4,7 @@ export enum NETWORK { BSC = 56, GNOSIS_CHAIN = 100, POLYGON = 137, + ZKEVM = 1101, ARBITRUM = 42161, AVALANCHE = 43114, SEPOLIA = 11155111, @@ -61,6 +62,12 @@ export const NETWORKS: Record = { shortName: 'matic', nativeAsset: NATIVE_ASSET.MATIC, }, + [NETWORK.ZKEVM]: { + chainId: NETWORK.ZKEVM, + name: 'zkevm', + shortName: 'zkevm', + nativeAsset: NATIVE_ASSET.ETH, + }, [NETWORK.ARBITRUM]: { chainId: NETWORK.ARBITRUM, name: 'arbitrum', @@ -92,6 +99,7 @@ export const NETWORK_NATIVE_ASSET: Record = { [NETWORK.OPTIMISM]: NATIVE_ASSET.ETH, [NETWORK.GNOSIS_CHAIN]: NATIVE_ASSET.XDAI, [NETWORK.POLYGON]: NATIVE_ASSET.MATIC, + [NETWORK.ZKEVM]: NATIVE_ASSET.ETH, [NETWORK.BSC]: NATIVE_ASSET.BNB, [NETWORK.ARBITRUM]: NATIVE_ASSET.ETH, [NETWORK.AVALANCHE]: NATIVE_ASSET.AVAX, From 4453c1cb10344b74841a68998cee6ee2a32c7090 Mon Sep 17 00:00:00 2001 From: Jan-Felix Date: Wed, 9 Oct 2024 13:59:00 +0200 Subject: [PATCH 2/2] MATIC -> POL --- packages/app/src/utils/networks.ts | 6 +++--- .../KlerosRealityModuleModal.tsx | 20 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/app/src/utils/networks.ts b/packages/app/src/utils/networks.ts index 355d180..b8b2e7c 100644 --- a/packages/app/src/utils/networks.ts +++ b/packages/app/src/utils/networks.ts @@ -26,7 +26,7 @@ interface Network { export const NATIVE_ASSET: Record = { ETH: { symbol: 'ETH', decimals: 18 }, XDAI: { symbol: 'xDai', decimals: 18 }, - MATIC: { symbol: 'MATIC', decimals: 18 }, + POL: { symbol: 'POL', decimals: 18 }, BNB: { symbol: 'BNB', decimals: 18 }, AVAX: { symbol: 'AVAX', decimals: 18 }, } @@ -60,7 +60,7 @@ export const NETWORKS: Record = { chainId: NETWORK.POLYGON, name: 'polygon', shortName: 'matic', - nativeAsset: NATIVE_ASSET.MATIC, + nativeAsset: NATIVE_ASSET.POL, }, [NETWORK.ZKEVM]: { chainId: NETWORK.ZKEVM, @@ -98,7 +98,7 @@ export const NETWORK_NATIVE_ASSET: Record = { [NETWORK.MAINNET]: NATIVE_ASSET.ETH, [NETWORK.OPTIMISM]: NATIVE_ASSET.ETH, [NETWORK.GNOSIS_CHAIN]: NATIVE_ASSET.XDAI, - [NETWORK.POLYGON]: NATIVE_ASSET.MATIC, + [NETWORK.POLYGON]: NATIVE_ASSET.POL, [NETWORK.ZKEVM]: NATIVE_ASSET.ETH, [NETWORK.BSC]: NATIVE_ASSET.BNB, [NETWORK.ARBITRUM]: NATIVE_ASSET.ETH, diff --git a/packages/app/src/views/AddModule/wizards/KlerosRealityModule/KlerosRealityModuleModal.tsx b/packages/app/src/views/AddModule/wizards/KlerosRealityModule/KlerosRealityModuleModal.tsx index 6975c86..bb2a8b8 100644 --- a/packages/app/src/views/AddModule/wizards/KlerosRealityModule/KlerosRealityModuleModal.tsx +++ b/packages/app/src/views/AddModule/wizards/KlerosRealityModule/KlerosRealityModuleModal.tsx @@ -173,7 +173,7 @@ const CustomSwitch = withStyles({ }, colorSecondary: { '&.Mui-checked + .MuiSwitch-track': { - backgroundColor: colors.tan[500], + backgroundColor: colors.tan[500], }, }, track: { @@ -370,17 +370,17 @@ export const KlerosRealityModuleModal = ({ open, onClose, onSubmit }: RealityMod }, [apiKey, apiSecret]) // add appropriate default amounts, chain dependant. - // 1 ETH, 1500 xDAI, 1000 MATIC. Defaults to 1 unit otherwise. + // 1 ETH, 1500 xDAI, 1000 POL. Defaults to 1 unit otherwise. useEffect(() => { if (safe.chainId) { const defaultAmount = safe.chainId === 1 ? '1' : safe.chainId === 100 - ? '1500' - : safe.chainId === 137 - ? '1000' - : '1' + ? '1500' + : safe.chainId === 137 + ? '1000' + : '1' setParams((prevParams) => { return { ...prevParams, bond: defaultAmount } }) @@ -843,10 +843,10 @@ export const KlerosRealityModuleModal = ({ open, onClose, onSubmit }: RealityMod {canConfirm || !openMonitoring ? 'Add Module' : loadingCredentials - ? 'Validating OpenZeppelin Credentials...' - : !validatedCredentials || invalidCredentials - ? 'Missing OpenZeppelin API' - : 'Missing Email'} + ? 'Validating OpenZeppelin Credentials...' + : !validatedCredentials || invalidCredentials + ? 'Missing OpenZeppelin API' + : 'Missing Email'} ) : (