diff --git a/package-lock.json b/package-lock.json index c5403cef..b18bbb95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3712,9 +3712,9 @@ } }, "node_modules/@swapr/core": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@swapr/core/-/core-0.3.18.tgz", - "integrity": "sha512-AsSyXCIx3OhR399lgQD/bmAgAA2Xa2k2XabH/kG1TeuHfmT2ob+8l5ROit7puO/lD9aFsXO4mxO34oVcoaoXgA==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@swapr/core/-/core-0.3.19.tgz", + "integrity": "sha512-Ci9x0BhqS9Ng0pdB+30Ghwz//RQGXQVP+M7+fNKZFUgG2uTNQ4UF0y0+0iCAT3WqSgWjr7KnrnOkA3Igv4l8cw==", "dependencies": { "typescript": "^3.9.5" }, @@ -3735,9 +3735,9 @@ } }, "node_modules/@swapr/periphery": { - "version": "0.3.20", - "resolved": "https://registry.npmjs.org/@swapr/periphery/-/periphery-0.3.20.tgz", - "integrity": "sha512-h2nH1ZDbk6IGLj6HmZLrg6vcfrWj2uHQXXYsyEXojOwjQ2EXDLw+YrmHhhCHI+qVaQ4rrQ2OclwZWe4oyuMyWg==", + "version": "0.3.21", + "resolved": "https://registry.npmjs.org/@swapr/periphery/-/periphery-0.3.21.tgz", + "integrity": "sha512-gfZvH5guU8Ggx7NhZ3ysG4S6Sfl8doIsmJuUqy0+St7VLbUvjj2hylkMwbZs2kJ7KSEf5VYNtpMn3tdXKQizZw==", "dependencies": { "@swapr/core": "^0.3.17" }, @@ -18407,9 +18407,9 @@ } }, "@swapr/core": { - "version": "0.3.18", - "resolved": "https://registry.npmjs.org/@swapr/core/-/core-0.3.18.tgz", - "integrity": "sha512-AsSyXCIx3OhR399lgQD/bmAgAA2Xa2k2XabH/kG1TeuHfmT2ob+8l5ROit7puO/lD9aFsXO4mxO34oVcoaoXgA==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@swapr/core/-/core-0.3.19.tgz", + "integrity": "sha512-Ci9x0BhqS9Ng0pdB+30Ghwz//RQGXQVP+M7+fNKZFUgG2uTNQ4UF0y0+0iCAT3WqSgWjr7KnrnOkA3Igv4l8cw==", "requires": { "typescript": "^3.9.5" }, @@ -18422,9 +18422,9 @@ } }, "@swapr/periphery": { - "version": "0.3.20", - "resolved": "https://registry.npmjs.org/@swapr/periphery/-/periphery-0.3.20.tgz", - "integrity": "sha512-h2nH1ZDbk6IGLj6HmZLrg6vcfrWj2uHQXXYsyEXojOwjQ2EXDLw+YrmHhhCHI+qVaQ4rrQ2OclwZWe4oyuMyWg==", + "version": "0.3.21", + "resolved": "https://registry.npmjs.org/@swapr/periphery/-/periphery-0.3.21.tgz", + "integrity": "sha512-gfZvH5guU8Ggx7NhZ3ysG4S6Sfl8doIsmJuUqy0+St7VLbUvjj2hylkMwbZs2kJ7KSEf5VYNtpMn3tdXKQizZw==", "requires": { "@swapr/core": "^0.3.17" } diff --git a/package.json b/package.json index df9d22c7..6f37cb36 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ "@ethersproject/solidity": "^5.4.0", "@ethersproject/transactions": "^5.4.0", "@ethersproject/units": "^5.4.0", - "@swapr/core": "^0.3.18", - "@swapr/periphery": "^0.3.20", + "@swapr/core": "^0.3.19", + "@swapr/periphery": "^0.3.21", "@uniswap/smart-order-router": "^2.6.0", "big.js": "^5.2.2", "dayjs": "^1.11.0", diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index bd256e15..5c0bc48d 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -1,5 +1,6 @@ import { AddressZero } from '@ethersproject/constants' import { + arbitrumGoerliTestnet as coreArbitrumGoerliTestnet, arbitrumOne as coreArbitrumOne, arbitrumRinkebyTestnet as coreArbitrumRinkebyTestnet, mainnet as coreMainnet, @@ -7,6 +8,7 @@ import { xdai as coreXDai, } from '@swapr/core/.contracts.json' import { + arbitrumGoerliTestnet as peripheryArbitrumGoerliTestnet, arbitrumOne as peripheryArbitrumOne, arbitrumRinkebyTestnet as peripheryArbitrumRinkebyTestnet, mainnet as peripheryMainnet, @@ -16,11 +18,12 @@ import { import { ChainId } from './chains' -const emptyAddressList = { +const emptyAddressList: Record = { [ChainId.MAINNET]: AddressZero, [ChainId.RINKEBY]: AddressZero, [ChainId.ARBITRUM_ONE]: AddressZero, [ChainId.ARBITRUM_RINKEBY]: AddressZero, + [ChainId.ARBITRUM_GOERLI]: AddressZero, [ChainId.XDAI]: AddressZero, [ChainId.POLYGON]: AddressZero, [ChainId.GOERLI]: AddressZero, @@ -37,6 +40,7 @@ export const FACTORY_ADDRESS: Record = { [ChainId.RINKEBY]: coreRinkeby.factory, [ChainId.ARBITRUM_ONE]: coreArbitrumOne.factory, [ChainId.ARBITRUM_RINKEBY]: coreArbitrumRinkebyTestnet.factory, + [ChainId.ARBITRUM_GOERLI]: coreArbitrumGoerliTestnet.factory, [ChainId.XDAI]: coreXDai.factory, } @@ -50,6 +54,7 @@ export const ROUTER_ADDRESS: Record = { [ChainId.XDAI]: peripheryXDai.router, [ChainId.ARBITRUM_ONE]: peripheryArbitrumOne.router, [ChainId.ARBITRUM_RINKEBY]: peripheryArbitrumRinkebyTestnet.router, + [ChainId.ARBITRUM_GOERLI]: peripheryArbitrumGoerliTestnet.router, } /** @@ -62,6 +67,7 @@ export const STAKING_REWARDS_FACTORY_ADDRESS: Record = { [ChainId.XDAI]: '0xa039793Af0bb060c597362E8155a0327d9b8BEE8', [ChainId.ARBITRUM_ONE]: '0xecA7F78d59D16812948849663b26FE10E320f80C', [ChainId.ARBITRUM_RINKEBY]: '0x41e657cAdE74f45b7E2F0F4a5AeE0239f2fB4E1F', + [ChainId.ARBITRUM_GOERLI]: '0x95Bf186929194099899139Ff79998cC147290F28', } /** @@ -91,6 +97,7 @@ export const MULTICALL2_ADDRESS: Record = { [ChainId.ARBITRUM_ONE]: '0x80c7dd17b01855a6d2347444a0fcc36136a314de', [ChainId.XDAI]: '0xFAa296891cA6CECAF2D86eF5F7590316d0A17dA0', [ChainId.ARBITRUM_RINKEBY]: '0x309e61A4c36a4a9f131f8844eA521F6384B6C9E3', + [ChainId.ARBITRUM_GOERLI]: '0xBbB06b25484AB9E23FEe8Ee321Af8e253ea7A76a', [ChainId.POLYGON]: '0x275617327c958bD06b5D6b871E7f491D76113dd8', [ChainId.GOERLI]: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696', [ChainId.OPTIMISM_MAINNET]: '0xca11bde05977b3631167028862be2a173976ca11', diff --git a/src/constants/chains.ts b/src/constants/chains.ts index d6744222..40dc1488 100644 --- a/src/constants/chains.ts +++ b/src/constants/chains.ts @@ -16,6 +16,7 @@ export enum ChainId { POLYGON = 137, ARBITRUM_ONE = 42161, ARBITRUM_RINKEBY = 421611, + ARBITRUM_GOERLI = 421613, /** * Optimism Mainnet diff --git a/src/entities/DistributionCampaignBase.ts b/src/entities/DistributionCampaignBase.ts index f27a5421..0d2eebc4 100644 --- a/src/entities/DistributionCampaignBase.ts +++ b/src/entities/DistributionCampaignBase.ts @@ -29,6 +29,10 @@ const MINIMUM_STAKED_AMOUNT_NATIVE_CURRENCY: Record = { parseUnits('0.05', Token.getNative(ChainId.ARBITRUM_RINKEBY).decimals).toString(), ChainId.ARBITRUM_RINKEBY ), + [ChainId.ARBITRUM_GOERLI]: CurrencyAmount.nativeCurrency( + parseUnits('0.05', Token.getNative(ChainId.ARBITRUM_GOERLI).decimals).toString(), + ChainId.ARBITRUM_GOERLI + ), [ChainId.POLYGON]: CurrencyAmount.nativeCurrency( parseUnits('0', Token.getNative(ChainId.POLYGON).decimals).toString(), ChainId.POLYGON diff --git a/src/entities/currency.ts b/src/entities/currency.ts index cd88be14..c2cb3e3e 100644 --- a/src/entities/currency.ts +++ b/src/entities/currency.ts @@ -47,6 +47,7 @@ export class Currency { [ChainId.RINKEBY]: Currency.ETHER, [ChainId.ARBITRUM_ONE]: Currency.ETHER, [ChainId.ARBITRUM_RINKEBY]: Currency.ETHER, + [ChainId.ARBITRUM_GOERLI]: Currency.ETHER, [ChainId.XDAI]: Currency.XDAI, [ChainId.POLYGON]: Currency.MATIC, [ChainId.GOERLI]: Currency.ETHER, diff --git a/src/entities/pair.ts b/src/entities/pair.ts index 3b43d4e6..83057e5d 100644 --- a/src/entities/pair.ts +++ b/src/entities/pair.ts @@ -26,6 +26,7 @@ const INITIAL_CACHE_STATE: Record = { [ChainId.RINKEBY]: {}, [ChainId.ARBITRUM_ONE]: {}, [ChainId.ARBITRUM_RINKEBY]: {}, + [ChainId.ARBITRUM_GOERLI]: {}, [ChainId.XDAI]: {}, [ChainId.POLYGON]: {}, [ChainId.GOERLI]: {}, diff --git a/src/entities/token.ts b/src/entities/token.ts index 2f0b7a7c..43a58ac1 100644 --- a/src/entities/token.ts +++ b/src/entities/token.ts @@ -40,6 +40,13 @@ export class Token extends Currency { 'WETH', 'Wrapped Ether' ), + [ChainId.ARBITRUM_GOERLI]: new Token( + ChainId.GOERLI, + '0x89C0DBbF7559E200443735e113039cE5f1e0e6F0', + 18, + 'WETH', + 'Wrapped Ether on Görli' + ), [ChainId.XDAI]: new Token( ChainId.XDAI, '0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1', @@ -133,6 +140,7 @@ export class Token extends Currency { [ChainId.GOERLI]: Token.WETH[ChainId.GOERLI], [ChainId.OPTIMISM_MAINNET]: Token.WETH[ChainId.OPTIMISM_MAINNET], [ChainId.OPTIMISM_GOERLI]: Token.WETH[ChainId.OPTIMISM_MAINNET], + [ChainId.ARBITRUM_GOERLI]: Token.WETH[ChainId.ARBITRUM_GOERLI], } public constructor(chainId: ChainId, address: string, decimals: number, symbol?: string, name?: string) { diff --git a/src/entities/trades/0x/constants.ts b/src/entities/trades/0x/constants.ts index 371398d8..cef6a667 100644 --- a/src/entities/trades/0x/constants.ts +++ b/src/entities/trades/0x/constants.ts @@ -17,6 +17,7 @@ export const ZEROX_API_URL: Record = { [ChainId.RINKEBY]: '', [ChainId.ARBITRUM_ONE]: '', [ChainId.ARBITRUM_RINKEBY]: '', + [ChainId.ARBITRUM_GOERLI]: '', [ChainId.XDAI]: '', [ChainId.POLYGON]: 'https://polygon.api.0x.org/', [ChainId.GOERLI]: '', diff --git a/src/entities/trades/curve/pools/pools.ts b/src/entities/trades/curve/pools/pools.ts index c89b73ec..1bb6c7f2 100644 --- a/src/entities/trades/curve/pools/pools.ts +++ b/src/entities/trades/curve/pools/pools.ts @@ -508,6 +508,7 @@ export const CURVE_POOLS: Record = { // Empty [ChainId.RINKEBY]: [], [ChainId.ARBITRUM_RINKEBY]: [], + [ChainId.ARBITRUM_GOERLI]: [], [ChainId.POLYGON]: [], [ChainId.GOERLI]: [], [ChainId.OPTIMISM_MAINNET]: [], diff --git a/src/entities/trades/curve/tokens/tokens.ts b/src/entities/trades/curve/tokens/tokens.ts index b39e2263..9df335cc 100644 --- a/src/entities/trades/curve/tokens/tokens.ts +++ b/src/entities/trades/curve/tokens/tokens.ts @@ -587,6 +587,7 @@ export const CURVE_TOKENS: CurveTokenList = { [ChainId.XDAI]: TOKENS_XDAI, [ChainId.ARBITRUM_ONE]: TOKENS_ARBITRUM_ONE, [ChainId.ARBITRUM_RINKEBY]: {}, + [ChainId.ARBITRUM_GOERLI]: {}, [ChainId.RINKEBY]: {}, [ChainId.POLYGON]: {}, [ChainId.GOERLI]: {}, diff --git a/src/entities/trades/uniswap-v2/cache/index.ts b/src/entities/trades/uniswap-v2/cache/index.ts index 171fa112..3fc306df 100644 --- a/src/entities/trades/uniswap-v2/cache/index.ts +++ b/src/entities/trades/uniswap-v2/cache/index.ts @@ -12,6 +12,7 @@ export function createCacheList(): GeneralCacheList { [ChainId.XDAI]: new Map(), [ChainId.RINKEBY]: new Map(), [ChainId.ARBITRUM_RINKEBY]: new Map(), + [ChainId.ARBITRUM_GOERLI]: new Map(), [ChainId.POLYGON]: new Map(), [ChainId.GOERLI]: new Map(), [ChainId.OPTIMISM_MAINNET]: new Map(), diff --git a/src/entities/trades/uniswap-v2/constants.ts b/src/entities/trades/uniswap-v2/constants.ts index 30e7c08f..1c32eb52 100644 --- a/src/entities/trades/uniswap-v2/constants.ts +++ b/src/entities/trades/uniswap-v2/constants.ts @@ -118,6 +118,7 @@ export const BASES_TO_CHECK_TRADES_AGAINST: ChainTokenList = { USDT[ChainId.ARBITRUM_ONE], ], [ChainId.ARBITRUM_RINKEBY]: [WETH[ChainId.ARBITRUM_RINKEBY], DXD[ChainId.ARBITRUM_RINKEBY]], + [ChainId.ARBITRUM_GOERLI]: [WETH[ChainId.ARBITRUM_GOERLI]], [ChainId.XDAI]: [ WXDAI[ChainId.XDAI], WETH[ChainId.XDAI], diff --git a/src/entities/trades/utils.ts b/src/entities/trades/utils.ts index 8477e2d2..2fdb4331 100644 --- a/src/entities/trades/utils.ts +++ b/src/entities/trades/utils.ts @@ -57,6 +57,7 @@ export const RPC_PROVIDER_LIST: Record = { [ChainId.RINKEBY]: 'https://rinkeby.infura.io/v3/e1a3bfc40093494ca4f36b286ab36f2d', [ChainId.ARBITRUM_ONE]: 'https://arb1.arbitrum.io/rpc', [ChainId.ARBITRUM_RINKEBY]: 'https://rinkeby.arbitrum.io/rpc', + [ChainId.ARBITRUM_GOERLI]: 'https://goerli-rollup.arbitrum.io/rpc', [ChainId.POLYGON]: 'https://polygon-rpc.com', [ChainId.GOERLI]: 'https://goerli.infura.io/v3/e1a3bfc40093494ca4f36b286ab36f2d', [ChainId.OPTIMISM_MAINNET]: 'https://mannet.optimism.io',