Skip to content

Commit 21a45b9

Browse files
feat!: Mailbox function deprecation (#550)
# What ❔ - Contract: - Deprecated the usage of `Mailbox.finalizeEthWithdrawal`/`L1ERC20Bridge.finalizeWithfrawal` in favor of `L1Nullifier.finalizeDeposit` - Changed the usage of env variables for a constructor to set the address of L1AssetRouter - Server: retrieved added the L2 chain Id into the flow as it is now required by the contract. - Added contract-specific GH workflow `contracts-ci.yml` - Updated some dependencies to successfully compile the contract ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `cargo fmt`.
1 parent 9eeb34a commit 21a45b9

28 files changed

+8300
-236
lines changed

.github/workflows/build_and_publish.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ jobs:
1111
runs-on: [matterlabs-ci-runner]
1212

1313
steps:
14-
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
14+
- name: Checkout code
15+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
16+
1517
- name: Set up Docker Build
1618
uses: docker/setup-buildx-action@v3
1719

.github/workflows/cargo-deny.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: Cargo Deny
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [ main ]
76
pull_request:
87
merge_group:
98

.github/workflows/check-spelling.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: Check Spelling
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [ main ]
76
pull_request:
87
merge_group:
98

.github/workflows/ci.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches:
6-
- main
7-
5+
branches: [ main ]
86
pull_request:
97
merge_group:
108

@@ -19,19 +17,22 @@ jobs:
1917
build_and_test:
2018
runs-on: ubuntu-latest
2119
steps:
22-
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
20+
- name: Checkout
21+
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
2322

2423
- name: Install stable toolchain
2524
uses: actions-rs/toolchain@v1
2625
with:
2726
toolchain: stable
2827
override: true
2928

29+
- name: Install Foundry (for anvil)
30+
uses: foundry-rs/foundry-toolchain@v1
31+
with:
32+
version: nightly
33+
3034
- name: Rust Cache
3135
uses: Swatinem/rust-cache@v2
32-
33-
- name: Install Foundry
34-
uses: foundry-rs/foundry-toolchain@v1
3536

3637
- name: Build project
3738
run: |

.github/workflows/contract-ci.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Contracts CI
2+
permissions:
3+
contents: read
4+
5+
on:
6+
push:
7+
branches: [ main ]
8+
pull_request:
9+
merge_group:
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Use Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
cache: npm
31+
cache-dependency-path: package-lock.json
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Compile (Hardhat)
37+
run: npm run contracts:build
38+
39+
lint:
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v4
45+
46+
- name: Use Node.js
47+
uses: actions/setup-node@v4
48+
with:
49+
node-version: 20
50+
cache: npm
51+
cache-dependency-path: package-lock.json
52+
53+
- name: Install dependencies
54+
run: npm ci
55+
56+
- name: solhint (contracts only)
57+
run: npx solhint --noPoster "contracts/**/*.sol"
58+
59+
- name: prettier (contracts only)
60+
run: npx prettier --plugin=prettier-plugin-solidity --check "contracts/**/*.sol"
61+
62+
#
63+
# Missing test job!
64+
#
65+
66+
slither:
67+
needs: [build]
68+
runs-on: ubuntu-latest
69+
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v4
73+
74+
- name: Use Node.js
75+
uses: actions/setup-node@v4
76+
with:
77+
node-version: 20
78+
cache: npm
79+
80+
- name: Install dependencies
81+
run: npm ci
82+
83+
- name: Setup Python
84+
uses: actions/setup-python@v5
85+
with:
86+
python-version: '3.11'
87+
88+
- name: Install Slither
89+
run: pip install slither-analyzer
90+
91+
- name: Run Slither (compiling through Hardhat)
92+
run: |
93+
slither --config slither.config.json . --compile-force-framework hardhat \
94+
--filter-paths "node_modules|artifacts|cache"

.github/workflows/secrets_scanner.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
name: Leaked Secrets Scan
2+
23
on:
4+
push:
5+
branches: [ main ]
36
pull_request:
47
merge_group:
8+
59
jobs:
610
TruffleHog:
711
runs-on: ubuntu-latest
12+
813
steps:
914
- name: Checkout code
1015
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
1116
with:
1217
fetch-depth: 0
18+
1319
- name: TruffleHog OSS
1420
uses: trufflesecurity/trufflehog@80e8a67c2d863ee8f6563b4e2806c93b8bfd96ea
1521
with:

.solhint.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"extends": "solhint:recommended",
3+
"rules": {
4+
"avoid-call-value": "error",
5+
"avoid-low-level-calls": "off",
6+
"avoid-sha3": "error",
7+
"avoid-tx-origin": "off",
8+
"check-send-result": "error",
9+
"compiler-version": ["error", "^0.8.0"],
10+
"const-name-snakecase": "off",
11+
"contract-name-capwords": "off",
12+
"explicit-types": "error",
13+
"func-name-mixedcase": "off",
14+
"func-named-parameters": ["error", 4],
15+
"func-visibility": ["error", { "ignoreConstructors": true }],
16+
"imports-on-top": "error",
17+
"max-states-count": "off",
18+
"modifier-name-mixedcase": "error",
19+
"named-parameters-mapping": "off",
20+
"no-complex-fallback": "off",
21+
"no-console": "error",
22+
"no-empty-blocks": "off",
23+
"no-global-import": "error",
24+
"no-inline-assembly": "off",
25+
"no-unused-import": "error",
26+
"no-unused-vars": "error",
27+
"not-rely-on-time": "off",
28+
"quotes": "error",
29+
"reason-string": "error",
30+
"reentrancy": "error",
31+
"state-visibility": "error",
32+
"use-forbidden-name": "error",
33+
"var-name-mixedcase": "off",
34+
"visibility-modifier-order": "error"
35+
}
36+
}

0 commit comments

Comments
 (0)