Skip to content

Commit 3f44daf

Browse files
committed
add LUX testnet
1 parent aaaeac6 commit 3f44daf

File tree

10 files changed

+70
-2
lines changed

10 files changed

+70
-2
lines changed

src/components/NetworkAlert/NetworkAlert.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const SHOULD_SHOW_ALERT = {
3838
[SupportedChainId.CELO]: true,
3939
[SupportedChainId.CELO_ALFAJORES]: true,
4040
[SupportedChainId.LUX]: true,
41+
[SupportedChainId.LUX_TESTNET]: true,
4142
}
4243

4344
type NetworkAlertChains = keyof typeof SHOULD_SHOW_ALERT
@@ -56,6 +57,8 @@ const BG_COLORS_BY_DARK_MODE_AND_CHAIN_ID: {
5657
'radial-gradient(182.71% 150.59% at 2.81% 7.69%, rgba(90, 190, 170, 0.15) 0%, rgba(80, 160, 40, 0.15) 100%)',
5758
[SupportedChainId.LUX]:
5859
'radial-gradient(182.71% 150.59% at 2.81% 7.69%, rgba(90, 190, 170, 0.15) 0%, rgba(80, 160, 40, 0.15) 100%)',
60+
[SupportedChainId.LUX_TESTNET]:
61+
'radial-gradient(182.71% 150.59% at 2.81% 7.69%, rgba(90, 190, 170, 0.15) 0%, rgba(80, 160, 40, 0.15) 100%)',
5962
[SupportedChainId.OPTIMISM]:
6063
'radial-gradient(948% 292% at 42% 0%, rgba(255, 58, 212, 0.01) 0%, rgba(255, 255, 255, 0.04) 100%),radial-gradient(98% 96% at 2% 0%, rgba(255, 39, 39, 0.01) 0%, rgba(235, 0, 255, 0.01) 96%)',
6164
[SupportedChainId.OPTIMISM_GOERLI]:
@@ -74,6 +77,8 @@ const BG_COLORS_BY_DARK_MODE_AND_CHAIN_ID: {
7477
'radial-gradient(182.71% 150.59% at 2.81% 7.69%, rgba(63, 208, 137, 0.15) 0%, rgba(49, 205, 50, 0.15) 100%)',
7578
[SupportedChainId.LUX]:
7679
'radial-gradient(182.71% 150.59% at 2.81% 7.69%, rgba(63, 208, 137, 0.15) 0%, rgba(49, 205, 50, 0.15) 100%)',
80+
[SupportedChainId.LUX_TESTNET]:
81+
'radial-gradient(182.71% 150.59% at 2.81% 7.69%, rgba(63, 208, 137, 0.15) 0%, rgba(49, 205, 50, 0.15) 100%)',
7782
[SupportedChainId.CELO_ALFAJORES]:
7883
'radial-gradient(182.71% 150.59% at 2.81% 7.69%, rgba(63, 208, 137, 0.15) 0%, rgba(49, 205, 50, 0.15) 100%)',
7984
[SupportedChainId.OPTIMISM]:
@@ -139,6 +144,7 @@ const TEXT_COLORS: { [chainId in NetworkAlertChains]: string } = {
139144
[SupportedChainId.POLYGON_MUMBAI]: 'rgba(130, 71, 229)',
140145
[SupportedChainId.CELO]: 'rgba(53, 178, 97)',
141146
[SupportedChainId.LUX]: 'rgba(53, 178, 97)',
147+
[SupportedChainId.LUX_TESTNET]: 'rgba(53, 178, 97)',
142148
[SupportedChainId.CELO_ALFAJORES]: 'rgba(53, 178, 97)',
143149
[SupportedChainId.OPTIMISM]: '#ff3856',
144150
[SupportedChainId.OPTIMISM_GOERLI]: '#ff3856',

src/constants/addresses.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export const V2_ROUTER_ADDRESS: AddressMap = constructSameAddressMap('0x7a250d56
1818
const CELO_V3_CORE_FACTORY_ADDRESSES = '0xAfE208a311B21f13EF87E33A90049fC17A7acDEc'
1919
const CELO_ROUTER_ADDRESS = '0x5615CDAb10dc425a742d643d949a7F474C01abc4'
2020
const LUX_V3_FACTORY_ADDRESS = "0x0650683db720c793ff7e609A08b5fc2792c91f39";
21+
const LUX_TESTNET_V3_FACTORY_ADDRESS = "0x036A0AE1D760D7582254059BeBD9e5A34062dE23";
2122
const LUX_ROUTER_ADDRESS = '0x56bd288aeA22072b5b99Bf3b59C7787B8d5aE7ff';
23+
const LUX_TESTNET_ROUTER_ADDRESS = '0xc01A999dE87953AAA8025FF6B43FEBE643a12a19';
2224
const CELO_V3_MIGRATOR_ADDRESSES = '0x3cFd4d48EDfDCC53D3f173F596f621064614C582'
2325
const CELO_MULTICALL_ADDRESS = '0x633987602DE5C4F337e3DbF265303A1080324204'
2426
const CELO_QUOTER_ADDRESSES = '0x82825d0554fA07f7FC52Ab63c961F330fdEFa8E8'
@@ -38,6 +40,7 @@ export const V3_CORE_FACTORY_ADDRESSES: AddressMap = {
3840
[SupportedChainId.CELO]: CELO_V3_CORE_FACTORY_ADDRESSES,
3941
[SupportedChainId.CELO_ALFAJORES]: CELO_V3_CORE_FACTORY_ADDRESSES,
4042
[SupportedChainId.LUX]: LUX_V3_FACTORY_ADDRESS,
43+
[SupportedChainId.LUX_TESTNET]: LUX_TESTNET_V3_FACTORY_ADDRESS,
4144
}
4245

4346
export const V3_MIGRATOR_ADDRESSES: AddressMap = {
@@ -62,7 +65,8 @@ export const MULTICALL_ADDRESS: AddressMap = {
6265
[SupportedChainId.ARBITRUM_RINKEBY]: '0xa501c031958F579dB7676fF1CE78AD305794d579',
6366
[SupportedChainId.CELO]: CELO_MULTICALL_ADDRESS,
6467
[SupportedChainId.CELO_ALFAJORES]: CELO_MULTICALL_ADDRESS,
65-
[SupportedChainId.LUX]: "0x9fb423Df995c5b69f538eA86BC81a60254F2ecA3",
68+
[SupportedChainId.LUX]: "0x16aF51D83bF3E05eeB777FCbc14f2f1eE05FaeE7",
69+
[SupportedChainId.LUX_TESTNET]: "0xFa110e1CCF5fc7286D294C5817016b6A89373074",
6670
}
6771

6872
export const SWAP_ROUTER_ADDRESSES: AddressMap = {
@@ -75,6 +79,7 @@ export const SWAP_ROUTER_ADDRESSES: AddressMap = {
7579
SupportedChainId.POLYGON_MUMBAI,
7680
]),
7781
[SupportedChainId.LUX]: LUX_ROUTER_ADDRESS,
82+
[SupportedChainId.LUX_TESTNET]: LUX_TESTNET_ROUTER_ADDRESS,
7883
[SupportedChainId.CELO]: CELO_ROUTER_ADDRESS,
7984
[SupportedChainId.CELO_ALFAJORES]: CELO_ROUTER_ADDRESS,
8085
}
@@ -120,6 +125,7 @@ export const QUOTER_ADDRESSES: AddressMap = {
120125
[SupportedChainId.CELO]: CELO_QUOTER_ADDRESSES,
121126
[SupportedChainId.CELO_ALFAJORES]: CELO_QUOTER_ADDRESSES,
122127
[SupportedChainId.LUX]: "0x036A0AE1D760D7582254059BeBD9e5A34062dE23",
128+
[SupportedChainId.LUX_TESTNET]: "0x90c6f8E0F23905506B34A35c8E284E3B4751141E",
123129
}
124130

125131
export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: AddressMap = {
@@ -134,6 +140,7 @@ export const NONFUNGIBLE_POSITION_MANAGER_ADDRESSES: AddressMap = {
134140
[SupportedChainId.CELO]: CELO_NONFUNGIBLE_POSITION_MANAGER_ADDRESSES,
135141
[SupportedChainId.CELO_ALFAJORES]: CELO_NONFUNGIBLE_POSITION_MANAGER_ADDRESSES,
136142
[SupportedChainId.LUX]: "0xD736808D0cbcC3237b5d8caE10B30FcDcaFf0fEF",
143+
[SupportedChainId.LUX_TESTNET]: "0x99D5296C6dfADF96f4C51D2c7f93bBEEEe331ec1",
137144
}
138145

139146
export const ENS_REGISTRAR_ADDRESSES: AddressMap = {
@@ -153,4 +160,5 @@ export const TICK_LENS_ADDRESSES: AddressMap = {
153160
[SupportedChainId.CELO]: CELO_TICK_LENS_ADDRESSES,
154161
[SupportedChainId.CELO_ALFAJORES]: CELO_TICK_LENS_ADDRESSES,
155162
[SupportedChainId.LUX]: "0xc3a0F0213CAA01635667B280ffFee18B9c702d6D",
163+
[SupportedChainId.LUX_TESTNET]: "0xD089eaaf82ec9e58b94785b3f7762E67F89bDFB4",
156164
}

src/constants/chainInfo.ts

+11
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,17 @@ const CHAIN_INFO: ChainInfoMap = {
229229
label: "Lux",
230230
nativeCurrency: { name: 'Lux', symbol: 'LUX', decimals: 18 },
231231
},
232+
[SupportedChainId.LUX_TESTNET]: {
233+
networkType: NetworkType.L1,
234+
blockWaitMsBeforeWarning: ms`10m`,
235+
bridge: 'https://bridge.lux.network/',
236+
docs: 'https://docs.lux.fi/',
237+
explorer: 'https://explore.lux-test.network/',
238+
infoLink: 'https://info.uniswap.org/#/lux/',
239+
logoUrl: luxLogoUrl,
240+
label: "Lux Testnet",
241+
nativeCurrency: { name: 'Lux', symbol: 'LUX', decimals: 18 },
242+
},
232243
}
233244

234245
export function getChainInfo(chainId: SupportedL1ChainId): L1ChainInfo

src/constants/chains.ts

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
export enum SupportedChainId {
55
LUX = 7777,
6+
LUX_TESTNET = 8888,
67

78
MAINNET = 1,
89
ROPSTEN = 3,
@@ -35,6 +36,7 @@ export const CHAIN_IDS_TO_NAMES = {
3536
[SupportedChainId.CELO_ALFAJORES]: 'celo_alfajores',
3637
[SupportedChainId.ARBITRUM_ONE]: 'arbitrum',
3738
[SupportedChainId.LUX]: 'lux',
39+
[SupportedChainId.LUX_TESTNET]: 'lux_testnet',
3840
[SupportedChainId.ARBITRUM_RINKEBY]: 'arbitrum_rinkeby',
3941
[SupportedChainId.OPTIMISM]: 'optimism',
4042
[SupportedChainId.OPTIMISM_GOERLI]: 'optimism_goerli',
@@ -90,6 +92,7 @@ export const L1_CHAIN_IDS = [
9092
SupportedChainId.GOERLI,
9193
SupportedChainId.KOVAN,
9294
SupportedChainId.LUX,
95+
SupportedChainId.LUX_TESTNET,
9396
SupportedChainId.POLYGON,
9497
SupportedChainId.POLYGON_MUMBAI,
9598
SupportedChainId.CELO,

src/constants/networks.ts

+6
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ export const FALLBACK_URLS: { [key in SupportedChainId]: string[] } = {
9090
[SupportedChainId.LUX]: [
9191
`https://api.lux.network/`,
9292
],
93+
[SupportedChainId.LUX_TESTNET]: [
94+
`https://api.lux-test.network/`,
95+
],
9396
}
9497

9598
/**
@@ -138,6 +141,9 @@ export const RPC_URLS: { [key in SupportedChainId]: string[] } = {
138141
[SupportedChainId.LUX]: [
139142
...FALLBACK_URLS[SupportedChainId.LUX],
140143
],
144+
[SupportedChainId.LUX_TESTNET]: [
145+
...FALLBACK_URLS[SupportedChainId.LUX_TESTNET],
146+
],
141147
[SupportedChainId.CELO]: FALLBACK_URLS[SupportedChainId.CELO],
142148
[SupportedChainId.CELO_ALFAJORES]: FALLBACK_URLS[SupportedChainId.CELO_ALFAJORES],
143149
}

src/constants/providers.ts

+1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,5 @@ export const RPC_PROVIDERS: { [key in SupportedChainId]: StaticJsonRpcProvider }
7171
[SupportedChainId.CELO]: new AppJsonRpcProvider(SupportedChainId.CELO),
7272
[SupportedChainId.CELO_ALFAJORES]: new AppJsonRpcProvider(SupportedChainId.CELO_ALFAJORES),
7373
[SupportedChainId.LUX]: new AppJsonRpcProvider(SupportedChainId.LUX),
74+
[SupportedChainId.LUX_TESTNET]: new AppJsonRpcProvider(SupportedChainId.LUX_TESTNET),
7475
}

src/constants/routing.ts

+7
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import {
3333
USDT_ARBITRUM_ONE,
3434
USDT_LUX,
3535
USDC_LUX,
36+
USDT_LUX_TESTNET,
37+
USDC_LUX_TESTNET,
3638
USDT_OPTIMISM,
3739
USDT_POLYGON,
3840
WBTC,
@@ -192,6 +194,11 @@ export const COMMON_BASES: ChainCurrencyList = {
192194
USDT_LUX,
193195
USDC_LUX,
194196
],
197+
[SupportedChainId.LUX_TESTNET]: [
198+
nativeOnChain(SupportedChainId.LUX_TESTNET),
199+
USDT_LUX_TESTNET,
200+
USDC_LUX_TESTNET,
201+
],
195202
}
196203

197204
// used to construct the list of all pairs we consider by default in the frontend

src/constants/tokens.ts

+25-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ export const USDC_LUX = new Token(
3232
"USDC",
3333
"USD Coin",
3434
);
35+
36+
export const USDC_LUX_TESTNET = new Token(
37+
SupportedChainId.LUX_TESTNET,
38+
'0x827d7D81205a59b2864252bdB4D4313028c50e10',
39+
18,
40+
"USDC",
41+
"USD Coin",
42+
);
43+
3544
const USDC_RINKEBY = new Token(
3645
SupportedChainId.RINKEBY,
3746
'0x4DBCdF9B62e891a7cec5A2568C3F4FAF9E8Abe2b',
@@ -145,6 +154,13 @@ export const USDT_LUX = new Token(
145154
"USDT",
146155
"LUX USDT",
147156
);
157+
export const USDT_LUX_TESTNET = new Token(
158+
SupportedChainId.LUX_TESTNET,
159+
'0x3fdd8BB8112d8008be2397d0FAfDa869EFCdDbC4',
160+
18,
161+
"USDT",
162+
"LUX USDT",
163+
);
148164
export const WBTC_POLYGON = new Token(
149165
SupportedChainId.POLYGON,
150166
'0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6',
@@ -405,14 +421,21 @@ export const WRAPPED_NATIVE_CURRENCY: { [chainId: number]: Token | undefined } =
405421
'WLUX',
406422
'Wrapped LUX'
407423
),
424+
[SupportedChainId.LUX_TESTNET]: new Token(
425+
SupportedChainId.LUX_TESTNET,
426+
'0x0650683db720c793ff7e609A08b5fc2792c91f39',
427+
18,
428+
'WLUX',
429+
'Wrapped LUX'
430+
),
408431
}
409432

410433
export function isCelo(chainId: number): chainId is SupportedChainId.CELO | SupportedChainId.CELO_ALFAJORES {
411434
return chainId === SupportedChainId.CELO_ALFAJORES || chainId === SupportedChainId.CELO
412435
}
413436

414437
export function isLUX(chainId: number): chainId is SupportedChainId.LUX {
415-
return chainId === SupportedChainId.LUX
438+
return chainId === SupportedChainId.LUX || chainId === SupportedChainId.LUX_TESTNET
416439
}
417440

418441
function getCeloNativeCurrency(chainId: number) {
@@ -512,5 +535,6 @@ export const TOKEN_SHORTHANDS: { [shorthand: string]: { [chainId in SupportedCha
512535
[SupportedChainId.KOVAN]: USDC_KOVAN.address,
513536
[SupportedChainId.ROPSTEN]: USDC_ROPSTEN.address,
514537
[SupportedChainId.LUX]: USDC_LUX.address,
538+
[SupportedChainId.LUX_TESTNET]: USDC_LUX_TESTNET.address,
515539
},
516540
}

src/lib/hooks/useCurrencyLogoURIs.ts

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export function getNativeLogoURI(chainId: SupportedChainId = SupportedChainId.MA
5757
case SupportedChainId.CELO_ALFAJORES:
5858
return CeloLogo
5959
case SupportedChainId.LUX:
60+
case SupportedChainId.LUX_TESTNET:
6061
return LuxLogo
6162
default:
6263
return EthereumLogo

src/utils/getExplorerLink.ts

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const BLOCK_EXPLORER_PREFIXES: { [chainId: number]: string } = {
1313
[SupportedChainId.CELO]: 'https://celoscan.io',
1414
[SupportedChainId.CELO_ALFAJORES]: 'https://alfajores-blockscout.celo-testnet.org',
1515
[SupportedChainId.LUX]: 'https://explore.lux.network/',
16+
[SupportedChainId.LUX_TESTNET]: 'https://explore.lux-test.network/',
1617
}
1718

1819
export enum ExplorerDataType {

0 commit comments

Comments
 (0)