Skip to content

Commit

Permalink
Fixed Shibaswap multiple chains support
Browse files Browse the repository at this point in the history
  • Loading branch information
evseevnn committed Oct 10, 2024
1 parent 3d9284f commit 0475e22
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/connectors/shibaswap/shibaswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ import {
import { percentRegexp } from '../../services/config-manager-v2';
import { logger } from '../../services/logger';
import { getAddress } from 'ethers/lib/utils';
import { Ethereum } from '../../chains/ethereum/ethereum';

export class Shibaswap implements Uniswapish {
private static _instances: { [name: string]: Shibaswap };
private chain: Shibarium;
private chain: Shibarium | Ethereum;
private _router: string;
private _routerAbi: ContractInterface;
private _gasLimitEstimate: number;
Expand All @@ -42,8 +43,10 @@ export class Shibaswap implements Uniswapish {

private constructor(chain: string, network: string) {
const config = ShibaswapConfig.config;
if (['shibarium', 'ethereum'].includes(chain)) {
if (chain === 'shibarium') {
this.chain = Shibarium.getInstance(network);
} else if (chain === 'ethereum') {
this.chain = Ethereum.getInstance(network);
} else {
throw new Error('unsupported chain');
}
Expand Down

0 comments on commit 0475e22

Please sign in to comment.