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

Added base testnet, turned on permissionless pools for aurora #1344

Open
wants to merge 6 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
19 changes: 13 additions & 6 deletions src/connectors/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { BaseProvider, getDefaultProvider } from "@ethersproject/providers"
import { SUPPORTED_NETWORKS, SupportedNetwork } from "../constants/networks"
import {
DEV_SUPPORTED_NETWORKS,
SUPPORTED_NETWORKS,
SupportedNetwork,
} from "../constants/networks"

import { IS_DEVELOPMENT } from "../utils/environment"
import { InjectedConnector } from "@web3-react/injected-connector"
import { NetworkConnector } from "@web3-react/network-connector"
import { UAuthConnector } from "@uauth/web3-react"
Expand All @@ -11,7 +16,9 @@ const NETWORK_URL = process.env.REACT_APP_NETWORK_URL
export const NETWORK_CHAIN_ID: number = parseInt(
process.env.REACT_APP_CHAIN_ID ?? "1",
)

const ENV_SUPPORTED_NETWORKS = IS_DEVELOPMENT
? DEV_SUPPORTED_NETWORKS
: SUPPORTED_NETWORKS
if (typeof NETWORK_URL === "undefined") {
throw new Error(
`REACT_APP_NETWORK_URL must be a defined environment variable`,
Expand All @@ -32,7 +39,7 @@ function createInjectedMetaMaskProvider() {
return new InjectedConnector({
// mainnet, ropsten, rinkeby, goerli, optimism, kovan, kava testnet, kava, evmos testnet, evmos, fantom, local buidler
// see: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md
supportedChainIds: Object.keys(SUPPORTED_NETWORKS).map(Number), // Must be numbers
supportedChainIds: Object.keys(ENV_SUPPORTED_NETWORKS).map(Number), // Must be numbers
})
}

Expand All @@ -48,16 +55,16 @@ export const injectedMetaMaskProvider = createInjectedMetaMaskProvider()
export const injectedTallyProvider = createInjectedTallyProvider()

export const walletconnect = new WalletConnectConnector({
rpc: Object.keys(SUPPORTED_NETWORKS).reduce(
rpc: Object.keys(ENV_SUPPORTED_NETWORKS).reduce(
(acc, id) => ({
...acc,
[id]: (SUPPORTED_NETWORKS[id] as SupportedNetwork).rpcUrls[0],
[id]: (ENV_SUPPORTED_NETWORKS[id] as SupportedNetwork).rpcUrls[0],
}),
{},
),
bridge: "https://bridge.walletconnect.org",
qrcode: true,
supportedChainIds: Object.keys(SUPPORTED_NETWORKS).map(Number),
supportedChainIds: Object.keys(ENV_SUPPORTED_NETWORKS).map(Number),
// chainId: NETWORK_CHAIN_ID,
// pollingInterval: POLLING_INTERVAL / 12000
})
Expand Down
1 change: 1 addition & 0 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ export const MASTER_REGISTRY_CONTRACT_ADDRESSES = buildAddresses({
[ChainId.ARBITRUM]: "0xaB94A2c0D8F044AA439A5654f06b5797928396cF",
[ChainId.KAVA]: "0x3A0c2A793a8DB779e0293699D0Ce77c77617FE0f",
[ChainId.AURORA]: "0x29FD31d37AB8D27f11EAB68F96424bf64231fFce",
[ChainId.BASE_TESTNET]: "0x29FD31d37AB8D27f11EAB68F96424bf64231fFce",
})

export const SDL_WETH_SUSHI_LP_CONTRACT_ADDRESSES = buildAddresses({
Expand Down
11 changes: 11 additions & 0 deletions src/constants/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export enum ChainId {
KAVA_TESTNET = 2221,
KAVA = 2222,
AURORA = 1313161554,
BASE_TESTNET = 84531,
}

export const NETWORK_LABEL: Partial<Record<ChainId, string>> = {
Expand All @@ -30,6 +31,7 @@ export const NETWORK_LABEL: Partial<Record<ChainId, string>> = {
[ChainId.KAVA]: "Kava",
[ChainId.HARDHAT]: "Hardhat 👷🏼‍♂️",
[ChainId.AURORA]: "Aurora",
[ChainId.BASE_TESTNET]: "Base Testnet",
}

// TODO: figure out better way of representing non-erc20 native tokens
Expand All @@ -46,6 +48,7 @@ export const NETWORK_NATIVE_TOKENS: Record<ChainId, string> = {
[ChainId.HARDHAT]: "ETH",
[ChainId.TEST_SIDE_CHAIN]: "ETH",
[ChainId.AURORA]: "ETH",
[ChainId.BASE_TESTNET]: "ETH",
}
export const COINGECKO_PLATFORM_ID: Record<ChainId, string | null> = {
[ChainId.MAINNET]: "ethereum",
Expand All @@ -60,6 +63,7 @@ export const COINGECKO_PLATFORM_ID: Record<ChainId, string | null> = {
[ChainId.HARDHAT]: null,
[ChainId.TEST_SIDE_CHAIN]: null,
[ChainId.AURORA]: "aurora",
[ChainId.BASE_TESTNET]: null,
}

export type SupportedNetwork = {
Expand Down Expand Up @@ -170,4 +174,11 @@ export const DEV_SUPPORTED_NETWORKS: SupportedNetworks = {
rpcUrls: ["https://evm.testnet.kava.io"],
blockExplorerUrls: ["https://explorer.evm-alpha.kava.io"],
},
[ChainId.BASE_TESTNET]: {
chainId: "0x14a33", // 84531
chainName: "Base Testnet",
nativeCurrency: nativeCurrencyEth,
rpcUrls: ["https://goerli.base.org/"],
blockExplorerUrls: ["https://goerli.basescan.org"],
},
}
1 change: 1 addition & 0 deletions src/pages/Pages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const communityPoolsEnabled = (chainId: ChainId | undefined) => {
ChainId.KAVA,
ChainId.OPTIMISM,
ChainId.FANTOM,
ChainId.AURORA,
].includes(chainId)
)
}
Expand Down
3 changes: 3 additions & 0 deletions src/utils/getEtherscanLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export function getMultichainScanLink(
case ChainId.AURORA:
chainScanDomain = "explorer.mainnet.aurora.dev"
break
case ChainId.BASE_TESTNET:
chainScanDomain = "goerli.basescan.org"
break
default:
chainScanDomain = "etherscan.io"
}
Expand Down