Skip to content

Commit 7de9f7e

Browse files
authored
Merge branch 'master' into fix-error
2 parents 9f4e358 + d0291ff commit 7de9f7e

File tree

74 files changed

+2501
-2718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2501
-2718
lines changed

.eslintrc.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@ module.exports = {
44
es6: true,
55
node: true,
66
},
7-
plugins: ['prettier'],
8-
extends: [
9-
'eslint:recommended',
10-
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
11-
],
7+
extends: ['@offchainlabs/eslint-config-typescript/base'],
128
parserOptions: {
139
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
1410
sourceType: 'module', // Allows for the use of imports
1511
},
16-
rules: {
17-
'prettier/prettier': 'error',
18-
'no-unused-vars': 'off',
19-
'prefer-const': [2, { destructuring: 'all' }],
20-
'object-curly-spacing': ['error', 'always'],
21-
},
22-
}
12+
overrides: [
13+
{
14+
files: ['*.js', '*.ts'],
15+
rules: {
16+
'@typescript-eslint/no-var-requires': 'off',
17+
},
18+
},
19+
],
20+
};

.github/workflows/format.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Check format
2+
run-name: Checking format
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- master
8+
9+
jobs:
10+
check-formatting:
11+
name: 'Check Formatting'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout files
15+
uses: actions/checkout@v4
16+
17+
- name: Restore node_modules
18+
uses: OffchainLabs/actions/node-modules/install@main
19+
20+
- name: Check formatting with Prettier
21+
run: yarn prettier:format

.github/workflows/test-all.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test all tutorials
2+
run-name: Test all tutorials
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- master
8+
9+
env:
10+
PRIVATE_KEY: 'b6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659'
11+
CHAIN_RPC: 'http://127.0.0.1:3347'
12+
PARENT_CHAIN_RPC: 'http://127.0.0.1:8547'
13+
# Env variables for specific tutorials
14+
L1_RPC: 'http://127.0.0.1:8545'
15+
TransferTo: '0x3f1Eae7D46d88F08fc2F8ed27FCb2AB183EB2d0E'
16+
17+
jobs:
18+
test-all:
19+
name: Test all tutorials
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Restore node_modules
26+
uses: OffchainLabs/actions/node-modules/install@main
27+
28+
- name: Set up the local node
29+
# https://github.com/OffchainLabs/actions/blob/feat-simplify/run-nitro-test-node/action.yml
30+
uses: OffchainLabs/actions/run-nitro-test-node@feat-simplify
31+
with:
32+
nitro-testnode-ref: release
33+
args: --tokenbridge --l3node --l3-token-bridge
34+
35+
- name: Copy .env
36+
run: cp ./.env-sample ./.env
37+
38+
- name: Test
39+
run: yarn run testAll

.pre-commit-config.yaml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.prettierrc.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
module.exports = {
2-
semi: false,
3-
trailingComma: 'es5',
4-
singleQuote: true,
5-
printWidth: 80,
6-
tabWidth: 2,
7-
arrowParens: 'avoid',
8-
bracketSpacing: true,
2+
...require('@offchainlabs/prettier-config'),
93
overrides: [
104
{
115
files: '*.sol',
126
options: {
13-
printWidth: 100,
147
tabWidth: 4,
15-
useTabs: false,
168
singleQuote: false,
17-
bracketSpacing: true,
18-
explicitTypes: 'always',
199
},
2010
},
2111
],
22-
}
12+
};

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ From the root directory:
1212
yarn install
1313
```
1414

15+
## Testing
16+
17+
1. Start the nitro-testnode (you can find instructions [here](https://docs.arbitrum.io/run-arbitrum-node/run-local-full-chain-simulation)) with the following parameters:
18+
19+
```shell
20+
./test-node.bash --init --tokenbridge --l3node --l3-token-bridge
21+
```
22+
23+
2. Execute all tests with the following command
24+
25+
```shell
26+
yarn run testAll
27+
```
28+
1529
## What's included?
1630

1731
#### :white_check_mark: Basics

customNetwork.json

Lines changed: 77 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,78 @@
1-
{
2-
"chainID": 412346,
3-
"confirmPeriodBlocks": 20,
4-
"ethBridge": {
5-
"bridge": "0x5eCF728ffC5C5E802091875f96281B5aeECf6C49",
6-
"inbox": "0x9f8c1c641336A371031499e3c362e40d58d0f254",
7-
"outbox": "0x50143333b44Ea46255BEb67255C9Afd35551072F",
8-
"rollup": "0x7d98BA231d29D5C202981542C0291718A7358c63",
9-
"sequencerInbox": "0x18d19C5d3E685f5be5b9C86E097f0E439285D216"
1+
[
2+
{
3+
"chainID": 412346,
4+
"confirmPeriodBlocks": 20,
5+
"ethBridge": {
6+
"bridge": "0x5eCF728ffC5C5E802091875f96281B5aeECf6C49",
7+
"inbox": "0x9f8c1c641336A371031499e3c362e40d58d0f254",
8+
"outbox": "0x50143333b44Ea46255BEb67255C9Afd35551072F",
9+
"rollup": "0x7d98BA231d29D5C202981542C0291718A7358c63",
10+
"sequencerInbox": "0x18d19C5d3E685f5be5b9C86E097f0E439285D216"
11+
},
12+
"explorerUrl": "",
13+
"isArbitrum": true,
14+
"isCustom": true,
15+
"name": "ArbLocal",
16+
"partnerChainID": 1337,
17+
"retryableLifetimeSeconds": 604800,
18+
"nitroGenesisBlock": 0,
19+
"nitroGenesisL1Block": 0,
20+
"depositTimeout": 900000,
21+
"tokenBridge": {
22+
"parentGatewayRouter": "0x093AAa96CD4387A68FC0e24C60140938Dc812549",
23+
"childGatewayRouter": "0x32656396981868E925280FB772b3f806892cf4bF",
24+
"parentErc20Gateway": "0x00D9fE1a2B67B8151aEdE8855c95E58D73FB4245",
25+
"childErc20Gateway": "0x7424e3DAAAAcd867c85ceB75c1E00119F2ee5eb7",
26+
"parentCustomGateway": "0x8407E6180dC009D20D26D4BABB4790C1d4E6D2aA",
27+
"childCustomGateway": "0x0B35cfE62314C3852A0942b5830c728353BD654F",
28+
"parentWethGateway": "0xB8F48Ba39fCfB44d70F6008fe1bf4F3E744044AF",
29+
"childWethGateway": "0x67aE8014BD1A0c1Ed747715d22b3b3a188aC324B",
30+
"parentWeth": "0x7E32b54800705876d3b5cFbc7d9c226a211F7C1a",
31+
"childWeth": "0xA1abD387192e3bb4e84D3109181F9f005aBaF5CA",
32+
"parentProxyAdmin": "0x2A1f38c9097e7883570e0b02BFBE6869Cc25d8a3",
33+
"childProxyAdmin": "0x9F95547ABB0FfC92b4E37b3124d1e8613d5aB74A",
34+
"parentMultiCall": "0x49117fC32930E324F2E9A7BeA588FFb26008b8eC",
35+
"childMultiCall": "0x6B1E93aE298B64e8f5b9f43B65Dd8F1eaA6DD4c3"
36+
},
37+
"chainId": 412346,
38+
"parentChainId": 1337
1039
},
11-
"explorerUrl": "",
12-
"isArbitrum": true,
13-
"isCustom": true,
14-
"name": "ArbLocal",
15-
"partnerChainID": 1337,
16-
"retryableLifetimeSeconds": 604800,
17-
"nitroGenesisBlock": 0,
18-
"nitroGenesisL1Block": 0,
19-
"depositTimeout": 900000,
20-
"tokenBridge": {
21-
"parentGatewayRouter": "0x093AAa96CD4387A68FC0e24C60140938Dc812549",
22-
"childGatewayRouter": "0x32656396981868E925280FB772b3f806892cf4bF",
23-
"parentErc20Gateway": "0x00D9fE1a2B67B8151aEdE8855c95E58D73FB4245",
24-
"childErc20Gateway": "0x7424e3DAAAAcd867c85ceB75c1E00119F2ee5eb7",
25-
"parentCustomGateway": "0x8407E6180dC009D20D26D4BABB4790C1d4E6D2aA",
26-
"childCustomGateway": "0x0B35cfE62314C3852A0942b5830c728353BD654F",
27-
"parentWethGateway": "0xB8F48Ba39fCfB44d70F6008fe1bf4F3E744044AF",
28-
"childWethGateway": "0x67aE8014BD1A0c1Ed747715d22b3b3a188aC324B",
29-
"parentWeth": "0x7E32b54800705876d3b5cFbc7d9c226a211F7C1a",
30-
"childWeth": "0xA1abD387192e3bb4e84D3109181F9f005aBaF5CA",
31-
"parentProxyAdmin": "0x2A1f38c9097e7883570e0b02BFBE6869Cc25d8a3",
32-
"childProxyAdmin": "0x9F95547ABB0FfC92b4E37b3124d1e8613d5aB74A",
33-
"parentMultiCall": "0x49117fC32930E324F2E9A7BeA588FFb26008b8eC",
34-
"childMultiCall": "0x6B1E93aE298B64e8f5b9f43B65Dd8F1eaA6DD4c3"
35-
},
36-
"chainId": 412346,
37-
"parentChainId": 1337
38-
}
40+
{
41+
"chainID": 333333,
42+
"confirmPeriodBlocks": 20,
43+
"ethBridge": {
44+
"bridge": "0xA584795e24628D9c067A6480b033C9E96281fcA3",
45+
"inbox": "0xDcA690902d3154886Ec259308258D10EA5450996",
46+
"outbox": "0xda243bD61B011024FC923164db75Dde198AC6175",
47+
"rollup": "0xfe808cD61B3fe45c67c47B17DB49B96Fb2BFDfae",
48+
"sequencerInbox": "0x16c54EE2015CD824415c2077F4103f444E00A8cb"
49+
},
50+
"explorerUrl": "",
51+
"isArbitrum": true,
52+
"isCustom": true,
53+
"name": "ArbLocalL3",
54+
"partnerChainID": 412346,
55+
"retryableLifetimeSeconds": 604800,
56+
"nitroGenesisBlock": 0,
57+
"nitroGenesisL1Block": 0,
58+
"depositTimeout": 900000,
59+
"tokenBridge": {
60+
"parentGatewayRouter": "0xfE03DBdf7A126994dBd749631D7fbaB58C618c58",
61+
"childGatewayRouter": "0x8B6BC759226f8Fe687c8aD8Cc0DbF85E095e9297",
62+
"parentErc20Gateway": "0x6B0805Fc6e275ef66a0901D0CE68805631E271e5",
63+
"childErc20Gateway": "0xaa7d51aFFEeB32d99b1CB2fd6d81D7adA4a896e8",
64+
"parentCustomGateway": "0xA191D519260A06b32f8D04c84b9F457B8Caa0514",
65+
"childCustomGateway": "0xD4816AeF8f85A3C1E01Cd071a81daD4fa941625f",
66+
"parentWethGateway": "0x77603b0ea6a797C74Fa9ef11b5BdE04A4E03D550",
67+
"childWethGateway": "0xA6AB233B3c7bfd0399834897b5073974A3D467e2",
68+
"parentWeth": "0xA1abD387192e3bb4e84D3109181F9f005aBaF5CA",
69+
"childWeth": "0x582a8dBc77f665dF2c49Ce0a138978e9267dd968",
70+
"parentProxyAdmin": "0x1A61102c26ad3f64bA715B444C93388491fd8E68",
71+
"childProxyAdmin": "0x36C56eC2CF3a3f53db9F01d0A5Ae84b36fb0A1e2",
72+
"parentMultiCall": "0x20a3627Dcc53756E38aE3F92717DE9B23617b422",
73+
"childMultiCall": "0x052B15c8Ff0544287AE689C4F2FC53A3905d7Db3"
74+
},
75+
"chainId": 333333,
76+
"parentChainId": 412346
77+
}
78+
]

package.json

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,29 @@
1212
},
1313
"scripts": {
1414
"lint": "eslint .",
15-
"format": "prettier './**/*.{js,json,md,yml,sol}' --write && yarn run lint --fix"
15+
"prettier:format": "prettier './**/*.{js,json,md,sol,ts,yml}' --write && yarn run lint --fix",
16+
"prettier:check": "prettier './**/*.{js,json,md,sol,ts,yml}' --check && yarn run lint",
17+
"testAll": "tests/runAll.sh"
1618
},
1719
"devDependencies": {
20+
"@offchainlabs/eslint-config-typescript": "^0.2.1",
21+
"@offchainlabs/prettier-config": "0.2.1",
22+
"@typescript-eslint/eslint-plugin": "^5.62.0",
23+
"@typescript-eslint/parser": "^5.62.0",
1824
"chai": "^4.3.4",
19-
"eslint": "^8.15.0",
20-
"eslint-config-prettier": "^8.3.0",
25+
"eslint": "^8.57.0",
26+
"eslint-config-prettier": "^8.10.0",
27+
"eslint-plugin-jest": "^27.9.0",
2128
"eslint-plugin-mocha": "^9.0.0",
22-
"eslint-plugin-prettier": "^4.0.0",
23-
"prettier": "^2.3.2",
24-
"prettier-plugin-solidity": "^1.0.0-beta.17"
29+
"eslint-plugin-prettier": "^4.2.0",
30+
"prettier": "^2.8.8",
31+
"prettier-plugin-solidity": "^1.4.2"
2532
},
2633
"dependencies": {
2734
"@arbitrum/sdk": "^4.0.1",
28-
"@nomiclabs/hardhat-ethers": "^2.0.2",
29-
"ethers": "^5.4.1",
30-
"hardhat": "^2.2.0",
35+
"@nomiclabs/hardhat-ethers": "^2.2.3",
36+
"ethers": "^5.7.2",
37+
"hardhat": "^2.13.1",
3138
"dotenv": "^16.4.5"
3239
},
3340
"workspaces": {
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require('@nomiclabs/hardhat-ethers')
2-
const { hardhatConfig } = require('arb-shared-dependencies')
1+
require('@nomiclabs/hardhat-ethers');
2+
const { hardhatConfig } = require('arb-shared-dependencies');
33

4-
module.exports = hardhatConfig
4+
module.exports = hardhatConfig;

0 commit comments

Comments
 (0)