Skip to content

Commit

Permalink
lux addresses integrated
Browse files Browse the repository at this point in the history
  • Loading branch information
foxier25 committed Sep 25, 2024
1 parent f354734 commit 4f98adc
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/NavBar/ChainSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const NETWORK_SELECTOR_CHAINS = [
SupportedChainId.OPTIMISM,
SupportedChainId.ARBITRUM_ONE,
SupportedChainId.CELO,
SupportedChainId.LUX,
]

interface ChainSelectorProps {
Expand Down
1 change: 1 addition & 0 deletions src/components/Tokens/TokenDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export default function TokenDetails({
<Hr />
<AboutSection
address={address}
// @ts-ignore
chainId={pageChainId}
description={tokenQueryData?.project?.description}
homepageUrl={tokenQueryData?.project?.homepageUrl}
Expand Down
3 changes: 3 additions & 0 deletions src/constants/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ export const UNI_ADDRESS: AddressMap = constructSameAddressMap('0x1f9840a85d5aF5
export const UNISWAP_NFT_AIRDROP_CLAIM_ADDRESS = '0x8B799381ac40b838BBA4131ffB26197C432AFe78'

export const V2_FACTORY_ADDRESSES: AddressMap = constructSameAddressMap(V2_FACTORY_ADDRESS)
V2_FACTORY_ADDRESSES[SupportedChainId.LUX] = "0x80bBc7C4C7a59C899D1B37BC14539A22D5830a84";
export const V2_ROUTER_ADDRESS: AddressMap = constructSameAddressMap('0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D')

// celo v3 addresses
const CELO_V3_CORE_FACTORY_ADDRESSES = '0xAfE208a311B21f13EF87E33A90049fC17A7acDEc'
const CELO_ROUTER_ADDRESS = '0x5615CDAb10dc425a742d643d949a7F474C01abc4'
const LUX_ROUTER_ADDRESS = '0x043ccF9C207165DA6D4a44ae47488AF49843bADe';
const CELO_V3_MIGRATOR_ADDRESSES = '0x3cFd4d48EDfDCC53D3f173F596f621064614C582'
const CELO_MULTICALL_ADDRESS = '0x633987602DE5C4F337e3DbF265303A1080324204'
const CELO_QUOTER_ADDRESSES = '0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8'
Expand Down Expand Up @@ -69,6 +71,7 @@ export const SWAP_ROUTER_ADDRESSES: AddressMap = {
SupportedChainId.POLYGON,
SupportedChainId.POLYGON_MUMBAI,
]),
[SupportedChainId.LUX]: LUX_ROUTER_ADDRESS,
[SupportedChainId.CELO]: CELO_ROUTER_ADDRESS,
[SupportedChainId.CELO_ALFAJORES]: CELO_ROUTER_ADDRESS,
}
Expand Down
11 changes: 11 additions & 0 deletions src/constants/chainInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,17 @@ const CHAIN_INFO: ChainInfoMap = {
nativeCurrency: { name: 'Celo', symbol: 'CELO', decimals: 18 },
defaultListUrl: CELO_LIST,
},
[SupportedChainId.LUX]: {
networkType: NetworkType.L1,
blockWaitMsBeforeWarning: ms`10m`,
bridge: 'https://bridge.lux.fi/',
docs: 'https://docs.lux.fi/',
logoUrl: celoLogo,
label: "Lux",
nativeCurrency: { name: 'Lux', symbol: 'LUX', decimals: 18 },
explorer: 'https://explorer.lux.fi/',
infoLink: 'https://info.uniswap.org/#/lux/',
},
}

export function getChainInfo(chainId: SupportedL1ChainId): L1ChainInfo
Expand Down
4 changes: 4 additions & 0 deletions src/constants/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export enum SupportedChainId {

CELO = 42220,
CELO_ALFAJORES = 44787,

LUX = 7777,
}

export const CHAIN_IDS_TO_NAMES = {
Expand All @@ -32,6 +34,7 @@ export const CHAIN_IDS_TO_NAMES = {
[SupportedChainId.CELO]: 'celo',
[SupportedChainId.CELO_ALFAJORES]: 'celo_alfajores',
[SupportedChainId.ARBITRUM_ONE]: 'arbitrum',
[SupportedChainId.LUX]: 'lux',
[SupportedChainId.ARBITRUM_RINKEBY]: 'arbitrum_rinkeby',
[SupportedChainId.OPTIMISM]: 'optimism',
[SupportedChainId.OPTIMISM_GOERLI]: 'optimism_goerli',
Expand Down Expand Up @@ -86,6 +89,7 @@ export const L1_CHAIN_IDS = [
SupportedChainId.RINKEBY,
SupportedChainId.GOERLI,
SupportedChainId.KOVAN,
SupportedChainId.LUX,
SupportedChainId.POLYGON,
SupportedChainId.POLYGON_MUMBAI,
SupportedChainId.CELO,
Expand Down
6 changes: 6 additions & 0 deletions src/constants/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export const FALLBACK_URLS: { [key in SupportedChainId]: string[] } = {
// "Safe" URLs
`https://alfajores-forno.celo-testnet.org`,
],
[SupportedChainId.LUX]: [
`https://api.lux.network/`,
],
}

/**
Expand Down Expand Up @@ -132,6 +135,9 @@ export const RPC_URLS: { [key in SupportedChainId]: string[] } = {
`https://polygon-mumbai.infura.io/v3/${INFURA_KEY}`,
...FALLBACK_URLS[SupportedChainId.POLYGON_MUMBAI],
],
[SupportedChainId.LUX]: [
...FALLBACK_URLS[SupportedChainId.LUX],
],
[SupportedChainId.CELO]: FALLBACK_URLS[SupportedChainId.CELO],
[SupportedChainId.CELO_ALFAJORES]: FALLBACK_URLS[SupportedChainId.CELO_ALFAJORES],
}
1 change: 1 addition & 0 deletions src/constants/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ export const RPC_PROVIDERS: { [key in SupportedChainId]: StaticJsonRpcProvider }
[SupportedChainId.POLYGON_MUMBAI]: new AppJsonRpcProvider(SupportedChainId.POLYGON_MUMBAI),
[SupportedChainId.CELO]: new AppJsonRpcProvider(SupportedChainId.CELO),
[SupportedChainId.CELO_ALFAJORES]: new AppJsonRpcProvider(SupportedChainId.CELO_ALFAJORES),
[SupportedChainId.LUX]: new AppJsonRpcProvider(SupportedChainId.LUX),
}
7 changes: 7 additions & 0 deletions src/constants/routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import {
USDC_POLYGON,
USDT,
USDT_ARBITRUM_ONE,
USDT_LUX,
USDC_LUX,
USDT_OPTIMISM,
USDT_POLYGON,
WBTC,
Expand Down Expand Up @@ -185,6 +187,11 @@ export const COMMON_BASES: ChainCurrencyList = {
CUSD_CELO_ALFAJORES,
CEUR_CELO_ALFAJORES,
],
[SupportedChainId.LUX]: [
nativeOnChain(SupportedChainId.LUX),
USDT_LUX,
USDC_LUX,
],
}

// used to construct the list of all pairs we consider by default in the frontend
Expand Down
22 changes: 22 additions & 0 deletions src/constants/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ const USDC_ROPSTEN = new Token(
'USDC',
'USD//C'
)
export const USDC_LUX = new Token(
SupportedChainId.LUX,
'0x57A22965AdA0e52D785A9Aa155beF423D573b879',
6,
"USDC",
"USD Coin",
);
const USDC_RINKEBY = new Token(
SupportedChainId.RINKEBY,
'0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b',
Expand Down Expand Up @@ -131,6 +138,13 @@ export const USDT_POLYGON = new Token(
'USDT',
'Tether USD'
)
export const USDT_LUX = new Token(
SupportedChainId.LUX,
'0xd25F88CBdAe3c2CCA3Bb75FC4E723b44C0Ea362F',
6,
"USDT",
"Tether USD",
);
export const WBTC_POLYGON = new Token(
SupportedChainId.POLYGON,
'0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6',
Expand Down Expand Up @@ -383,6 +397,13 @@ export const WRAPPED_NATIVE_CURRENCY: { [chainId: number]: Token | undefined } =
'CELO',
'Celo native asset'
),
[SupportedChainId.LUX]: new Token(
SupportedChainId.LUX,
'0x53B1aAA5b6DDFD4eD00D0A7b5Ef333dc74B605b5',
18,
'LUX',
'Lux native asset'
),
}

export function isCelo(chainId: number): chainId is SupportedChainId.CELO | SupportedChainId.CELO_ALFAJORES {
Expand Down Expand Up @@ -465,5 +486,6 @@ export const TOKEN_SHORTHANDS: { [shorthand: string]: { [chainId in SupportedCha
[SupportedChainId.RINKEBY]: USDC_RINKEBY.address,
[SupportedChainId.KOVAN]: USDC_KOVAN.address,
[SupportedChainId.ROPSTEN]: USDC_ROPSTEN.address,
[SupportedChainId.LUX]: USDC_LUX.address,
},
}
4 changes: 2 additions & 2 deletions src/test-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { HashRouter } from 'react-router-dom'
import store from 'state'
import ThemeProvider from 'theme'

import catalog from './locales/en-US'
// import catalog from './locales/en-US'

i18n.load({
[DEFAULT_LOCALE]: catalog.messages,
// [DEFAULT_LOCALE]: catalog.messages,
})
i18n.loadLocaleData({
[DEFAULT_LOCALE]: { plurals: en },
Expand Down
2 changes: 2 additions & 0 deletions src/utils/nativeTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ export function getNativeTokenDBAddress(chain: Chain): string {
case Chain.EthereumGoerli:
case Chain.Optimism:
return 'ETH'
default:
return 'ETH'
}
}

0 comments on commit 4f98adc

Please sign in to comment.