Skip to content

Commit 93a5ef5

Browse files
authored
Support Bitlayer Testnet (#1)
* Disable editor format on save * Update dependencies within the workspace * Fix turbo build task dependsOn * Comment out Rootstock chain * Support Bitlayer Testnet * Update github workflows trigger events
1 parent f028944 commit 93a5ef5

20 files changed

+109
-133
lines changed

.github/workflows/check-pr-title.yaml

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name: Check PR Title
22

33
on:
4-
pull_request_target:
5-
types:
6-
- opened
7-
- edited
8-
- synchronize
4+
# pull_request_target:
5+
# types:
6+
# - opened
7+
# - edited
8+
# - synchronize
9+
workflow_dispatch:
910

1011
jobs:
1112
# Ensures that the PR title adheres to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/).
@@ -14,4 +15,4 @@ jobs:
1415
steps:
1516
- uses: amannn/[email protected]
1617
env:
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/monorepo-checks.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
name: "Code Quality Checks"
22

33
on:
4-
workflow_call:
4+
# workflow_call:
55

6-
pull_request:
7-
types:
8-
- opened
9-
- synchronize
10-
- reopened
6+
# pull_request:
7+
# types:
8+
# - opened
9+
# - synchronize
10+
# - reopened
11+
12+
workflow_dispatch:
1113

1214
jobs:
1315
build-and-test:

.github/workflows/monorepo-integrity.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
name: "Monorepo Integrity"
22

33
on:
4-
pull_request:
5-
branches:
6-
- "**"
7-
push:
8-
branches:
9-
- main
4+
# pull_request:
5+
# branches:
6+
# - "**"
7+
# push:
8+
# branches:
9+
# - main
10+
workflow_dispatch:
1011

1112
jobs:
1213
monorepo-integrity:

.github/workflows/push-branches-from-main.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: "Push changes to beta and alpha branches"
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
# push:
5+
# branches:
6+
# - main
7+
workflow_dispatch:
78

89
jobs:
910
dev-branch-push:

.github/workflows/semantic-release.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name: Release
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- beta
4+
# push:
5+
# branches:
6+
# - main
7+
# - beta
8+
workflow_dispatch:
89

910
jobs:
1011
release:

.github/workflows/semgrep.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: Semgrep
22
on:
33
workflow_dispatch: {}
4-
pull_request: {}
5-
push:
6-
branches:
7-
- main
8-
schedule:
9-
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
10-
- cron: "35 11 * * *"
4+
# pull_request: {}
5+
# push:
6+
# branches:
7+
# - main
8+
# schedule:
9+
# # random HH:MM to avoid a load spike on GitHub Actions at 00:00
10+
# - cron: "35 11 * * *"
1111
jobs:
1212
semgrep:
1313
name: semgrep/ci

.vscode/settings.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"solidity.compileUsingRemoteVersion": "v0.8.17",
55
"solidity.formatter": "forge",
66
"files.insertFinalNewline": true,
7-
"editor.formatOnSave": true,
7+
"editor.formatOnSave": false,
88
"eslint.workingDirectories": [
99
"./sdks/permit2-sdk",
1010
"./sdks/router-sdk",
@@ -15,4 +15,4 @@
1515
"./sdks/v3-sdk",
1616
],
1717
"testing.openTesting": "neverOpen"
18-
}
18+
}

sdks/router-sdk/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
},
2222
"dependencies": {
2323
"@ethersproject/abi": "^5.5.0",
24-
"@uniswap/sdk-core": "^5.0.0",
24+
"@uniswap/sdk-core": "workspace:*",
2525
"@uniswap/swap-router-contracts": "^1.3.0",
26-
"@uniswap/v2-sdk": "^4.3.2",
27-
"@uniswap/v3-sdk": "^3.11.2"
26+
"@uniswap/v2-sdk": "workspace:*",
27+
"@uniswap/v3-sdk": "workspace:*"
2828
},
2929
"devDependencies": {
3030
"@types/jest": "^24.0.25",

sdks/sdk-core/src/addresses.ts

+18-10
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,15 @@ const ZORA_SEPOLIA_ADDRESSES: ChainAddresses = {
216216
tickLensAddress: '0x23C0F71877a1Fc4e20A78018f9831365c85f3064',
217217
}
218218

219-
const ROOTSTOCK_ADDRESSES: ChainAddresses = {
220-
v3CoreFactoryAddress: '0xaF37EC98A00FD63689CF3060BF3B6784E00caD82',
221-
multicallAddress: '0x996a9858cDfa45Ad68E47c9A30a7201E29c6a386',
222-
quoterAddress: '0xb51727c996C68E60F598A923a5006853cd2fEB31',
223-
v3MigratorAddress: '0x16678977CA4ec3DAD5efc7b15780295FE5f56162',
224-
nonfungiblePositionManagerAddress: '0x9d9386c042F194B460Ec424a1e57ACDE25f5C4b1',
225-
tickLensAddress: '0x55B9dF5bF68ADe972191a91980459f48ecA16afC',
226-
swapRouter02Address: '0x0B14ff67f0014046b4b99057Aec4509640b3947A',
227-
}
219+
// const ROOTSTOCK_ADDRESSES: ChainAddresses = {
220+
// v3CoreFactoryAddress: '0xaF37EC98A00FD63689CF3060BF3B6784E00caD82',
221+
// multicallAddress: '0x996a9858cDfa45Ad68E47c9A30a7201E29c6a386',
222+
// quoterAddress: '0xb51727c996C68E60F598A923a5006853cd2fEB31',
223+
// v3MigratorAddress: '0x16678977CA4ec3DAD5efc7b15780295FE5f56162',
224+
// nonfungiblePositionManagerAddress: '0x9d9386c042F194B460Ec424a1e57ACDE25f5C4b1',
225+
// tickLensAddress: '0x55B9dF5bF68ADe972191a91980459f48ecA16afC',
226+
// swapRouter02Address: '0x0B14ff67f0014046b4b99057Aec4509640b3947A',
227+
// }
228228

229229
const BLAST_ADDRESSES: ChainAddresses = {
230230
v3CoreFactoryAddress: '0x792edAdE80af5fC680d96a2eD80A44247D2Cf6Fd',
@@ -236,6 +236,13 @@ const BLAST_ADDRESSES: ChainAddresses = {
236236
swapRouter02Address: '0x549FEB8c9bd4c12Ad2AB27022dA12492aC452B66',
237237
}
238238

239+
const BITLAYER_TESTNET_ADDRESSES: ChainAddresses = {
240+
v3CoreFactoryAddress: '0xc95D939Da72ECe8Bd794d42EaEd28974CDb0ADa2',
241+
multicallAddress: '0x3d33856dcf74f110690f5a2647c7dfb9bb5ff2d0',
242+
quoterAddress: '0x6677D5Bb2Bc48f4F35E2a9b516bb29fBc1d22049',
243+
nonfungiblePositionManagerAddress: '0x6b5622503fe2ca3cd371f7dfe5393df04b63ce22',
244+
}
245+
239246
export const CHAIN_TO_ADDRESSES_MAP: Record<SupportedChainsType, ChainAddresses> = {
240247
[ChainId.MAINNET]: MAINNET_ADDRESSES,
241248
[ChainId.OPTIMISM]: OPTIMISM_ADDRESSES,
@@ -256,8 +263,9 @@ export const CHAIN_TO_ADDRESSES_MAP: Record<SupportedChainsType, ChainAddresses>
256263
[ChainId.BASE_GOERLI]: BASE_GOERLI_ADDRESSES,
257264
[ChainId.ZORA]: ZORA_ADDRESSES,
258265
[ChainId.ZORA_SEPOLIA]: ZORA_SEPOLIA_ADDRESSES,
259-
[ChainId.ROOTSTOCK]: ROOTSTOCK_ADDRESSES,
266+
// [ChainId.ROOTSTOCK]: ROOTSTOCK_ADDRESSES,
260267
[ChainId.BLAST]: BLAST_ADDRESSES,
268+
[ChainId.BITLAYER_TESTNET]: BITLAYER_TESTNET_ADDRESSES,
261269
}
262270

263271
/* V3 Contract Addresses */

sdks/sdk-core/src/chains.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ export enum ChainId {
2020
BASE = 8453,
2121
ZORA = 7777777,
2222
ZORA_SEPOLIA = 999999999,
23-
ROOTSTOCK = 30,
23+
// ROOTSTOCK = 30,
2424
BLAST = 81457,
25+
BITLAYER_TESTNET = 200810,
2526
}
2627

2728
export const SUPPORTED_CHAINS = [
@@ -44,8 +45,9 @@ export const SUPPORTED_CHAINS = [
4445
ChainId.BASE_GOERLI,
4546
ChainId.ZORA,
4647
ChainId.ZORA_SEPOLIA,
47-
ChainId.ROOTSTOCK,
48+
// ChainId.ROOTSTOCK,
4849
ChainId.BLAST,
50+
ChainId.BITLAYER_TESTNET,
4951
] as const
5052
export type SupportedChainsType = (typeof SUPPORTED_CHAINS)[number]
5153

@@ -58,5 +60,5 @@ export enum NativeCurrencyName {
5860
MOONBEAM = 'GLMR',
5961
BNB = 'BNB',
6062
AVAX = 'AVAX',
61-
ROOTSTOCK = 'RBTC',
63+
// ROOTSTOCK = 'RBTC',
6264
}

sdks/sdk-core/src/entities/weth9.ts

+2
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ export const WETH9: { [chainId: number]: Token } = {
2323
56: new Token(56, '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c', 18, 'WBNB', 'Wrapped BNB'),
2424
137: new Token(137, '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270', 18, 'WMATIC', 'Wrapped MATIC'),
2525
43114: new Token(43114, '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7', 18, 'WAVAX', 'Wrapped AVAX'),
26+
27+
200810: new Token(200810, '0x5F8D4232367759bCe5d9488D3ade77FCFF6B9b6B', 18, 'WBTC', 'Wrapped BTC'),
2628
}

sdks/uniswapx-sdk/integration/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@ethersproject/bytes": "^5.7.0",
3232
"@typechain/ethers-v5": "^10.1.0",
3333
"@typechain/hardhat": "^6.1.2",
34-
"@uniswap/sdk-core": "^5.0.0",
34+
"@uniswap/sdk-core": "workspace:*",
3535
"ethers": "^5.7.0",
3636
"typechain": "^8.1.0"
3737
}

sdks/uniswapx-sdk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@ethersproject/bytes": "^5.7.0",
3232
"@ethersproject/providers": "^5.7.0",
3333
"@uniswap/permit2-sdk": "^1.2.1",
34-
"@uniswap/sdk-core": "^5.0.0",
34+
"@uniswap/sdk-core": "workspace:*",
3535
"ethers": "^5.7.0"
3636
},
3737
"devDependencies": {

sdks/universal-router-sdk/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
},
3232
"dependencies": {
3333
"@uniswap/permit2-sdk": "^1.2.1",
34-
"@uniswap/router-sdk": "^1.9.2",
35-
"@uniswap/sdk-core": "^5.0.0",
34+
"@uniswap/router-sdk": "workspace:*",
35+
"@uniswap/sdk-core": "workspace:*",
3636
"@uniswap/universal-router": "1.6.0",
37-
"@uniswap/v2-sdk": "^4.3.2",
38-
"@uniswap/v3-sdk": "^3.11.2",
37+
"@uniswap/v2-sdk": "workspace:*",
38+
"@uniswap/v3-sdk": "workspace:*",
3939
"bignumber.js": "^9.0.2",
4040
"ethers": "^5.7.0"
4141
},

sdks/universal-router-sdk/src/utils/constants.ts

+6
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ const CHAIN_CONFIGS: { [key: number]: ChainConfig } = {
109109
weth: '0x4200000000000000000000000000000000000006',
110110
creationBlock: 11832155,
111111
},
112+
// bitlayer testnet
113+
[200810]: {
114+
router: '0x9d39bafc6EDd28075f3B369e175B3f014f740864',
115+
weth: '0x5F8D4232367759bCe5d9488D3ade77FCFF6B9b6B',
116+
creationBlock: 3937748,
117+
},
112118
}
113119

114120
export const UNIVERSAL_ROUTER_ADDRESS = (chainId: number): string => {

sdks/v2-sdk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"dependencies": {
2727
"@ethersproject/address": "^5.0.2",
2828
"@ethersproject/solidity": "^5.0.9",
29-
"@uniswap/sdk-core": "^5.0.0",
29+
"@uniswap/sdk-core": "workspace:*",
3030
"tiny-invariant": "^1.1.0",
3131
"tiny-warning": "^1.0.3"
3232
},

sdks/v3-sdk/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"dependencies": {
2727
"@ethersproject/abi": "^5.5.0",
2828
"@ethersproject/solidity": "^5.0.9",
29-
"@uniswap/sdk-core": "^5.0.0",
29+
"@uniswap/sdk-core": "workspace:*",
3030
"@uniswap/swap-router-contracts": "^1.3.0",
3131
"@uniswap/v3-periphery": "^1.1.1",
3232
"@uniswap/v3-staker": "1.0.0",

sdks/v3-sdk/src/utils/computePoolAddress.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import { defaultAbiCoder } from '@ethersproject/abi'
22
import { getCreate2Address } from '@ethersproject/address'
33
import { keccak256 } from '@ethersproject/solidity'
4-
import { Token } from '@uniswap/sdk-core'
4+
import { ChainId, Token } from '@uniswap/sdk-core'
55
import { FeeAmount, POOL_INIT_CODE_HASH } from '../constants'
66

7+
function getInitCodeOfSpecialChain(chainId: ChainId) {
8+
if (chainId === ChainId.BITLAYER_TESTNET) {
9+
return '0x9b06af945a15e497de0a98c56727a90114ae2d082285037c0045493ce98241aa'
10+
}
11+
return POOL_INIT_CODE_HASH
12+
}
13+
714
/**
815
* Computes a pool address
916
* @param factoryAddress The Uniswap V3 factory address
@@ -33,6 +40,6 @@ export function computePoolAddress({
3340
['bytes'],
3441
[defaultAbiCoder.encode(['address', 'address', 'uint24'], [token0.address, token1.address, fee])]
3542
),
36-
initCodeHashManualOverride ?? POOL_INIT_CODE_HASH
43+
initCodeHashManualOverride ?? getInitCodeOfSpecialChain(token0.chainId)
3744
)
3845
}

turbo.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"sdks/*/src/**.ts",
1414
"sdks/*/src/**.tsx"
1515
],
16-
"outputs": []
16+
"outputs": [],
17+
"dependsOn": ["^build"]
1718
},
1819
"test": {
1920
"dependsOn": [
@@ -27,4 +28,4 @@
2728
"dependsOn": []
2829
}
2930
}
30-
}
31+
}

0 commit comments

Comments
 (0)