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

SOV-4256: Bitlayer testnet dapp deployment #944

Open
wants to merge 2 commits into
base: bitlayer-base
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
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ export const DEFAULT_SWAP_ENTRIES: Partial<Record<ChainIds, string>> = {
[ChainIds.RSK_TESTNET]: COMMON_SYMBOLS.DLLR,
[ChainIds.BOB_MAINNET]: COMMON_SYMBOLS.ETH,
[ChainIds.BOB_TESTNET]: COMMON_SYMBOLS.ETH,
[ChainIds.BITLAYER_TESTNET]: COMMON_SYMBOLS.BTC,
[ChainIds.SEPOLIA]: COMMON_SYMBOLS.ETH,
};
1 change: 0 additions & 1 deletion apps/frontend/src/utils/graphql/bob/generated.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = {
Expand Down
1 change: 0 additions & 1 deletion apps/frontend/src/utils/graphql/mynt/generated.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = {
Expand Down
1 change: 0 additions & 1 deletion apps/frontend/src/utils/graphql/rsk/generated.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = {
Expand Down
1 change: 0 additions & 1 deletion apps/frontend/src/utils/graphql/zero/generated.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';

export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = {
Expand Down
81 changes: 80 additions & 1 deletion packages/contracts/src/contracts/assets/bitlayerTestnet.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,82 @@
import { constants } from 'ethers';

import { AssetDetails } from '../../types';

export const bitlayerTestnet: Array<AssetDetails> = [];
export const bitlayerTestnet: Array<AssetDetails> = [
{
symbol: 'BTC',
address: constants.AddressZero,
name: 'Bitcoin',
isNative: true,
decimals: 18,
getIcon: async () => (await import('./icons/unknown')).default,
description: 'Bitcoin',
},
{
symbol: 'WBTC',
address: '0xc442ce6a859d3155B4c1347dD424ad11a936f560',
name: 'Wrapped Bitcoin',
decimals: 18,
getIcon: async () => (await import('./icons/unknown')).default,
},
{
symbol: 'tBTC',
address: '0x6645096dEC23E5168C352BA0cB0E6D4970040dde',
decimals: 18,
getIcon: async () => (await import('./icons/unknown')).default,
},
{
symbol: 'rETH',
address: '0xEc025c3651308Ff67835Cf0F147315466932E15c',
decimals: 18,
getIcon: async () => (await import('./icons/unknown')).default,
},
{
symbol: 'USDT',
address: '0x6d21769F31E06c4A2e123Cd1B40d840150A67Fb6',
decimals: 18,
getIcon: async () => (await import('./icons/unknown')).default,
},
{
symbol: 'DAI',
address: '0xA328Ab97Be109Ce0b4dFd70DaD773105FB2d81a7',
decimals: 18,
getIcon: async () => (await import('./icons/unknown')).default,
},
{
symbol: 'eSOV',
address: '0x5A31feEb51B9Fc3075FEBdE967c85da5210eff4b',
decimals: 18,
getIcon: async () => (await import('./icons/unknown')).default,
},
{
symbol: 'ALEX',
address: '0x1CAd822537903dC5d316e66b61C71fF54184b455',
decimals: 18,
getIcon: async () => (await import('./icons/unknown')).default,
},
{
symbol: 'USDC',
address: '0xE34A89C9943A79eE895a1163A57422F3Bca6E931',
decimals: 18,
getIcon: async () => (await import('./icons/unknown')).default,
},
{
symbol: 'DLLR',
address: '0x25dA1d18C29479427F9aEE57b3F2Fe7148EcA67B',
decimals: 18,
getIcon: async () => (await import('./icons/unknown')).default,
},
{
symbol: 'POWA',
address: '0x1C152B98A5eAeA683333177E21D3610bD6B3c8bf',
decimals: 18,
getIcon: async () => (await import('./icons/unknown')).default,
},
{
symbol: 'wstETH',
address: '0x2756b9d84Ec55d2987eE28d269d48780f05Fdcb7',
decimals: 18,
getIcon: async () => (await import('./icons/unknown')).default,
},
];
8 changes: 8 additions & 0 deletions packages/contracts/src/contracts/protocol/bitlayerTestnet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { AsyncContractConfigData } from '../../types';

export const bitlayerTestnet: Record<string, AsyncContractConfigData> = {
staking: {
address: '0x8AC7f31B587A2369C985b05627873cFA50C70a3C',
getAbi: async () => (await import('../../abis/staking.json')).default,
},
};
2 changes: 2 additions & 0 deletions packages/contracts/src/contracts/protocol/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Network } from '@sovryn/ethers-provider';

import { AsyncContractConfigData } from '../../types';
import { bitlayerTestnet } from './bitlayerTestnet';
import { bob } from './bob';
import { bobTestnet } from './bobTestnet';
import { fork } from './fork';
Expand All @@ -17,4 +18,5 @@ export const protocol: Partial<
bobTestnet,
sepolia,
fork,
bitlayerTestnet,
};
25 changes: 25 additions & 0 deletions packages/sdex/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,30 @@ const SEPOLIA_CHAIN: ChainSpec = {
logoUrl: ETHEREUM_LOGO,
};

const BITLAYER_TESTNET_CHAIN: ChainSpec = {
nodeUrl: 'https://testnet-rpc.bitlayer.org',
addrs: {
dex: '0x701C1331AABf09F66E3f62455c7D1b4A3924E5C3',
query: '0x71A5452a62F35F22A4C5115382d6b4CC8a864D4C',
impact: '0xA17B99B2817d0EdD992fE00D219DEc2b9835742d',
router: '0x22Bdd8B71928003473EfA83cd69689cc04507cd9',
routerBypass: '0x6138a1c3c2a419075E50f2C8A8600366D4105f8d',
},
poolIndex: 36000,
isTestNet: true,
chainId: '0x3106a',
gridSize: 16,
proxyPaths: {
cold: 3,
long: 130,
liq: 128,
dfltColdSwap: true,
},
blockExplorer: 'https://testnet-scan.bitlayer.org',
displayName: 'Bitlayer Testnet',
logoUrl: ETHEREUM_LOGO,
};

const LOCAL_FORK_CHAIN: ChainSpec = Object.assign({}, SEPOLIA_CHAIN, {
nodeUrl: 'http://127.0.0.1:8545',
chainId: '0x7a69',
Expand All @@ -142,6 +166,7 @@ export const CHAIN_SPECS: { [chainId: string]: ChainSpec } = {
'0x7a69': LOCAL_FORK_CHAIN,
'0xaa36a7': SEPOLIA_CHAIN,
'0x1b669': TENDERLY_FORK,
'0x3106a': BITLAYER_TESTNET_CHAIN,
sepolia: SEPOLIA_CHAIN,
local: LOCAL_FORK_CHAIN,
bob: BOB_CHAIN,
Expand Down
7 changes: 6 additions & 1 deletion packages/sdk/src/swaps/smart-router/routes/ambient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ export const ambientRoute: SwapRouteFunction = (

return {
name: 'Ambient',
chains: [ChainIds.BOB_MAINNET, ChainIds.BOB_TESTNET, ChainIds.SEPOLIA],
chains: [
ChainIds.BOB_MAINNET,
ChainIds.BOB_TESTNET,
ChainIds.BITLAYER_TESTNET,
ChainIds.SEPOLIA,
],
pairs: async () => {
const pools = await loadPools();

Expand Down
1 change: 1 addition & 0 deletions packages/sdk/src/swaps/smart-router/utils/ambient-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ const POOLS: Partial<Record<ChainIds, PoolWithIndex[]>> = {
['POWA', 'SOV', 38000],
],
[ChainIds.SEPOLIA]: [['USDC', 'USDT', 36000]],
[ChainIds.BITLAYER_TESTNET]: [],
};

export const fetchPools = async (chainId: ChainId) => {
Expand Down