Skip to content

Commit

Permalink
(fix) add sepolia testnet to address failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
fengtality committed Jul 25, 2024
1 parent 78c55e1 commit 5444cc7
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/connectors/uniswap/uniswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ export class Uniswap implements Uniswapish {
this.chainId = this.chain.chainId;
this._ttl = UniswapConfig.config.ttl;
this._maximumHops = UniswapConfig.config.maximumHops;

this._alphaRouter = null;
if (this.chainId !== 8453) {
if (this.chainId !== 11155111) {
this._alphaRouter = new AlphaRouter({
chainId: this.chainId,
provider: this.chain.provider,
Expand Down
7 changes: 7 additions & 0 deletions src/templates/ethereum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ networks:
tokenListSource: /home/gateway/conf/lists/base_uniswap_20240411.json
nativeCurrencySymbol: ETH
gasPriceRefreshInterval: 60
sepolia:
chainID: 111
nodeURL: https://rpc.ankr.com/eth_sepolia
tokenListType: FILE
tokenListSource: /home/gateway/conf/lists/erc20_tokens_sepolia.json
nativeCurrencySymbol: ETH
gasPriceRefreshInterval: 60

# if you use the gas assumptions below, your wallet needs >0.1 ETH balance for gas
gasLimitTransaction: 3000000
Expand Down
19 changes: 19 additions & 0 deletions src/templates/lists/erc20_tokens_sepolia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "sepolia",
"tokens": [
{
"chainId": 11155111,
"name": "Wrapped Ether",
"address": "0xfff9976782d46cc05630d1f6ebab18b2324d6b14",
"symbol": "WETH",
"decimals": 18
},
{
"chainId": 11155111,
"address": "0xff34b3d4aee8ddcd6f9afffb6fe49bd371b8a357",
"name": "Dai Stablecoin",
"symbol": "DAI",
"decimals": 18
}
]
}
7 changes: 6 additions & 1 deletion src/templates/uniswap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,9 @@ contractAddresses:
uniswapV3SmartOrderRouterAddress: '0x2626664c2603336E57B271c5C0b26F421741e481'
uniswapV3NftManagerAddress: '0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1'
uniswapV3QuoterV2ContractAddress: '0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a'
uniswapV3FactoryAddress: '0x33128a8fC17869897dcE68Ed026d694621f6FDfD'
uniswapV3FactoryAddress: '0x33128a8fC17869897dcE68Ed026d694621f6FDfD'
sepolia:
uniswapV3SmartOrderRouterAddress: '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45'
uniswapV3NftManagerAddress: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88'
uniswapV3QuoterV2ContractAddress: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e'
uniswapV3FactoryAddress: '0x1F98431c8aD98523631AE4a59f267346ea31F984'
12 changes: 6 additions & 6 deletions test/connectors/uniswap/uniswap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ let uniswap: Uniswap;
let mockProvider: typeof MockProvider;

const WETH = new Token(
3,
'0xd0A1E359811322d97991E03f863a0C30C2cF029C',
11155111,
'0xfff9976782d46cc05630d1f6ebab18b2324d6b14',
18,
'WETH'
);

const DAI = new Token(
3,
'0x4f96fe3b7a6cf9725f59d353f723c1bdb64ca6aa',
11155111,
'0xff34b3d4aee8ddcd6f9afffb6fe49bd371b8a357',
18,
'DAI'
);

const DAI_WETH_POOL_ADDRESS = '0xBEff876AC507446457C2A6bDA9F7021A97A8547f';
const DAI_WETH_POOL_ADDRESS = '0x1c9d93e574be622821398e3fe677e3a279f256f7';
const POOL_SQRT_RATIO_START = encodeSqrtRatioX96(100e6, 100e18);
const POOL_TICK_CURRENT = TickMath.getTickAtSqrtRatio(POOL_SQRT_RATIO_START);
const POOL_LIQUIDITY = 0;
Expand All @@ -50,7 +50,7 @@ const DAI_WETH_POOL = new UniswapV3Pool(
);

beforeAll(async () => {
ethereum = Ethereum.getInstance('goerli');
ethereum = Ethereum.getInstance('sepolia');
patchEVMNonceManager(ethereum.nonceManager);
await ethereum.init();
});
Expand Down

0 comments on commit 5444cc7

Please sign in to comment.