Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated addresses #2

Open
wants to merge 14 commits into
base: 0.0.7
Choose a base branch
from
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shibaswap/sdk",
"license": "MIT",
"version": "0.0.7",
"version": "0.2.7",
"description": "🛠 An SDK for building applications on top of Shibaswap.",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
91 changes: 79 additions & 12 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export enum Rounding {
}

export const INIT_CODE_HASH: string = '0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303'
export const SHIBA_CODE_HASH: string = '0x46f2b261915920ae487aa094de3853eb758efbed8dd30a4bba1cdcf7e87413de';
export const SHIBA_CODE_HASH: string = '0xbd9cab70434fb4e2ec58bbfc544315f08288e6f0f4b1812aff7b5740af752d73'//'0xbd9cab70434fb4e2ec58bbfc544315f08288e6f0f4b1812aff7b5740af752d73'; //? FACTORY

export const SUSHI_FACTORY_ADDRESS: { [chainId in ChainId]: string } = {
[ChainId.MAINNET]: '0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac',
Expand Down Expand Up @@ -206,7 +206,7 @@ export const SHIBASWAP_FACTORY_ADDRESS: { [chainId in ChainId]: string } = {
[ChainId.ROPSTEN]: '',
[ChainId.RINKEBY]: '',
[ChainId.GÖRLI]: '',
[ChainId.KOVAN]: '0x90F1547C90B32691Af75f1776f27E6A13f3902fb', // Shibaswap
[ChainId.KOVAN]: '0x842e15348eea1391698f82f8bd29f728bd71b20b', // Shibaswap
[ChainId.FANTOM]: '',
[ChainId.FANTOM_TESTNET]: '',
[ChainId.MATIC]: '',
Expand All @@ -229,7 +229,7 @@ export const SHIBASWAP_ROUTER_ADDRESS: { [chainId in ChainId]: string } = {
[ChainId.RINKEBY]: '',
[ChainId.ROPSTEN]: '',
[ChainId.GÖRLI]: '',
[ChainId.KOVAN]: '0xd13e86C14da4db5d8Ab0ac19B017f49f12F7d349', // Address for UniswapV2Router02 for Shibaswap
[ChainId.KOVAN]: '0xf68c706a9A5C9fe24eaE5009F5c62b2179997f7d',//'0xc010cdBA860B130f3d42f326676dEBE6a008418B', // Address for UniswapV2Router02 for Shibaswap
[ChainId.FANTOM]: '',
[ChainId.FANTOM_TESTNET]: '',
[ChainId.MATIC]: '',
Expand All @@ -252,7 +252,7 @@ export const SHIBASWAP_SHIB_TOKEN_ADDRESS: { [chainId in ChainId]: string } = {
[ChainId.ROPSTEN]: '',
[ChainId.RINKEBY]: '',
[ChainId.GÖRLI]: '',
[ChainId.KOVAN]: '0x328d0a5C7342a4e1FAb26aBbD0a1aC10B82Abe5E',
[ChainId.KOVAN]: '0x6DAe78A63988D5eC4880fdF0AA2cC1605abAB08A',
[ChainId.FANTOM]: '',
[ChainId.FANTOM_TESTNET]: '',
[ChainId.MATIC]: '',
Expand All @@ -275,7 +275,7 @@ export const SHIBASWAP_LEASH_TOKEN_ADDRESS: { [chainId in ChainId]: string } = {
[ChainId.ROPSTEN]: '',
[ChainId.RINKEBY]: '',
[ChainId.GÖRLI]: '',
[ChainId.KOVAN]: '0xF2f35c57C1846dd83de10B88c86E8064ee88f03e',
[ChainId.KOVAN]: '0xEb8F20036c047987E4C3F2eaB8E8dbF3df7750dd',
[ChainId.FANTOM]: '',
[ChainId.FANTOM_TESTNET]: '',
[ChainId.MATIC]: '',
Expand All @@ -298,7 +298,7 @@ export const SHIBASWAP_BONE_TOKEN_ADDRESS: { [chainId in ChainId]: string } = {
[ChainId.ROPSTEN]: '',
[ChainId.RINKEBY]: '',
[ChainId.GÖRLI]: '',
[ChainId.KOVAN]: '0x1eaa874fCB131B2D2Df39ee77E286FC49A0eCbd1',
[ChainId.KOVAN]: '0x1Bc67Cfd1b6575f605E668783a38c752f9842680',
[ChainId.FANTOM]: '',
[ChainId.FANTOM_TESTNET]: '',
[ChainId.MATIC]: '',
Expand All @@ -321,7 +321,7 @@ export const SHIBASWAP_TOPDOG_ADDRESS: { [chainId in ChainId]: string } = {
[ChainId.ROPSTEN]: '',
[ChainId.RINKEBY]: '',
[ChainId.GÖRLI]: '',
[ChainId.KOVAN]: '0x3107713B76193C2648ddf20E3206f753b66e3553',
[ChainId.KOVAN]: '0xFd9aee78147312f2A50d9Fc96dD40fBD6D62DFf2',
[ChainId.FANTOM]: '',
[ChainId.FANTOM_TESTNET]: '',
[ChainId.MATIC]: '',
Expand All @@ -344,7 +344,7 @@ export const SHIBASWAP_BURY_BONE_ADDRESS: { [chainId in ChainId]: string } = {
[ChainId.ROPSTEN]: '',
[ChainId.RINKEBY]: '',
[ChainId.GÖRLI]: '',
[ChainId.KOVAN]: '0xDcfc709dB81230bF75b7d2B419a9EbD234770541',
[ChainId.KOVAN]: '0xd15f43a801D251ECe40D8652567776407a190298',
[ChainId.FANTOM]: '',
[ChainId.FANTOM_TESTNET]: '',
[ChainId.MATIC]: '',
Expand All @@ -367,7 +367,7 @@ export const SHIBASWAP_BURY_LEASH_ADDRESS: { [chainId in ChainId]: string } = {
[ChainId.ROPSTEN]: '',
[ChainId.RINKEBY]: '',
[ChainId.GÖRLI]: '',
[ChainId.KOVAN]: '0x3956930a50aA6532D518f11EB2bb4c375aC2208A',
[ChainId.KOVAN]: '0x4263D224046c70C6776C36CC0F387e4a594E3253',
[ChainId.FANTOM]: '',
[ChainId.FANTOM_TESTNET]: '',
[ChainId.MATIC]: '',
Expand All @@ -390,7 +390,7 @@ export const SHIBASWAP_BURY_SHIB_ADDRESS: { [chainId in ChainId]: string } = {
[ChainId.ROPSTEN]: '',
[ChainId.RINKEBY]: '',
[ChainId.GÖRLI]: '',
[ChainId.KOVAN]: '0x9f7DFDD8F11F46f2154e81e0A07147665eF56CA2',
[ChainId.KOVAN]: '0x46F8aBAF0414031DE7E885571Fbd9fB2d0690851', //0x284D75EfE549Cd157a344a322fB18CDAcd60ba2A
[ChainId.FANTOM]: '',
[ChainId.FANTOM_TESTNET]: '',
[ChainId.MATIC]: '',
Expand All @@ -413,7 +413,7 @@ export const SHIBASWAP_UNI_FETCH_ADDRESS: { [chainId in ChainId]: string } = {
[ChainId.ROPSTEN]: '',
[ChainId.RINKEBY]: '',
[ChainId.GÖRLI]: '',
[ChainId.KOVAN]: '0x7803a532dadE25d89116bfd995850dc0d3c59EC9',
[ChainId.KOVAN]: '0x10c1B36292Ee95ee8d68Ca8366487e8559938879',
[ChainId.FANTOM]: '',
[ChainId.FANTOM_TESTNET]: '',
[ChainId.MATIC]: '',
Expand All @@ -436,7 +436,7 @@ export const SHIBASWAP_SUSHI_FETCH_ADDRESS: { [chainId in ChainId]: string } = {
[ChainId.ROPSTEN]: '',
[ChainId.RINKEBY]: '',
[ChainId.GÖRLI]: '',
[ChainId.KOVAN]: '0x0c7d4ABd92eAAA91Caf8447666D7244B6474ca89',
[ChainId.KOVAN]: '0x255b1e3a1396dad2bD5a24540AeA32d6443AF89f',
[ChainId.FANTOM]: '',
[ChainId.FANTOM_TESTNET]: '',
[ChainId.MATIC]: '',
Expand Down Expand Up @@ -501,6 +501,30 @@ export const SHIBASWAP_TIMELOCK_ADDRESS: { [chainId in ChainId]: string } = {
[ChainId.HARMONY_TESTNET]: ''
}

export const SHIBA_BORING_HELPER_ADDRESS: { [chainId in ChainId]?: string } = {
[ChainId.MAINNET]: '',
[ChainId.ROPSTEN]: '',
[ChainId.RINKEBY]: '',
[ChainId.GÖRLI]: '',
[ChainId.KOVAN]: '0x5bACD4B8D22Fd833e688B1C4f574e01880890428'
}

export const SHIBA_DASHBOARD_1_ADDRESS: { [chainId in ChainId]?: string } = {
[ChainId.MAINNET]: '',
[ChainId.ROPSTEN]: '',
[ChainId.RINKEBY]: '',
[ChainId.GÖRLI]: '',
[ChainId.KOVAN]: '0x1D50877F87600b09c4d35C030d7f94092Ed5761e'
}

export const SHIBA_DASHBOARD_2_ADDRESS: { [chainId in ChainId]?: string } = {
[ChainId.MAINNET]: '',
[ChainId.ROPSTEN]: '',
[ChainId.RINKEBY]: '',
[ChainId.GÖRLI]: '',
[ChainId.KOVAN]: '0x5bACD4B8D22Fd833e688B1C4f574e01880890428'
}

export const MINIMUM_LIQUIDITY = JSBI.BigInt(1000)

// exports for internal consumption
Expand All @@ -523,3 +547,46 @@ export const SOLIDITY_TYPE_MAXIMA = {
[SolidityType.uint8]: JSBI.BigInt('0xff'),
[SolidityType.uint256]: JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')
}

export const USDC_MERKLE_DISTRIBUTOR_ADDRESS: { [chainId in ChainId]?: string } = {
[ChainId.MAINNET]: '',
[ChainId.ROPSTEN]: '',
[ChainId.KOVAN]: '0x69629D009E89a12286b82559898B35396a457EEC'
}

export const USDT_MERKLE_DISTRIBUTOR_ADDRESS: { [chainId in ChainId]?: string } = {
[ChainId.MAINNET]: '',
[ChainId.ROPSTEN]: '',
[ChainId.KOVAN]: '0xC01c9ef0f5a5BBDC714DD7467Aa81B03940831e4'
}


export const WBTC_MERKLE_DISTRIBUTOR_ADDRESS: { [chainId in ChainId]?: string } = {
[ChainId.MAINNET]: '',
[ChainId.ROPSTEN]: '',
[ChainId.KOVAN]: '0xB863b6dDA2fA713404a7b0B59bEd399453CD2534'
}

export const DAI_MERKLE_DISTRIBUTOR_ADDRESS: { [chainId in ChainId]?: string } = {
[ChainId.MAINNET]: '',
[ChainId.ROPSTEN]: '',
[ChainId.KOVAN]: '0x7Dc5238a64E88F6E8959a9FB494d252195AbFA1b'
}

export const xSHIB_BONE_MERKLE_DISTRIBUTOR_ADDRESS: { [chainId in ChainId]?: string } = {
[ChainId.MAINNET]: '',
[ChainId.ROPSTEN]: '',
[ChainId.KOVAN]: '0x67dB408dE153b62C17907aAA8A80c533d1765d48'
}

export const xSHIB_WETH_MERKLE_DISTRIBUTOR_ADDRESS: { [chainId in ChainId]?: string } = {
[ChainId.MAINNET]: '',
[ChainId.ROPSTEN]: '',
[ChainId.KOVAN]: '0x571834C8b73BDFf543C6b2e089872CDF82888f4C'
}

export const xLEASH_BONE_MERKLE_DISTRIBUTOR_ADDRESS: { [chainId in ChainId]?: string } = {
[ChainId.MAINNET]: '',
[ChainId.ROPSTEN]: '',
[ChainId.KOVAN]: '0x1b2689FE863071D10532515b4A486eA291B93136'
}
2 changes: 1 addition & 1 deletion src/entities/pair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class Pair {
public static getAddress(tokenA: Token, tokenB: Token): string {
const tokens = tokenA.sortsBefore(tokenB) ? [tokenA, tokenB] : [tokenB, tokenA] // does safety checks

if (PAIR_ADDRESS_CACHE?.[tokens[0].address]?.[tokens[1].address] === undefined) {
if (PAIR_ADDRESS_CACHE?.[tokens[0].address]?.[tokens[1].address] === undefined && SHIBASWAP_FACTORY_ADDRESS[tokenA.chainId]) {
PAIR_ADDRESS_CACHE = {
...PAIR_ADDRESS_CACHE,
[tokens[0].address]: {
Expand Down
36 changes: 35 additions & 1 deletion src/entities/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const WETH = {
'Wrapped Ether'
),
[ChainId.GÖRLI]: new Token(ChainId.GÖRLI, '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6', 18, 'WETH', 'Wrapped Ether'),
[ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xd0A1E359811322d97991E03f863a0C30C2cF029C', 18, 'WETH', 'Wrapped Ether'),
[ChainId.KOVAN]: new Token(ChainId.KOVAN, '0x7b7aE6E0b8240e711C3B8854d780E22469d76a37', 18, 'WETH', 'Wrapped Ether'),
[ChainId.FANTOM]: new Token(ChainId.FANTOM, '0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83', 18, 'WFTM', 'Wrapped FTM'),
[ChainId.FANTOM_TESTNET]: new Token(
ChainId.FANTOM_TESTNET,
Expand Down Expand Up @@ -158,3 +158,37 @@ export const WETH = {
'Wrapped ONE'
)
}

export type ChainTokenMap = {
readonly [chainId in ChainId]?: Token
}

export const USDC: ChainTokenMap = {
[ChainId.KOVAN]: new Token(ChainId.KOVAN, '0x0cf2cd0277f75c8799b5526e0aa104c8797b0b5c', 18, 'USDC', 'USDC'),
}

export const USDT: ChainTokenMap = {
[ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xd345350e7ba96a1cb3258399db1e3762853c1284', 18, 'USDT', 'USDT'),
}

export const WBTC: ChainTokenMap = {
[ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xB7b55994a20C8A7097E77B45C5Ae7FBA88E199F3', 18, 'wBTC', 'Wrapped BTC'),
}

export const DAI: ChainTokenMap = {
[ChainId.KOVAN]: new Token(ChainId.KOVAN, '0x81dcdd94b8c1eadcd6e30a462d862d07bf429119', 18, 'DAI', 'DAI'),
}

export const BONE: ChainTokenMap = {
[ChainId.KOVAN]: new Token(ChainId.KOVAN, '0x1Bc67Cfd1b6575f605E668783a38c752f9842680', 18, 'BONE', 'BONE DOGECOIN KILLER'),
}

export const SHIBA_INU = {
[ChainId.MAINNET]: new Token(ChainId.MAINNET, '0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE', 18, 'SHIB', 'SHIBA INU'),
[ChainId.KOVAN]: new Token(ChainId.KOVAN, '0x6DAe78A63988D5eC4880fdF0AA2cC1605abAB08A', 18, 'SHIB', 'SHIBA INU'),
}

export const LEASH = {
[ChainId.MAINNET]: new Token(ChainId.KOVAN, '0x27C70Cd1946795B66be9d954418546998b546634', 18, 'LEASH', 'DOGE KILLER'),
[ChainId.KOVAN]: new Token(ChainId.KOVAN, '0xEb8F20036c047987E4C3F2eaB8E8dbF3df7750dd', 18, 'LEASH', 'DOGE KILLER'),
}
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export {
SHIBASWAP_UNI_FETCH_ADDRESS,
SHIBASWAP_SUSHI_FETCH_ADDRESS,
SHIBASWAP_LP_TOKEN_ADDRESS,
SHIBASWAP_TIMELOCK_ADDRESS
SHIBASWAP_TIMELOCK_ADDRESS,
SHIBA_BORING_HELPER_ADDRESS,
SHIBA_DASHBOARD_1_ADDRESS,
SHIBA_DASHBOARD_2_ADDRESS
} from './constants'

export * from './errors'
Expand Down