Skip to content

Commit 0475e22

Browse files
committed
Fixed Shibaswap multiple chains support
1 parent 3d9284f commit 0475e22

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/connectors/shibaswap/shibaswap.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ import {
2828
import { percentRegexp } from '../../services/config-manager-v2';
2929
import { logger } from '../../services/logger';
3030
import { getAddress } from 'ethers/lib/utils';
31+
import { Ethereum } from '../../chains/ethereum/ethereum';
3132

3233
export class Shibaswap implements Uniswapish {
3334
private static _instances: { [name: string]: Shibaswap };
34-
private chain: Shibarium;
35+
private chain: Shibarium | Ethereum;
3536
private _router: string;
3637
private _routerAbi: ContractInterface;
3738
private _gasLimitEstimate: number;
@@ -42,8 +43,10 @@ export class Shibaswap implements Uniswapish {
4243

4344
private constructor(chain: string, network: string) {
4445
const config = ShibaswapConfig.config;
45-
if (['shibarium', 'ethereum'].includes(chain)) {
46+
if (chain === 'shibarium') {
4647
this.chain = Shibarium.getInstance(network);
48+
} else if (chain === 'ethereum') {
49+
this.chain = Ethereum.getInstance(network);
4750
} else {
4851
throw new Error('unsupported chain');
4952
}

0 commit comments

Comments
 (0)