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

Create first BTT changes #10

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import JSBI from 'jsbi'
export type BigintIsh = JSBI | string | number

export enum ChainId {
MAINNET = 11111,
NILE = 201910292,
SHASTA = 1
MAINNET = 199,
DONAU = 1029
}

export enum TradeType {
Expand All @@ -20,13 +19,12 @@ export enum Rounding {
ROUND_UP
}

export const FACTORY_ADDRESS = '0x486be31557ee7d7b50113a512da8faa1a6c3a5ef'
export const FACTORY_ADDRESS = '0x25078Aa3439E4F4cadef81373bd2105cf0e814C8'
export const FACTORY_ADDRESSES: { [chainId: number]: string } = {
[ChainId.MAINNET]: '0xC2301F81D7E05B70AC94207D4E5B7CB07C845568',
[ChainId.NILE]: '0xed8185b97e71435f5c37381a8b4d050b5daee972',
[ChainId.SHASTA]: '0x486be31557ee7d7b50113a512da8faa1a6c3a5ef'
[ChainId.MAINNET]: '0x5f4f1a36b7c141a12817580bc35277955c0afd78',
[ChainId.DONAU]: '0xc0fb56252e8048f45d2b091d1f142c9d27ec0cb2'
}
export const INIT_CODE_HASH = '0x87abd74a1a26e0addc829240582ef115e4b42b6271fb9a3937363a3f0f756cce'
export const INIT_CODE_HASH = '0x9c7703d0f26714f3c5eb40128273e2cd2d69c69cfed9e38dd249609c9ca4c83f'

export const MaxUint256 = JSBI.BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff')
export const MINIMUM_LIQUIDITY = JSBI.BigInt(1000)
Expand Down
2 changes: 1 addition & 1 deletion src/entities/currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class Currency {
readonly symbol?: string
readonly name?: string

public static readonly ETHER: Currency = new Currency(6, 'TRX', 'Tron')
public static readonly ETHER: Currency = new Currency(18, 'BTT', 'BitTorrent Token')

protected constructor(decimals: number, symbol?: string, name?: string) {
invariant(decimals >= 0 && decimals < 255 && Number.isInteger(decimals), 'DECIMALS')
Expand Down
11 changes: 8 additions & 3 deletions src/entities/weth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import { Token } from './token'
import { ChainId } from '../constants'

export const WETH: { [chainId: number]: Token } = {
[ChainId.MAINNET]: new Token(ChainId.MAINNET, '0x891CDB91D149F23B1A45D9C5CA78A88D0CB44C18', 6, 'WTRX', 'Wrapped TRX'),
[ChainId.NILE]: new Token(ChainId.NILE, '0x8f44113A985076431b77f6078f0929f949cB8836', 6, 'WTRX', 'Wrapped TRX'),
[ChainId.SHASTA]: new Token(ChainId.SHASTA, '0xB970B980C520EC3F49921C2727BFA6DE79E7226A', 6, 'WTRX', 'Wrapped TRX')
[ChainId.MAINNET]: new Token(
ChainId.MAINNET,
'0x197a4ed2b1bb607e47a144b9731d7d34f86e9686',
18,
'WBTT',
'Wrapped BTT'
),
[ChainId.DONAU]: new Token(ChainId.DONAU, '0xcbda27d7f16c71aa2b4d1a1309fd26eae4d63c4a', 18, 'WBTT', 'Wrapped BTT')
}
3 changes: 1 addition & 2 deletions src/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { TokenAmount } from './entities/fractions/tokenAmount'

export var TOKEN_DECIMALS_CACHE: { [chainId: number]: { [tokenAddress: string]: number } } = {
[ChainId.MAINNET]: {},
[ChainId.NILE]: {},
[ChainId.SHASTA]: {}
[ChainId.DONAU]: {}
}

/**
Expand Down