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

fix: N-05 Unnecessary Cast #988

Draft
wants to merge 265 commits into
base: oz-audit-sep-base
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
265 commits
Select commit Hold shift + click to select a range
8109652
fix check hashes
StanislavBreadless Aug 13, 2024
b4b7c03
fix spell
StanislavBreadless Aug 13, 2024
4c4411c
Merge pull request #692 from matter-labs/sb-set-of-fixes-1
StanislavBreadless Aug 13, 2024
2a2e6cf
amend some functions
StanislavBreadless Aug 14, 2024
9f6d439
make scripts work
StanislavBreadless Aug 14, 2024
576a59c
fmt
StanislavBreadless Aug 14, 2024
779c707
fix lint
StanislavBreadless Aug 14, 2024
8534b30
Merge pull request #697 from matter-labs/sb-synced-sync-layer-reorg
StanislavBreadless Aug 14, 2024
50c633c
Kl/l2 bridge fixes (#687)
kelemeno Aug 14, 2024
4fec3c1
Merge branch 'kl/sync-layer-reorg' of ssh://github.com/matter-labs/er…
kelemeno Aug 14, 2024
fd4aebc
fix: zksync-ethers v5 dependency (#702)
benceharomi Aug 15, 2024
f1a8c2d
Kl/stmdt counterpart fix EVM-701 (#693)
kelemeno Aug 15, 2024
df1c5c8
fix: move hyperchain mapping EVM-709 (#704)
kelemeno Aug 16, 2024
acd603a
bridgehub small fixes, some cleanup
kelemeno Aug 16, 2024
ad92d47
Merge branch 'kl/sync-layer-reorg' of ssh://github.com/matter-labs/er…
kelemeno Aug 16, 2024
7d4b79c
fix: EVM-708 bridge fixes (#703)
kelemeno Aug 16, 2024
4c82e7d
Limitations for the l2 migrated chain (#707)
StanislavBreadless Aug 16, 2024
6d0ceb9
small fixes
kelemeno Aug 16, 2024
a738dc8
Merge branch 'kl/sync-layer-reorg' of ssh://github.com/matter-labs/er…
kelemeno Aug 16, 2024
c168183
more fixes
kelemeno Aug 16, 2024
a9a4646
typo
kelemeno Aug 16, 2024
ff10238
Stas issues
kelemeno Aug 16, 2024
d4bb8c5
removed unsued function + some changes
StanislavBreadless Aug 16, 2024
2a22e23
fixes
kelemeno Aug 16, 2024
590d207
fix some legacy methods
StanislavBreadless Aug 17, 2024
83cd458
fmt
StanislavBreadless Aug 17, 2024
42e7e0a
additional changes
StanislavBreadless Aug 18, 2024
aff1f4e
fmt
StanislavBreadless Aug 18, 2024
8099c0e
commented out code
StanislavBreadless Aug 19, 2024
ce27e0b
lint fix
StanislavBreadless Aug 19, 2024
ec64d85
should work
StanislavBreadless Aug 19, 2024
ea24b02
move some methods around
StanislavBreadless Aug 19, 2024
e58a3ee
fmt
StanislavBreadless Aug 19, 2024
d0a4401
remove useless change
StanislavBreadless Aug 19, 2024
ade586e
codespell
StanislavBreadless Aug 19, 2024
9e52539
router
StanislavBreadless Aug 19, 2024
8e59135
upd some files
StanislavBreadless Aug 19, 2024
859eed8
fix tests
StanislavBreadless Aug 19, 2024
568d65c
Merge remote-tracking branch 'origin/sb-sync-layer-reorg-stable-sync-…
StanislavBreadless Aug 19, 2024
a94a1b1
fmt
StanislavBreadless Aug 19, 2024
e7865bc
Merge pull request #712 from matter-labs/sb-sync-layer-reorg-stable-s…
StanislavBreadless Aug 19, 2024
9ebe7aa
fix lint
StanislavBreadless Aug 19, 2024
f105566
fix sys contracts tests
StanislavBreadless Aug 19, 2024
0640579
lint
StanislavBreadless Aug 19, 2024
ad726f7
fix
StanislavBreadless Aug 19, 2024
fa16bcb
fix
StanislavBreadless Aug 19, 2024
d50bf31
Merge pull request #714 from matter-labs/sb-fix-sl-stable
StanislavBreadless Aug 19, 2024
6a5dada
Merge branch 'sync-layer-stable' into sb-reduce-owner-footprint-on-ge…
StanislavBreadless Aug 19, 2024
1b8393b
fix check hashes
StanislavBreadless Aug 20, 2024
3de3430
Remove Base Token Address from Chain Registration (#700)
Raid5594 Aug 20, 2024
a91bc7a
Merge pull request #711 from matter-labs/sb-reduce-owner-footprint-on…
StanislavBreadless Aug 20, 2024
5853c3a
feat(consensus): add L2 registry contract (BFT-434) (#555) (#718)
pompon0 Aug 20, 2024
8f4aad4
Merge pull request #719 from matter-labs/sync-layer-stable
StanislavBreadless Aug 20, 2024
9b24cce
merge dev into the kl sync layer reorg
StanislavBreadless Aug 20, 2024
66e8494
fix sc build
StanislavBreadless Aug 20, 2024
47495d1
fix some lints
StanislavBreadless Aug 20, 2024
def5d47
fix lint
StanislavBreadless Aug 20, 2024
336e40c
Merge pull request #721 from matter-labs/sb-merge-dev-kl-reorg
StanislavBreadless Aug 20, 2024
fb536f2
fix chainRegistered
kelemeno Aug 20, 2024
21a10e0
gw fixes
StanislavBreadless Aug 20, 2024
86d2cc0
script fixes
kelemeno Aug 20, 2024
092d198
local zk fmt breaks...
kelemeno Aug 20, 2024
ed036a2
fmt
StanislavBreadless Aug 21, 2024
792d059
fix comment
StanislavBreadless Aug 21, 2024
7ef7a6d
fmt
StanislavBreadless Aug 21, 2024
739fabb
some contract fixes
kelemeno Aug 21, 2024
d7928ba
commented out code
kelemeno Aug 21, 2024
8b45eff
some more fixes
kelemeno Aug 21, 2024
95f5085
forgot await
kelemeno Aug 21, 2024
4d5cdc9
undo getL1ChainId, its async
kelemeno Aug 21, 2024
c1675c3
fix tests
StanislavBreadless Aug 21, 2024
96fa8e4
wip
StanislavBreadless Aug 21, 2024
c7b7123
foundry test fixes
kelemeno Aug 21, 2024
1e13d50
add a getAssetId function
kelemeno Aug 21, 2024
e7442e6
Merge pull request #725 from matter-labs/sb-some-gw-messaing-fixes
StanislavBreadless Aug 21, 2024
d29195b
first round of conflict resolution
StanislavBreadless Aug 21, 2024
9e19b5a
system contracts compile
StanislavBreadless Aug 21, 2024
a7a10ae
l2 contracts compile
StanislavBreadless Aug 21, 2024
ad7c0ad
Stas issue fixes
kelemeno Aug 21, 2024
d31866a
Merge branch 'kl/sync-layer-reorg' of ssh://github.com/matter-labs/er…
kelemeno Aug 21, 2024
3274507
fix remappings
Deniallugo Aug 21, 2024
37245fa
foundry test and small fixes
kelemeno Aug 21, 2024
a7e3d0a
linting
kelemeno Aug 21, 2024
daf396e
make l1 contracts compile
StanislavBreadless Aug 21, 2024
a59077c
script fix
kelemeno Aug 21, 2024
1d62e8e
foundry test are running
StanislavBreadless Aug 21, 2024
8a2d7c8
Merge branch 'kl/script-fixes' of ssh://github.com/matter-labs/era-co…
kelemeno Aug 21, 2024
391fa4d
fix: script fixes (#726)
kelemeno Aug 21, 2024
70a0660
Merge branch 'sync-layer-stable' of ssh://github.com/matter-labs/era-…
kelemeno Aug 21, 2024
2b2af24
foundry tests pass (though some were commented out)
StanislavBreadless Aug 21, 2024
d1b5149
Merge branch 'sync-layer-stable' of ssh://github.com/matter-labs/era-…
kelemeno Aug 21, 2024
00f7d8e
partial l1 test fix
StanislavBreadless Aug 21, 2024
446d391
Add admin role to shared bridge (#727)
StanislavBreadless Aug 21, 2024
94b2646
chore: Kl/merge-stable (#730)
kelemeno Aug 21, 2024
5ec24e2
Kl/merge-stable2 (#731)
kelemeno Aug 21, 2024
8421abc
forceDeploymetns data
kelemeno Aug 21, 2024
095a55a
bad merge
StanislavBreadless Aug 22, 2024
4e084b7
merge kl reorg branch
StanislavBreadless Aug 22, 2024
ab605b2
foundry tests pass
StanislavBreadless Aug 22, 2024
9e0c329
make more tests pass
StanislavBreadless Aug 22, 2024
377d0aa
fmt
StanislavBreadless Aug 22, 2024
9a168a6
Merge branch 'kl/sync-layer-reorg-dev' into kl/sync-layer-reorg-foundry
StanislavBreadless Aug 22, 2024
a80a667
message root fix
kelemeno Aug 22, 2024
4255c63
renaming and some fixes
kelemeno Aug 22, 2024
51d5dc4
lint
kelemeno Aug 22, 2024
f741346
wip
StanislavBreadless Aug 22, 2024
f617301
erc20 tests in foundry work
StanislavBreadless Aug 22, 2024
0d7ee23
aggregated root return value
kelemeno Aug 22, 2024
d2f83db
cover most of weth tsts
StanislavBreadless Aug 22, 2024
ebfb6d2
port the rest of the tests
StanislavBreadless Aug 22, 2024
c90c9f6
remove old tests
StanislavBreadless Aug 23, 2024
3c1b796
old proof support
StanislavBreadless Aug 23, 2024
6225350
unit tests
StanislavBreadless Aug 23, 2024
5e1ada2
fix lint
StanislavBreadless Aug 23, 2024
774ef90
fix comment
StanislavBreadless Aug 23, 2024
7931924
Merge pull request #736 from matter-labs/sb-support-old-proving-format
StanislavBreadless Aug 26, 2024
a4a2b06
add a few events for migration
StanislavBreadless Aug 26, 2024
e05866e
ensure that the STM has to be whitelisted before it is used
StanislavBreadless Aug 26, 2024
18f66ba
some fixes
StanislavBreadless Aug 26, 2024
7c8ef21
fix lint
StanislavBreadless Aug 26, 2024
9a3b546
rename event
StanislavBreadless Aug 26, 2024
b6d6c47
lint
StanislavBreadless Aug 26, 2024
e5b44c6
remove unused methods from validator timelock and executor
StanislavBreadless Aug 26, 2024
a478e2e
some more fixes
StanislavBreadless Aug 26, 2024
823ef65
Merge remote-tracking branch 'origin/sb-set-of-fixes-2' into sb-set-o…
StanislavBreadless Aug 26, 2024
3f17ff8
fix compile
StanislavBreadless Aug 26, 2024
caf4192
fix some more stuff
StanislavBreadless Aug 26, 2024
ae9add5
lint
StanislavBreadless Aug 26, 2024
dc1da58
migrate tests
StanislavBreadless Aug 26, 2024
60b7fc4
lint fix
StanislavBreadless Aug 26, 2024
2071f78
test
StanislavBreadless Aug 26, 2024
d5ecc4a
fmt
StanislavBreadless Aug 26, 2024
075eed8
Merge pull request #737 from matter-labs/sb-set-of-fixes-2
StanislavBreadless Aug 27, 2024
3a4fc67
make scripts work with the server
StanislavBreadless Aug 27, 2024
5cb5a03
sync with sync-layer-stable
StanislavBreadless Aug 27, 2024
d273ebf
fmt
StanislavBreadless Aug 27, 2024
95c501b
Merge pull request #744 from matter-labs/sb-port-kl/sync-layer-reorg
StanislavBreadless Aug 27, 2024
709bd86
Merge pull request #746 from matter-labs/sync-layer-stable
StanislavBreadless Aug 27, 2024
c82a950
sync with dev
StanislavBreadless Aug 28, 2024
7bcf8ac
sync with kl/sync-layer-reorg
StanislavBreadless Aug 28, 2024
a102e75
fix l1 tests
StanislavBreadless Aug 28, 2024
1dfc1ef
fmt
StanislavBreadless Aug 28, 2024
ad046e0
most of lints
StanislavBreadless Aug 28, 2024
4ac4e01
tmp: submodules work
StanislavBreadless Aug 28, 2024
d77b6a8
remove forge std
StanislavBreadless Aug 28, 2024
60935d3
remove l1-contracts/lib/murky
StanislavBreadless Aug 28, 2024
2c03a8d
remove mode subdmoules
StanislavBreadless Aug 28, 2024
f3e83dd
fix unit tests
StanislavBreadless Aug 28, 2024
8b025a4
fmt
StanislavBreadless Aug 28, 2024
60a1f7b
fix ci
StanislavBreadless Aug 28, 2024
f3a9481
fix spelling
StanislavBreadless Aug 28, 2024
fa4baf0
check hashes
StanislavBreadless Aug 28, 2024
6fa9393
better compare
StanislavBreadless Aug 28, 2024
8632559
correct address
StanislavBreadless Aug 28, 2024
2d92a68
comments
StanislavBreadless Aug 28, 2024
277d61d
fix addr
StanislavBreadless Aug 28, 2024
955979c
lint
StanislavBreadless Aug 28, 2024
10ec8ba
Merge pull request #749 from matter-labs/kl/sync-layer-reorg-dev
StanislavBreadless Aug 28, 2024
ac415e2
Merge pull request #753 from matter-labs/kl/sync-layer-reorg
StanislavBreadless Aug 28, 2024
03644e6
Merge branch 'kl/sync-layer-reorg' into kl/sync-layer-reorg-foundry
StanislavBreadless Aug 29, 2024
a557c01
upd workflow
StanislavBreadless Aug 29, 2024
487dd71
forge install: v2-testnet-contracts
StanislavBreadless Aug 29, 2024
4bac7cb
wip
StanislavBreadless Aug 29, 2024
1a2390c
forge install: @matterlabs/zksync-contracts
StanislavBreadless Aug 29, 2024
2d9ad08
using foundry deps
StanislavBreadless Aug 29, 2024
bc54d47
remove unneeded changes
StanislavBreadless Aug 29, 2024
e4689f0
wip
StanislavBreadless Aug 29, 2024
0a5e318
fix typo
StanislavBreadless Aug 29, 2024
6775587
install foundry zksync in ci
StanislavBreadless Aug 29, 2024
12cb8d0
fix lint
StanislavBreadless Aug 29, 2024
db7eafb
more efficient forge install
StanislavBreadless Aug 29, 2024
e70b722
fmt
StanislavBreadless Aug 29, 2024
e572c91
compile sc contracts also
StanislavBreadless Aug 29, 2024
dfd969c
Merge pull request #755 from matter-labs/kl/sync-layer-reorg-foundry
StanislavBreadless Aug 29, 2024
c905dd3
sync with stable
StanislavBreadless Aug 29, 2024
f17d7e1
Merge branch 'kl/sync-layer-reorg' into kl/migrate-back-from-gw
StanislavBreadless Aug 29, 2024
8affc3c
fix compile
StanislavBreadless Aug 29, 2024
adc2e76
Merge pull request #706 from matter-labs/kl/migrate-back-from-gw
StanislavBreadless Aug 29, 2024
3301a13
add ability to recover from failed migration (#715)
koloz193 Aug 29, 2024
de2cca7
sync with stable
StanislavBreadless Aug 29, 2024
464382e
fix compile
StanislavBreadless Aug 29, 2024
c05daf6
Fixed yarn clean - to remove zksync artifacts too
mm-zk Aug 30, 2024
262ee7e
Merge pull request #759 from matter-labs/mmzk_0830_fix_cleanup
StanislavBreadless Aug 30, 2024
989f2c1
L2 verifier support (#756)
StanislavBreadless Aug 30, 2024
d669a5f
Merge pull request #758 from matter-labs/sb-sync-sync-layer-stable
StanislavBreadless Aug 30, 2024
b212535
sync with kl sync layer reorg
StanislavBreadless Aug 30, 2024
840df35
fix comile
StanislavBreadless Aug 30, 2024
9fa2d66
fix lint
StanislavBreadless Aug 30, 2024
f469e7c
fix script
StanislavBreadless Aug 30, 2024
9d319e7
Merge branch 'sync-layer-stable' into kl/message-root-update
StanislavBreadless Aug 30, 2024
73ddd6d
Merge pull request #724 from matter-labs/kl/message-root-update
StanislavBreadless Aug 30, 2024
d368769
feat: Deploy ConsensusRegistry through L1 to L2 transaction (BFT-504)…
aakoshh Sep 2, 2024
3a1aecc
Fix token info upon migration (#760)
StanislavBreadless Sep 2, 2024
7f2c27a
Small PR to Fix "Ethers" and "ETH" encoding (#762)
Raid5594 Sep 3, 2024
78b0ce8
STM -> CTM
StanislavBreadless Sep 4, 2024
213f990
chore: Kl/merge-dev-sync-layer-stable (#763)
kelemeno Sep 4, 2024
249e012
Merge branch 'kl/sync-layer-reorg' into sb-rename-stm
StanislavBreadless Sep 4, 2024
28aadaa
migrate in script files as well
StanislavBreadless Sep 4, 2024
e8d47b4
l1 foundry test work
StanislavBreadless Sep 4, 2024
ae911bb
fix ts tests
StanislavBreadless Sep 4, 2024
b23bf7c
lint
StanislavBreadless Sep 4, 2024
566a54b
Resolve some of the leftover todos (#765)
StanislavBreadless Sep 5, 2024
9d1ce13
fix lib to remove it from coverage report
StanislavBreadless Sep 5, 2024
6fff2b1
sync with base
StanislavBreadless Sep 5, 2024
af14533
recalc hashes
StanislavBreadless Sep 5, 2024
aab2f77
toml file
StanislavBreadless Sep 5, 2024
3d6e02f
Set foundry optimizer_runs (#770)
perekopskiy Sep 5, 2024
42933cd
Merge pull request #766 from matter-labs/sb-rename-stm
StanislavBreadless Sep 5, 2024
4a062d0
Rename hyperchain -> ZK chain (#771)
StanislavBreadless Sep 5, 2024
8b5b296
Implement restriction to allow limiting chain admin in power (#699)
StanislavBreadless Sep 5, 2024
c95f623
sync with dev
StanislavBreadless Sep 6, 2024
93ed4dc
fix l1 compile
StanislavBreadless Sep 6, 2024
265166b
fix l1 foundry tests
StanislavBreadless Sep 6, 2024
1a23102
fix l2 compile
StanislavBreadless Sep 6, 2024
bd438c5
fix lint
StanislavBreadless Sep 6, 2024
99e9a0a
hopefully fix ci
StanislavBreadless Sep 6, 2024
2929483
hopefully fix ci 2
StanislavBreadless Sep 6, 2024
a1705ab
delete duplicated contract
StanislavBreadless Sep 6, 2024
6892ccc
Add admin permission to add custom base tokens (#776)
vladbochok Sep 6, 2024
b6c7130
merge main into dev
StanislavBreadless Sep 6, 2024
0fa0fa2
foundry tests pass
StanislavBreadless Sep 6, 2024
00ddc06
fix compile for registry
StanislavBreadless Sep 6, 2024
b6766b0
Merge pull request #777 from matter-labs/sb-merge-dev-kl-sync-layer-r…
StanislavBreadless Sep 6, 2024
ef33539
lint
StanislavBreadless Sep 6, 2024
dccc114
Remove most info from relayed L1->GW priority ops (#775)
StanislavBreadless Sep 6, 2024
b653ac8
Merge pull request #778 from matter-labs/sb-merge-main-to-dev
StanislavBreadless Sep 6, 2024
cb3c177
sync with reorg
StanislavBreadless Sep 6, 2024
23f5e3c
fmt
StanislavBreadless Sep 6, 2024
cb42ae4
Merge pull request #779 from matter-labs/sb-sync-reorg-with-stable
StanislavBreadless Sep 6, 2024
49868af
Change Executor.sol interface (#780)
vladbochok Sep 9, 2024
bebdefc
(feat): add tx filterer contract (#772)
Raid5594 Sep 10, 2024
f95beef
Ra/split asset router (#595)
Raid5594 Sep 10, 2024
8479868
chore: merge stable (#785)
kelemeno Sep 10, 2024
d1b7e16
Update l1-contracts/contracts/bridge/L1Nullifier.sol
kelemeno Sep 10, 2024
e741471
Update l1-contracts/contracts/bridge/asset-router/IL1AssetRouter.sol
kelemeno Sep 10, 2024
a42b991
fix: vlad issues (#788)
kelemeno Sep 10, 2024
2508f36
Recover some tests (#789)
StanislavBreadless Sep 10, 2024
b3564ef
Kl/chain balance fix (#786)
kelemeno Sep 10, 2024
1404dc0
Merge branch 'dev' of ssh://github.com/matter-labs/era-contracts into…
kelemeno Sep 10, 2024
cc3b2ac
chore: merge main (#790)
kelemeno Sep 10, 2024
8155711
Merge branch 'dev' of ssh://github.com/matter-labs/era-contracts into…
kelemeno Sep 10, 2024
c0d45fa
test fixes
kelemeno Sep 10, 2024
6de2963
Merge pull request #791 from matter-labs/kl/merge-dev
StanislavBreadless Sep 10, 2024
07d0462
Fixes (#792)
vladbochok Sep 11, 2024
1673186
sync head with base
StanislavBreadless Sep 11, 2024
eb3583a
delete unneeded files
StanislavBreadless Sep 11, 2024
e5727a0
Sync audit head with base (#797)
StanislavBreadless Sep 11, 2024
ef318e2
Merge pull request #798 from matter-labs/sb-sync-head-base
StanislavBreadless Sep 11, 2024
8208402
Better governance protection (audit) (#822)
StanislavBreadless Sep 26, 2024
fcec3d3
fix: N-05 Unnecessary Cast
kelemeno Oct 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
91 changes: 86 additions & 5 deletions .github/workflows/l1-contracts-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,33 @@ jobs:
- name: Install dependencies
run: yarn

- name: Build artifacts
run: yarn l1 build
- name: Install l2 deps
working-directory: ./l2-contracts
run: yarn

- name: Install l1 deps
working-directory: ./l1-contracts
run: yarn

- name: Build L2 artifacts
- name: Build l2 artifacts
run: yarn l2 build

- name: Build l1 artifacts
run: yarn l1 build

- name: Create cache
uses: actions/cache/save@v3
with:
key: artifacts-l1-${{ github.sha }}
path: |
l1-contracts/artifacts
l1-contracts/artifacts-zk
l1-contracts/cache
l1-contracts/typechain
l2-contracts/artifacts-zk
l2-contracts/cache-zk
l2-contracts/typechain
l1-contracts/lib

lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -91,11 +101,68 @@ jobs:
key: artifacts-l1-${{ github.sha }}
path: |
l1-contracts/artifacts
l1-contracts/artifacts-zk
l1-contracts/cache
l1-contracts/typechain
l2-contracts/artifacts-zk
l2-contracts/cache-zk
l2-contracts/typechain
l1-contracts/lib

- name: Run tests
working-directory: ./l1-contracts
run: FOUNDRY_PROFILE=default yarn test:foundry

test-foundry-zksync:
needs: [build, lint]
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
cache: yarn

- name: Install dependencies
run: yarn

- name: Build system contract artifacts
run: yarn sc build

- name: Restore artifacts cache
uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
key: artifacts-l1-${{ github.sha }}
path: |
l1-contracts/artifacts
l1-contracts/artifacts-zk
l1-contracts/cache
l1-contracts/typechain
l2-contracts/artifacts-zk
l2-contracts/cache-zk
l2-contracts/typechain
l1-contracts/lib

- name: Install foundry zksync
run: |
wget https://github.com/matter-labs/foundry-zksync/releases/download/nightly-f908ce43834bc1ffb4de6576ea5600eaab49dddb/foundry_nightly_linux_amd64.tar.gz -O foundry-zksync.tar.gz
tar -xzf foundry-zksync.tar.gz
sudo mv forge /usr/local/bin/forge
sudo mv cast /usr/local/bin/cast
sudo chmod +x /usr/local/bin/forge
sudo chmod +x /usr/local/bin/cast
forge --version

- name: Run tests
run: yarn l1 test:foundry
working-directory: ./l1-contracts
run: FOUNDRY_PROFILE=default yarn test:zkfoundry

test-hardhat:
needs: [build, lint]
Expand All @@ -114,23 +181,32 @@ jobs:
- name: Install dependencies
run: yarn

- name: Install l1 deps
working-directory: ./l1-contracts
run: yarn

- name: Restore artifacts cache
uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
key: artifacts-l1-${{ github.sha }}
path: |
l1-contracts/artifacts
l1-contracts/artifacts-zk
l1-contracts/cache
l1-contracts/typechain
l2-contracts/artifacts-zk
l2-contracts/cache-zk
l2-contracts/typechain
l1-contracts/lib

- name: Build L2 contracts
run: yarn l2 build

- name: Run tests
run: yarn l1 test --no-compile

check-verifier-generator:
check-verifier-generator-l1:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -183,8 +259,13 @@ jobs:
key: artifacts-l1-${{ github.sha }}
path: |
l1-contracts/artifacts
l1-contracts/artifacts-zk
l1-contracts/cache
l1-contracts/typechain
l2-contracts/artifacts-zk
l2-contracts/cache-zk
l2-contracts/typechain
l1-contracts/lib

- name: Run coverage
run: FOUNDRY_PROFILE=default yarn test:foundry && FOUNDRY_PROFILE=default yarn coverage:foundry --report summary --report lcov
Expand Down
129 changes: 129 additions & 0 deletions .github/workflows/l1-contracts-foundry-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: L1 contracts foundry CI

env:
ANVIL_PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
ANVIL_RPC_URL: "http://127.0.0.1:8545"

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: true

- name: Use Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18.18.0
cache: yarn

- name: Install dependencies
run: yarn

- name: Build hardhat artifacts
run: yarn l1 build

- name: Build artifacts
working-directory: ./l1-contracts
run: forge build

- name: Build system-contract artifacts
run: yarn sc build

- name: Build l2 artifacts
run: yarn l2 build

- name: Create cache
uses: actions/cache/save@v3
with:
key: artifacts-l1-contracts-foudry-${{ github.sha }}
path: |
l1-contracts/cache
l1-contracts/out
l1-contracts/artifacts-zk
l2-contracts/artifacts-zk
l2-contracts/cache-zk
system-contracts/artifacts-zk
system-contracts/bootloader/build
system-contracts/cache-zk
system-contracts/contracts-preprocessed
system-contracts/typechain

scripts:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: true

- name: Restore artifacts cache
uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
key: artifacts-l1-contracts-foudry-${{ github.sha }}
path: |
l1-contracts/cache
l1-contracts/out
l1-contracts/artifacts-zk
l2-contracts/artifacts-zk
l2-contracts/cache-zk
system-contracts/artifacts-zk
system-contracts/bootloader/build
system-contracts/cache-zk
system-contracts/contracts-preprocessed
system-contracts/typechain

- name: Use Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Copy configs from template
working-directory: ./l1-contracts
run: cp -r deploy-script-config-template/. script-config

- name: Run anvil
run: |
anvil --silent &

ANVIL_READY=0
for i in {1..10}; do
if curl -s -o /dev/null $ANVIL_RPC_URL -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_chainId","id":1}'; then
echo "Anvil is ready"
ANVIL_READY=1
break
else
echo "Waiting for Anvil to become ready..."
sleep 1
fi
done

if [ $ANVIL_READY -ne 1 ]; then
echo "Anvil failed to become ready after 10 attempts."
exit 1
fi

- name: Run DeployL1 script
working-directory: ./l1-contracts
run: forge script ./deploy-scripts/DeployL1.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY

- name: Run DeployErc20 script
working-directory: ./l1-contracts
run: forge script ./deploy-scripts/DeployErc20.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY
# TODO restore scripts verification
# - name: Run RegisterZKChain script
# working-directory: ./l1-contracts
# run: |
# cat ./script-out/output-deploy-l1.toml >> ./script-config/register-zk-chain.toml
# forge script ./deploy-scripts/RegisterZKChain.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY
# - name: Run InitializeL2WethToken script
# working-directory: ./l1-contracts-foundry
# run: forge script ./deploy-scripts/InitializeL2WethToken.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY
44 changes: 37 additions & 7 deletions .github/workflows/l2-contracts-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
- name: Build L2 artifacts
run: yarn l2 build

- name: Build system contract artifacts
run: yarn sc build

- name: Create cache
uses: actions/cache/save@v3
with:
Expand All @@ -37,6 +40,9 @@ jobs:
l2-contracts/artifacts-zk
l2-contracts/cache-zk
l2-contracts/typechain
system-contracts/artifacts-zk
system-contracts/cache-zk
system-contracts/typechain

lint:
runs-on: ubuntu-latest
Expand All @@ -57,6 +63,23 @@ jobs:
- name: Lint
run: yarn lint:check

check-verifier-generator-l2:
needs: [build]
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Generate Verifier.sol
working-directory: tools
run: cargo run --bin zksync_verifier_contract_generator --release -- --input_path data/scheduler_key.json --l2_mode

- name: Compare
run: diff tools/data/Verifier.sol l2-contracts/contracts/verifier/Verifier.sol

test:
needs: [build, lint]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -88,12 +111,19 @@ jobs:
l2-contracts/artifacts-zk
l2-contracts/cache-zk
l2-contracts/typechain

- name: Run Era test node
uses: dutterbutter/[email protected]

- name: Copy typechain from System Contracts
run: yarn sc build && yarn sc copy:typechain
system-contracts/artifacts-zk
system-contracts/cache-zk
system-contracts/typechain

- name: Install foundry zksync
run: |
wget https://github.com/matter-labs/foundry-zksync/releases/download/nightly-f908ce43834bc1ffb4de6576ea5600eaab49dddb/foundry_nightly_linux_amd64.tar.gz -O foundry-zksync.tar.gz
tar -xzf foundry-zksync.tar.gz
sudo mv forge /usr/local/bin/forge
sudo mv cast /usr/local/bin/cast
sudo chmod +x /usr/local/bin/forge
sudo chmod +x /usr/local/bin/cast
forge --version

- name: Run tests
run: yarn l2 test
run: yarn l2 test:foundry
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ l1-contracts/lcov.info
l1-contracts/report/*
l1-contracts/coverage/*
l1-contracts/out/*
l1-contracts/zkout/*
l1-contracts/broadcast/*
l1-contracts/script-config/*
!l1-contracts/script-config/artifacts
l1-contracts/script-out/*
l1-contracts/test/foundry/integration/deploy-scripts/script-out/*.toml
l1-contracts/test/foundry/l1/integration/deploy-scripts/script-out/*.toml
!l1-contracts/script-out/.gitkeep
*.timestamp
l1-contracts/test/foundry/l1/integration/deploy-scripts/script-out/*
l1-contracts/zkout/*
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/@matterlabs/zksync-contracts"]
path = lib/@matterlabs/zksync-contracts
url = https://github.com/matter-labs/v2-testnet-contracts
2 changes: 2 additions & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ l1-contracts/lib
l1-contracts/node_modules
l1-contracts/contracts/dev-contracts
l1-contracts/test
l1-contracts/deploy-scripts

# l1-contracts-foundry
l1-contracts-foundry/cache
Expand All @@ -16,6 +17,7 @@ l1-contracts-foundry/lib
# l2-contracts
l2-contracts/cache-zk
l2-contracts/node_modules
l2-contracts/test

# system-contracts
system-contracts/contracts/openzeppelin
Expand Down
Loading
Loading