Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add support for zkevm #243

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions packages/app/src/utils/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export enum NETWORK {
BSC = 56,
GNOSIS_CHAIN = 100,
POLYGON = 137,
ZKEVM = 1101,
ARBITRUM = 42161,
AVALANCHE = 43114,
SEPOLIA = 11155111,
Expand All @@ -25,7 +26,7 @@ interface Network {
export const NATIVE_ASSET: Record<string, Coin> = {
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 },
}
Expand Down Expand Up @@ -59,7 +60,13 @@ export const NETWORKS: Record<NETWORK, Network> = {
chainId: NETWORK.POLYGON,
name: 'polygon',
shortName: 'matic',
nativeAsset: NATIVE_ASSET.MATIC,
nativeAsset: NATIVE_ASSET.POL,
},
[NETWORK.ZKEVM]: {
chainId: NETWORK.ZKEVM,
name: 'zkevm',
shortName: 'zkevm',
nativeAsset: NATIVE_ASSET.ETH,
},
[NETWORK.ARBITRUM]: {
chainId: NETWORK.ARBITRUM,
Expand Down Expand Up @@ -91,7 +98,8 @@ export const NETWORK_NATIVE_ASSET: Record<NETWORK, Coin> = {
[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,
[NETWORK.AVALANCHE]: NATIVE_ASSET.AVAX,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const CustomSwitch = withStyles({
},
colorSecondary: {
'&.Mui-checked + .MuiSwitch-track': {
backgroundColor: colors.tan[500],
backgroundColor: colors.tan[500],
},
},
track: {
Expand Down Expand Up @@ -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 }
})
Expand Down Expand Up @@ -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'}
</ActionButton>
</>
) : (
Expand Down