├── .gitignore
├── README.md
├── discord-export
├── Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html
├── Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files
│ ├── 02410a37de8a54f8cfb7a8842a2dd162-6E861.png
│ ├── 031b7a5f3d262cf2bc59a7a43169a769-A5E43.png
│ ├── 0ab6fddedfdca4dee0b54ab41ab4faad-C5611.png
│ ├── 0e5b3c84382435322161f927b720d8f6-770EF.png
│ ├── 1-B2132.png
│ ├── 1080667809002037320-8957D.png
│ ├── 14de4baac237519f8fc9dd37972f2c0e-20FC2.png
│ ├── 17fbc1db84dd48e50a84a75ab2dd3d00-A5EF0.png
│ ├── 18d5019615e942cceb72e45de2354bec-4A3FE.png
│ ├── 1bccbffbd30b7914bab52ee02706ffeb-9A706.png
│ ├── 1f389-5C738.svg
│ ├── 1f3c1-445DC.svg
│ ├── 1f3c6-621A1.svg
│ ├── 1f43a-EB486.svg
│ ├── 1f440-6C64D.svg
│ ├── 1f446-9CC34.svg
│ ├── 1f44b-8A059.svg
│ ├── 1f44d-1f3fb-ED2AA.svg
│ ├── 1f44d-1f3fe-78CB5.svg
│ ├── 1f44d-27259.svg
│ ├── 1f44f-3D381.svg
│ ├── 1f48e-0F688.svg
│ ├── 1f494-B74A3.svg
│ ├── 1f4aa-2FD27.svg
│ ├── 1f4af-4CFF5.svg
│ ├── 1f4b8-E3468.svg
│ ├── 1f4c6-44E30.svg
│ ├── 1f4dc-AC641.svg
│ ├── 1f50d-195C0.svg
│ ├── 1f525-8FE4F.svg
│ ├── 1f5ff-D6B6E.svg
│ ├── 1f601-4E9BD.svg
│ ├── 1f602-168C5.svg
│ ├── 1f604-BF863.svg
│ ├── 1f605-42B43.svg
│ ├── 1f606-BE94E.svg
│ ├── 1f618-0EA37.svg
│ ├── 1f626-91074.svg
│ ├── 1f630-F7D34.svg
│ ├── 1f642-83E8A.svg
│ ├── 1f64c-7C820.svg
│ ├── 1f64f-22B8D.svg
│ ├── 1f680-A35CE.svg
│ ├── 1f6a8-A8AB3.svg
│ ├── 1f911-F346C.svg
│ ├── 1f91d-5A0F2.svg
│ ├── 1f92f-FF4E0.svg
│ ├── 1f972-F415D.svg
│ ├── 1f979-BE2CD.svg
│ ├── 1f9d0-3E117.svg
│ ├── 1f9d1-5BC80.svg
│ ├── 1f9e0-EF3BF.svg
│ ├── 1faa6-9DAF4.svg
│ ├── 1fae1-B19DE.svg
│ ├── 2-ADBB4.png
│ ├── 2459f37b83d8af0c2a702e3f7c762f19-54484.png
│ ├── 2696-15F4A.svg
│ ├── 2705-0589F.svg
│ ├── 2764-A3D25.svg
│ ├── 2af0f89843ae811fe0fe7dff2f3003f9-BF362.png
│ ├── 2fb2550eac09d68c70c3cd8bc6422685-2C13A.png
│ ├── 30024f2eab00f1f2f2caee60d2b320a7-40E01.png
│ ├── 310bb104d49148a05def03fa039fef92-95023.png
│ ├── 34807a544df04d136d013fdd0b743601-7992D.png
│ ├── 394983eda2eb8faf909901fe09d16b4b-3AEDC.png
│ ├── 3b01c38b7c5b905fd8e8a1d72f7d7492-6DE9E.png
│ ├── 4-4551A.png
│ ├── 4606dd32813fe3c1549babda035fafab-74B15.png
│ ├── 4bd2854eafa7ab11aaec46b1f54a1214-5EF97.png
│ ├── 5-E9BDB.png
│ ├── 531790526316281858-DD032.png
│ ├── 55afac51a32db1ff015fd3a7d901e67a-52D14.png
│ ├── 568d22b97293cdd2d9b7006198d6adbc-9738F.png
│ ├── 589e8711bf28e89b473383d271f8f90e-E96A1.png
│ ├── 5b2500cadb4af88b0fe342af9ae1ccd8-56513.png
│ ├── 67077645d7418d196b2b4b1802b0e371-77A61.png
│ ├── 67594ee4b4d1fc03bca468327a0d145b-0C614.png
│ ├── 6a00e12240ed2ee2b1768b577982163b-38155.png
│ ├── 6a567cbfd6039038b3e7fb3b7b3c7185-B7C28.png
│ ├── 6e53c2d72f93e345a64684197d266a06-4C577.png
│ ├── 740859894781050890-F9E9A.gif
│ ├── 759f8cc5f5d3a90e11a0003e003aec16-8D7BB.png
│ ├── 766c2260e6dcca9d711b68a59c71905f-C9DA4.png
│ ├── 7f23866cb01c87dff6692a91ddc5c586-87C3A.png
│ ├── 7fcd80e4d3c60a600235b03c75f682a9-75033.png
│ ├── 82287b4212a9854e5730462bd70677ae-68341.png
│ ├── 851893826846457866-1AD3D.png
│ ├── 851893827027075142-F23DF.png
│ ├── 851893827035725825-8ED59.png
│ ├── 851893827089727568-5FD38.png
│ ├── 851893827127214090-56B72.png
│ ├── 851893827278602280-FABCC.png
│ ├── 851893827315826708-F59C0.png
│ ├── 851893827442442280-31B9F.png
│ ├── 851893827706028033-9A97C.png
│ ├── 85d61d139688e186c36a085fbe06f01e-B1208.png
│ ├── 8646f8b4f073429bf27df27459ab18a2-B1058.png
│ ├── 8de58e44-43b0-47d8-b4de-25edc32c396e-03B44
│ ├── 910676187288846397-518CD.png
│ ├── 941541115469914182-6C118.gif
│ ├── 955fc79ed2bc03b7352e542e305c44bc-7DA40.png
│ ├── 970d2e2f00cd7ef2134a1a3f21326349-B9EEF.png
│ ├── 974453250864611368-838C9.gif
│ ├── 977133670429261884-CA8EA.png
│ ├── 9bf2181404e658cab4039c07df56213f-EC9DE.png
│ ├── King_Neptune_Burger_Competition_1612202200-F9502.jpg
│ ├── aa461341be1da6fac15265c060b60a0a-D2152.png
│ ├── aba7f6b23cd80ec9e8655016ce6ef443-929E9.png
│ ├── ae70f07a06c1c7e983291bb14a1bed7f-4031E.png
│ ├── awesome-zero-knowledge-proofs-1D92D
│ ├── b09e7eca097f157b7360547c8cf2f648-DE955.png
│ ├── b927333187591defbadd1e91f7801db0-A96BB.png
│ ├── bf8b223b536a4efab3ae0bc8171660a3-4574C.png
│ ├── bugs-bunny-looney-tunes-BD3E0.mp4
│ ├── c9cb30134c634c9e02d0c64df4922803-1AAF2.png
│ ├── cb23e87e4eb33d228ed3294f90188951-D6A20.png
│ ├── d717a248a569977603050bbb038adae3-65F7E.png
│ ├── d7e24e0994d277993ed07845cac9ca8b-E4084.png
│ ├── dbb23f1b47ba649fff61ec62493dd61b-A9702.png
│ ├── e2171069b4b213c910837760d8ad5ae4-1519E.png
│ ├── e3a8d3db1e475ec1174f03d3b27eac95-32B40.png
│ ├── e3d596e686b33b7c0ec6c70bf6509fb5-F4B66.png
│ ├── e8e42b0753ed4170607ecff76b81d17e-80898.png
│ ├── e91d1d5385805869f35bbaaeeefa3a42-401EA.png
│ ├── e9716d551b841b01f0f538650634ffc6-6F038.png
│ ├── f61f204b2b2503a3f3cf394d80f20cf7-0D195.png
│ ├── fe9c132fc9a58fb46e7c0fb5a08232d3-57450.png
│ ├── ggsans-italic-400-E988B.woff2
│ ├── ggsans-italic-500-0777F.woff2
│ ├── ggsans-italic-600-CB411.woff2
│ ├── ggsans-italic-700-891AC.woff2
│ ├── ggsans-italic-800-D36B0.woff2
│ ├── ggsans-normal-400-1456D.woff2
│ ├── ggsans-normal-500-89CE5.woff2
│ ├── ggsans-normal-600-C1EA8.woff2
│ ├── ggsans-normal-700-1949A.woff2
│ ├── ggsans-normal-800-58487.woff2
│ ├── highlight.min-D8D27.js
│ ├── lottie.min-99657.js
│ ├── solarized-dark.min-BA98F.css
│ ├── steady-steadymen-9DBDD.mp4
│ ├── will-farrell-wedding-crashers-3F562.mp4
│ └── zkbugbounty-EC455
├── Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt
└── Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files
│ ├── 8de58e44-43b0-47d8-b4de-25edc32c396e-03B44
│ ├── King_Neptune_Burger_Competition_1612202200-F9502.jpg
│ ├── awesome-zero-knowledge-proofs-1D92D
│ ├── bugs-bunny-looney-tunes-6263B.png
│ ├── steady-steadymen-DC679.png
│ ├── will-farrell-wedding-crashers-81F0B.png
│ └── zkbugbounty-EC455
├── ethereum
├── .gitignore
├── .solhint.json
├── contracts
│ ├── .DS_Store
│ ├── bridge
│ │ ├── L1ERC20Bridge.sol
│ │ ├── L1EthBridge.sol
│ │ └── interfaces
│ │ │ ├── IL1Bridge.sol
│ │ │ └── IL2Bridge.sol
│ ├── common
│ │ ├── AllowList.sol
│ │ ├── AllowListed.sol
│ │ ├── L2ContractHelper.sol
│ │ ├── ReentrancyGuard.sol
│ │ ├── interfaces
│ │ │ └── IAllowList.sol
│ │ └── libraries
│ │ │ ├── UncheckedMath.sol
│ │ │ └── UnsafeBytes.sol
│ ├── dev-contracts
│ │ ├── ReturnSomething.sol
│ │ ├── RevertFallback.sol
│ │ ├── TestnetERC20Token.sol
│ │ └── test
│ │ │ ├── DiamondCutTest.sol
│ │ │ ├── DiamondProxyTest.sol
│ │ │ ├── DummyERC20BytesTransferReturnValue.sol
│ │ │ ├── DummyERC20NoTransferReturnValue.sol
│ │ │ ├── GovernanceFacetTest.sol
│ │ │ ├── MerkleTest.sol
│ │ │ ├── PriorityQueueTest.sol
│ │ │ └── UnsafeBytesTest.sol
│ └── zksync
│ │ ├── .DS_Store
│ │ ├── Config.sol
│ │ ├── DiamondInit.sol
│ │ ├── DiamondProxy.sol
│ │ ├── Plonk4VerifierWithAccessToDNext.sol
│ │ ├── Storage.sol
│ │ ├── Verifier.sol
│ │ ├── facets
│ │ ├── Base.sol
│ │ ├── DiamondCut.sol
│ │ ├── Executor.sol
│ │ ├── Getters.sol
│ │ ├── Governance.sol
│ │ └── Mailbox.sol
│ │ ├── interfaces
│ │ ├── IDiamondCut.sol
│ │ ├── IExecutor.sol
│ │ ├── IGetters.sol
│ │ ├── IGovernance.sol
│ │ ├── IMailbox.sol
│ │ └── IZkSync.sol
│ │ └── libraries
│ │ ├── Diamond.sol
│ │ ├── Merkle.sol
│ │ ├── PairingsBn254.sol
│ │ ├── PriorityQueue.sol
│ │ └── TranscriptLib.sol
├── hardhat.config.ts
├── package.json
├── src.ts
│ └── diamondCut.ts
├── test
│ └── unit_tests
│ │ ├── allow_list_test.ts
│ │ ├── diamond_cut_test.ts
│ │ ├── governance_test.ts
│ │ ├── mailbox_test.ts
│ │ ├── merkle_test.ts
│ │ ├── priority_queue_test.ts
│ │ ├── proxy_test.ts
│ │ ├── unsafe_bytes_test.ts
│ │ └── utils.ts
├── tsconfig.json
├── tslint.json
└── yarn.lock
└── zksync
├── .gitignore
├── .solhint.json
├── contracts
├── ExternalDecoder.sol
├── L2ContractHelper.sol
└── bridge
│ ├── L2ERC20Bridge.sol
│ ├── L2ETHBridge.sol
│ ├── L2StandardERC20.sol
│ └── interfaces
│ ├── IL1Bridge.sol
│ ├── IL2Bridge.sol
│ ├── IL2EthInitializable.sol
│ └── IL2StandardToken.sol
├── hardhat.config.ts
├── package.json
├── tsconfig.json
├── tslint.json
└── yarn.lock
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | lerna-debug.log*
8 |
9 | # Diagnostic reports (https://nodejs.org/api/report.html)
10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11 |
12 | # Runtime data
13 | pids
14 | *.pid
15 | *.seed
16 | *.pid.lock
17 |
18 | # Directory for instrumented libs generated by jscoverage/JSCover
19 | lib-cov
20 |
21 | # Coverage directory used by tools like istanbul
22 | coverage
23 | *.lcov
24 | coverage.json
25 |
26 | # nyc test coverage
27 | .nyc_output
28 |
29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30 | .grunt
31 |
32 | # Bower dependency directory (https://bower.io/)
33 | bower_components
34 |
35 | # node-waf configuration
36 | .lock-wscript
37 |
38 | # Compiled binary addons (https://nodejs.org/api/addons.html)
39 | build/Release
40 |
41 | # Dependency directories
42 | node_modules/
43 | jspm_packages/
44 |
45 | # TypeScript v1 declaration files
46 | typings/
47 |
48 | # TypeScript cache
49 | *.tsbuildinfo
50 |
51 | # Optional npm cache directory
52 | .npm
53 |
54 | # Optional eslint cache
55 | .eslintcache
56 |
57 | # Microbundle cache
58 | .rpt2_cache/
59 | .rts2_cache_cjs/
60 | .rts2_cache_es/
61 | .rts2_cache_umd/
62 |
63 | # Optional REPL history
64 | .node_repl_history
65 |
66 | # Output of 'npm pack'
67 | *.tgz
68 |
69 | # Yarn Integrity file
70 | .yarn-integrity
71 |
72 | # dotenv environment variables file
73 | .env
74 | .env.test
75 |
76 | # parcel-bundler cache (https://parceljs.org/)
77 | .cache
78 |
79 | # Next.js build output
80 | .next
81 |
82 | # Nuxt.js build / generate output
83 | .nuxt
84 | dist
85 |
86 | # Gatsby files
87 | .cache/
88 | # Comment in the public line in if your project uses Gatsby and *not* Next.js
89 | # https://nextjs.org/blog/next-9-1#public-directory-support
90 | # public
91 |
92 | # vuepress build output
93 | .vuepress/dist
94 |
95 | # Serverless directories
96 | .serverless/
97 |
98 | # FuseBox cache
99 | .fusebox/
100 |
101 | # DynamoDB Local files
102 | .dynamodb/
103 |
104 | # TernJS port file
105 | .tern-port
106 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/02410a37de8a54f8cfb7a8842a2dd162-6E861.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/02410a37de8a54f8cfb7a8842a2dd162-6E861.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/031b7a5f3d262cf2bc59a7a43169a769-A5E43.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/031b7a5f3d262cf2bc59a7a43169a769-A5E43.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/0ab6fddedfdca4dee0b54ab41ab4faad-C5611.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/0ab6fddedfdca4dee0b54ab41ab4faad-C5611.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/0e5b3c84382435322161f927b720d8f6-770EF.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/0e5b3c84382435322161f927b720d8f6-770EF.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1-B2132.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1-B2132.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1080667809002037320-8957D.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1080667809002037320-8957D.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/14de4baac237519f8fc9dd37972f2c0e-20FC2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/14de4baac237519f8fc9dd37972f2c0e-20FC2.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/17fbc1db84dd48e50a84a75ab2dd3d00-A5EF0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/17fbc1db84dd48e50a84a75ab2dd3d00-A5EF0.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/18d5019615e942cceb72e45de2354bec-4A3FE.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/18d5019615e942cceb72e45de2354bec-4A3FE.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1bccbffbd30b7914bab52ee02706ffeb-9A706.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1bccbffbd30b7914bab52ee02706ffeb-9A706.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f389-5C738.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f3c1-445DC.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f3c6-621A1.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f43a-EB486.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f440-6C64D.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f446-9CC34.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f44b-8A059.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f44d-1f3fb-ED2AA.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f44d-1f3fe-78CB5.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f44d-27259.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f44f-3D381.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f48e-0F688.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f494-B74A3.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f4aa-2FD27.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f4af-4CFF5.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f4b8-E3468.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f4c6-44E30.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f4dc-AC641.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f50d-195C0.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f525-8FE4F.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f5ff-D6B6E.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f601-4E9BD.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f602-168C5.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f604-BF863.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f605-42B43.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f606-BE94E.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f618-0EA37.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f626-91074.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f630-F7D34.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f642-83E8A.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f64c-7C820.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f64f-22B8D.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f680-A35CE.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f6a8-A8AB3.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f911-F346C.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f91d-5A0F2.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f92f-FF4E0.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f972-F415D.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f979-BE2CD.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f9d0-3E117.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f9d1-5BC80.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1f9e0-EF3BF.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1faa6-9DAF4.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/1fae1-B19DE.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/2-ADBB4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/2-ADBB4.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/2459f37b83d8af0c2a702e3f7c762f19-54484.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/2459f37b83d8af0c2a702e3f7c762f19-54484.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/2696-15F4A.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/2705-0589F.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/2764-A3D25.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/2af0f89843ae811fe0fe7dff2f3003f9-BF362.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/2af0f89843ae811fe0fe7dff2f3003f9-BF362.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/2fb2550eac09d68c70c3cd8bc6422685-2C13A.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/2fb2550eac09d68c70c3cd8bc6422685-2C13A.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/30024f2eab00f1f2f2caee60d2b320a7-40E01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/30024f2eab00f1f2f2caee60d2b320a7-40E01.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/310bb104d49148a05def03fa039fef92-95023.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/310bb104d49148a05def03fa039fef92-95023.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/34807a544df04d136d013fdd0b743601-7992D.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/34807a544df04d136d013fdd0b743601-7992D.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/394983eda2eb8faf909901fe09d16b4b-3AEDC.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/394983eda2eb8faf909901fe09d16b4b-3AEDC.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/3b01c38b7c5b905fd8e8a1d72f7d7492-6DE9E.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/3b01c38b7c5b905fd8e8a1d72f7d7492-6DE9E.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/4-4551A.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/4-4551A.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/4606dd32813fe3c1549babda035fafab-74B15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/4606dd32813fe3c1549babda035fafab-74B15.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/4bd2854eafa7ab11aaec46b1f54a1214-5EF97.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/4bd2854eafa7ab11aaec46b1f54a1214-5EF97.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/5-E9BDB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/5-E9BDB.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/531790526316281858-DD032.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/531790526316281858-DD032.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/55afac51a32db1ff015fd3a7d901e67a-52D14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/55afac51a32db1ff015fd3a7d901e67a-52D14.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/568d22b97293cdd2d9b7006198d6adbc-9738F.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/568d22b97293cdd2d9b7006198d6adbc-9738F.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/589e8711bf28e89b473383d271f8f90e-E96A1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/589e8711bf28e89b473383d271f8f90e-E96A1.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/5b2500cadb4af88b0fe342af9ae1ccd8-56513.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/5b2500cadb4af88b0fe342af9ae1ccd8-56513.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/67077645d7418d196b2b4b1802b0e371-77A61.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/67077645d7418d196b2b4b1802b0e371-77A61.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/67594ee4b4d1fc03bca468327a0d145b-0C614.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/67594ee4b4d1fc03bca468327a0d145b-0C614.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/6a00e12240ed2ee2b1768b577982163b-38155.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/6a00e12240ed2ee2b1768b577982163b-38155.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/6a567cbfd6039038b3e7fb3b7b3c7185-B7C28.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/6a567cbfd6039038b3e7fb3b7b3c7185-B7C28.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/6e53c2d72f93e345a64684197d266a06-4C577.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/6e53c2d72f93e345a64684197d266a06-4C577.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/740859894781050890-F9E9A.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/740859894781050890-F9E9A.gif
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/759f8cc5f5d3a90e11a0003e003aec16-8D7BB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/759f8cc5f5d3a90e11a0003e003aec16-8D7BB.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/766c2260e6dcca9d711b68a59c71905f-C9DA4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/766c2260e6dcca9d711b68a59c71905f-C9DA4.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/7f23866cb01c87dff6692a91ddc5c586-87C3A.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/7f23866cb01c87dff6692a91ddc5c586-87C3A.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/7fcd80e4d3c60a600235b03c75f682a9-75033.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/7fcd80e4d3c60a600235b03c75f682a9-75033.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/82287b4212a9854e5730462bd70677ae-68341.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/82287b4212a9854e5730462bd70677ae-68341.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893826846457866-1AD3D.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893826846457866-1AD3D.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827027075142-F23DF.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827027075142-F23DF.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827035725825-8ED59.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827035725825-8ED59.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827089727568-5FD38.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827089727568-5FD38.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827127214090-56B72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827127214090-56B72.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827278602280-FABCC.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827278602280-FABCC.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827315826708-F59C0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827315826708-F59C0.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827442442280-31B9F.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827442442280-31B9F.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827706028033-9A97C.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/851893827706028033-9A97C.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/85d61d139688e186c36a085fbe06f01e-B1208.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/85d61d139688e186c36a085fbe06f01e-B1208.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/8646f8b4f073429bf27df27459ab18a2-B1058.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/8646f8b4f073429bf27df27459ab18a2-B1058.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/8de58e44-43b0-47d8-b4de-25edc32c396e-03B44:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/8de58e44-43b0-47d8-b4de-25edc32c396e-03B44
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/910676187288846397-518CD.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/910676187288846397-518CD.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/941541115469914182-6C118.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/941541115469914182-6C118.gif
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/955fc79ed2bc03b7352e542e305c44bc-7DA40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/955fc79ed2bc03b7352e542e305c44bc-7DA40.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/970d2e2f00cd7ef2134a1a3f21326349-B9EEF.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/970d2e2f00cd7ef2134a1a3f21326349-B9EEF.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/974453250864611368-838C9.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/974453250864611368-838C9.gif
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/977133670429261884-CA8EA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/977133670429261884-CA8EA.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/9bf2181404e658cab4039c07df56213f-EC9DE.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/9bf2181404e658cab4039c07df56213f-EC9DE.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/King_Neptune_Burger_Competition_1612202200-F9502.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/King_Neptune_Burger_Competition_1612202200-F9502.jpg
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/aa461341be1da6fac15265c060b60a0a-D2152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/aa461341be1da6fac15265c060b60a0a-D2152.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/aba7f6b23cd80ec9e8655016ce6ef443-929E9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/aba7f6b23cd80ec9e8655016ce6ef443-929E9.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ae70f07a06c1c7e983291bb14a1bed7f-4031E.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ae70f07a06c1c7e983291bb14a1bed7f-4031E.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/awesome-zero-knowledge-proofs-1D92D:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/awesome-zero-knowledge-proofs-1D92D
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/b09e7eca097f157b7360547c8cf2f648-DE955.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/b09e7eca097f157b7360547c8cf2f648-DE955.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/b927333187591defbadd1e91f7801db0-A96BB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/b927333187591defbadd1e91f7801db0-A96BB.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/bf8b223b536a4efab3ae0bc8171660a3-4574C.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/bf8b223b536a4efab3ae0bc8171660a3-4574C.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/bugs-bunny-looney-tunes-BD3E0.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/bugs-bunny-looney-tunes-BD3E0.mp4
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/c9cb30134c634c9e02d0c64df4922803-1AAF2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/c9cb30134c634c9e02d0c64df4922803-1AAF2.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/cb23e87e4eb33d228ed3294f90188951-D6A20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/cb23e87e4eb33d228ed3294f90188951-D6A20.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/d717a248a569977603050bbb038adae3-65F7E.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/d717a248a569977603050bbb038adae3-65F7E.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/d7e24e0994d277993ed07845cac9ca8b-E4084.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/d7e24e0994d277993ed07845cac9ca8b-E4084.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/dbb23f1b47ba649fff61ec62493dd61b-A9702.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/dbb23f1b47ba649fff61ec62493dd61b-A9702.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/e2171069b4b213c910837760d8ad5ae4-1519E.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/e2171069b4b213c910837760d8ad5ae4-1519E.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/e3a8d3db1e475ec1174f03d3b27eac95-32B40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/e3a8d3db1e475ec1174f03d3b27eac95-32B40.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/e3d596e686b33b7c0ec6c70bf6509fb5-F4B66.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/e3d596e686b33b7c0ec6c70bf6509fb5-F4B66.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/e8e42b0753ed4170607ecff76b81d17e-80898.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/e8e42b0753ed4170607ecff76b81d17e-80898.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/e91d1d5385805869f35bbaaeeefa3a42-401EA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/e91d1d5385805869f35bbaaeeefa3a42-401EA.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/e9716d551b841b01f0f538650634ffc6-6F038.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/e9716d551b841b01f0f538650634ffc6-6F038.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/f61f204b2b2503a3f3cf394d80f20cf7-0D195.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/f61f204b2b2503a3f3cf394d80f20cf7-0D195.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/fe9c132fc9a58fb46e7c0fb5a08232d3-57450.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/fe9c132fc9a58fb46e7c0fb5a08232d3-57450.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-italic-400-E988B.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-italic-400-E988B.woff2
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-italic-500-0777F.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-italic-500-0777F.woff2
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-italic-600-CB411.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-italic-600-CB411.woff2
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-italic-700-891AC.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-italic-700-891AC.woff2
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-italic-800-D36B0.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-italic-800-D36B0.woff2
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-normal-400-1456D.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-normal-400-1456D.woff2
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-normal-500-89CE5.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-normal-500-89CE5.woff2
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-normal-600-C1EA8.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-normal-600-C1EA8.woff2
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-normal-700-1949A.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-normal-700-1949A.woff2
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-normal-800-58487.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/ggsans-normal-800-58487.woff2
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/solarized-dark.min-BA98F.css:
--------------------------------------------------------------------------------
1 | .hljs{display:block;overflow-x:auto;padding:.5em;background:#002b36;color:#839496}.hljs-comment,.hljs-quote{color:#586e75}.hljs-keyword,.hljs-selector-tag,.hljs-addition{color:#859900}.hljs-number,.hljs-string,.hljs-meta .hljs-meta-string,.hljs-literal,.hljs-doctag,.hljs-regexp{color:#2aa198}.hljs-title,.hljs-section,.hljs-name,.hljs-selector-id,.hljs-selector-class{color:#268bd2}.hljs-attribute,.hljs-attr,.hljs-variable,.hljs-template-variable,.hljs-class .hljs-title,.hljs-type{color:#b58900}.hljs-symbol,.hljs-bullet,.hljs-subst,.hljs-meta,.hljs-meta .hljs-keyword,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-link{color:#cb4b16}.hljs-built_in,.hljs-deletion{color:#dc322f}.hljs-formula{background:#073642}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold}
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/steady-steadymen-9DBDD.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/steady-steadymen-9DBDD.mp4
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/will-farrell-wedding-crashers-3F562.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/will-farrell-wedding-crashers-3F562.mp4
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/zkbugbounty-EC455:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].html_Files/zkbugbounty-EC455
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files/8de58e44-43b0-47d8-b4de-25edc32c396e-03B44:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files/8de58e44-43b0-47d8-b4de-25edc32c396e-03B44
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files/King_Neptune_Burger_Competition_1612202200-F9502.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files/King_Neptune_Burger_Competition_1612202200-F9502.jpg
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files/awesome-zero-knowledge-proofs-1D92D:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files/awesome-zero-knowledge-proofs-1D92D
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files/bugs-bunny-looney-tunes-6263B.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files/bugs-bunny-looney-tunes-6263B.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files/steady-steadymen-DC679.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files/steady-steadymen-DC679.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files/will-farrell-wedding-crashers-81F0B.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files/will-farrell-wedding-crashers-81F0B.png
--------------------------------------------------------------------------------
/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files/zkbugbounty-EC455:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/discord-export/Code4rena - ARCHIVE-Q4-2022 - zksync-oct28 [1035295966502338621].txt_Files/zkbugbounty-EC455
--------------------------------------------------------------------------------
/ethereum/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /artifacts
3 | /cache
4 | /typechain
5 |
--------------------------------------------------------------------------------
/ethereum/.solhint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "solhint:default",
3 | "plugins": ["prettier"],
4 | "rules": {
5 | "prettier/prettier": "error",
6 | "no-inline-assembly": false
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/ethereum/contracts/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/ethereum/contracts/.DS_Store
--------------------------------------------------------------------------------
/ethereum/contracts/bridge/interfaces/IL1Bridge.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import {IMailbox, L2Log, L2Message} from "../../zksync/interfaces/IZkSync.sol";
6 |
7 | /// @author Matter Labs
8 | interface IL1Bridge {
9 | event DepositInitiated(address indexed from, address indexed to, address indexed l1Token, uint256 amount);
10 |
11 | event WithdrawalFinalized(address indexed to, address indexed l1Token, uint256 amount);
12 |
13 | event ClaimedFailedDeposit(address indexed to, address indexed l1Token, uint256 amount);
14 |
15 | function isWithdrawalFinalized(uint256 _l2BlockNumber, uint256 _l2MessageIndex) external view returns (bool);
16 |
17 | function deposit(
18 | address _l2Receiver,
19 | address _l1Token,
20 | uint256 _amount
21 | ) external payable returns (bytes32 txHash);
22 |
23 | function claimFailedDeposit(
24 | address _depositSender,
25 | address _l1Token,
26 | bytes32 _l2TxHash,
27 | uint256 _l2BlockNumber,
28 | uint256 _l2MessageIndex,
29 | uint16 _l2TxNumberInBlock,
30 | bytes32[] calldata _merkleProof
31 | ) external;
32 |
33 | function finalizeWithdrawal(
34 | uint256 _l2BlockNumber,
35 | uint256 _l2MessageIndex,
36 | uint16 _l2TxNumberInBlock,
37 | bytes calldata _message,
38 | bytes32[] calldata _merkleProof
39 | ) external;
40 |
41 | function l2TokenAddress(address _l1Token) external view returns (address);
42 | }
43 |
--------------------------------------------------------------------------------
/ethereum/contracts/bridge/interfaces/IL2Bridge.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | /// @author Matter Labs
6 | interface IL2Bridge {
7 | function finalizeDeposit(
8 | address _l1Sender,
9 | address _l2Receiver,
10 | address _l1Token,
11 | uint256 _amount,
12 | bytes calldata _data
13 | ) external;
14 |
15 | function withdraw(
16 | address _l1Receiver,
17 | address _l2Token,
18 | uint256 _amount
19 | ) external;
20 |
21 | function l1TokenAddress(address _l2Token) external view returns (address);
22 |
23 | function l2TokenAddress(address _l1Token) external view returns (address);
24 |
25 | function l1Bridge() external view returns (address);
26 | }
27 |
--------------------------------------------------------------------------------
/ethereum/contracts/common/AllowListed.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "./interfaces/IAllowList.sol";
6 |
7 | /// @author Matter Labs
8 | abstract contract AllowListed {
9 | modifier senderCanCallFunction(IAllowList _allowList) {
10 | // Preventing the stack too deep error
11 | {
12 | // Take the first four bytes of the calldata as a function selector.
13 | // Please note, `msg.data[:4]` will revert the call if the calldata is less than four bytes.
14 | bytes4 functionSig = bytes4(msg.data[:4]);
15 | require(_allowList.canCall(msg.sender, address(this), functionSig), "nr");
16 | }
17 | _;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/ethereum/contracts/common/L2ContractHelper.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | interface IL2Messenger {
6 | function sendToL1(bytes memory _message) external returns (bytes32);
7 | }
8 |
9 | interface IContractDeployer {
10 | struct ForceDeployment {
11 | bytes32 bytecodeHash;
12 | address newAddress;
13 | uint256 value;
14 | bytes input;
15 | }
16 |
17 | function forceDeployOnAddresses(ForceDeployment[] calldata _deployParams) external;
18 |
19 | function create2(
20 | bytes32 _salt,
21 | bytes32 _bytecodeHash,
22 | bytes calldata _input
23 | ) external;
24 | }
25 |
26 | uint160 constant SYSTEM_CONTRACTS_OFFSET = 0x8000; // 2^15
27 |
28 | address constant BOOTLOADER_ADDRESS = address(SYSTEM_CONTRACTS_OFFSET + 0x01);
29 |
30 | address constant DEPLOYER_SYSTEM_CONTRACT_ADDRESS = address(SYSTEM_CONTRACTS_OFFSET + 0x06);
31 |
32 | // A contract that is allowed to deploy any codehash
33 | // on any address. To be used only during an upgrade.
34 | address constant FORCE_DEPLOYER = address(SYSTEM_CONTRACTS_OFFSET + 0x07);
35 |
36 | IL2Messenger constant L2_MESSENGER = IL2Messenger(address(SYSTEM_CONTRACTS_OFFSET + 0x08));
37 |
38 | address constant VALUE_SIMULATOR_SYSTEM_CONTRACT_ADDRESS = address(SYSTEM_CONTRACTS_OFFSET + 0x09);
39 |
40 | library L2ContractHelper {
41 | bytes32 constant CREATE2_PREFIX = keccak256("zksyncCreate2");
42 |
43 | function sendMessageToL1(bytes memory _message) internal returns (bytes32) {
44 | return L2_MESSENGER.sendToL1(_message);
45 | }
46 |
47 | function hashL2Bytecode(bytes memory _bytecode) internal pure returns (bytes32 hashedBytecode) {
48 | // Note that the length of the bytecode
49 | // must be provided in 32-byte words.
50 | require(_bytecode.length % 32 == 0, "po");
51 |
52 | uint256 bytecodeLenInWords = _bytecode.length / 32;
53 | require(bytecodeLenInWords < 2**16, "pp"); // bytecode length must be less than 2^16 words
54 | require(bytecodeLenInWords % 2 == 1, "pr"); // bytecode length in words must be odd
55 | hashedBytecode = sha256(_bytecode) & 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
56 | // Setting the version of the hash
57 | hashedBytecode = (hashedBytecode | bytes32(uint256(1 << 248)));
58 | // Setting the length
59 | hashedBytecode = hashedBytecode | bytes32(bytecodeLenInWords << 224);
60 | }
61 |
62 | /// @notice Validates the bytecodehash
63 | function validateBytecodeHash(bytes32 _bytecodeHash) internal pure {
64 | uint8 version = uint8(_bytecodeHash[0]);
65 | require(version == 1 && _bytecodeHash[1] == bytes1(0), "zf"); // Incorrectly formatted bytecodeHash
66 |
67 | require(bytecodeLen(_bytecodeHash) % 2 == 1, "uy"); // Code length in words must be odd
68 | }
69 |
70 | /// @notice returns the length of the bytecode
71 | function bytecodeLen(bytes32 _bytecodeHash) internal pure returns (uint256 codeLengthInWords) {
72 | codeLengthInWords = uint256(uint8(_bytecodeHash[2])) * 256 + uint256(uint8(_bytecodeHash[3]));
73 | }
74 |
75 | function computeCreate2Address(
76 | address _sender,
77 | bytes32 _salt,
78 | bytes32 _bytecodeHash,
79 | bytes32 _constructorInputHash
80 | ) internal pure returns (address) {
81 | bytes32 senderBytes = bytes32(uint256(uint160(_sender)));
82 | bytes32 data = keccak256(
83 | bytes.concat(CREATE2_PREFIX, senderBytes, _salt, _bytecodeHash, _constructorInputHash)
84 | );
85 |
86 | return address(uint160(uint256(data)));
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/ethereum/contracts/common/ReentrancyGuard.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | /**
6 | * @dev Contract module that helps prevent reentrant calls to a function.
7 | *
8 | * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
9 | * available, which can be applied to functions to make sure there are no nested
10 | * (reentrant) calls to them.
11 | *
12 | * Note that because there is a single `nonReentrant` guard, functions marked as
13 | * `nonReentrant` may not call one another. This can be worked around by making
14 | * those functions `private`, and then adding `external` `nonReentrant` entry
15 | * points to them.
16 | *
17 | * TIP: If you would like to learn more about reentrancy and alternative ways
18 | * to protect against it, check out our blog post
19 | * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
20 | *
21 | * _Since v2.5.0:_ this module is now much more gas efficient, given net gas
22 | * metering changes introduced in the Istanbul hardfork.
23 | */
24 | abstract contract ReentrancyGuard {
25 | /// @dev Address of lock flag variable.
26 | /// @dev Flag is placed at random memory location to not interfere with Storage contract.
27 | uint256 private constant LOCK_FLAG_ADDRESS = 0x8e94fed44239eb2314ab7a406345e6c5a8f0ccedf3b600de3d004e672c33abf4; // keccak256("ReentrancyGuard") - 1;
28 |
29 | // https://github.com/OpenZeppelin/openzeppelin-contracts/blob/566a774222707e424896c0c390a84dc3c13bdcb2/contracts/security/ReentrancyGuard.sol
30 | // The values being non-zero value makes deployment a bit more expensive,
31 | // but in exchange the refund on every call to nonReentrant will be lower in
32 | // amount. Since refunds are capped to a percentage of the total
33 | // transaction's gas, it is best to keep them low in cases like this one, to
34 | // increase the likelihood of the full refund coming into effect.
35 | uint256 private constant _NOT_ENTERED = 1;
36 | uint256 private constant _ENTERED = 2;
37 |
38 | modifier reentrancyGuardInitializer() {
39 | _initializeReentrancyGuard();
40 | _;
41 | }
42 |
43 | function _initializeReentrancyGuard() private {
44 | uint256 lockSlotOldValue;
45 |
46 | // Storing an initial non-zero value makes deployment a bit more
47 | // expensive but in exchange every call to nonReentrant
48 | // will be cheaper.
49 | assembly {
50 | lockSlotOldValue := sload(LOCK_FLAG_ADDRESS)
51 | sstore(LOCK_FLAG_ADDRESS, _NOT_ENTERED)
52 | }
53 |
54 | // Check that storage slot for reentrancy guard is empty to rule out possibility of slot conflict
55 | require(lockSlotOldValue == 0, "1B");
56 | }
57 |
58 | /**
59 | * @dev Prevents a contract from calling itself, directly or indirectly.
60 | * Calling a `nonReentrant` function from another `nonReentrant`
61 | * function is not supported. It is possible to prevent this from happening
62 | * by making the `nonReentrant` function external, and make it call a
63 | * `private` function that does the actual work.
64 | */
65 | modifier nonReentrant() {
66 | uint256 _status;
67 | assembly {
68 | _status := sload(LOCK_FLAG_ADDRESS)
69 | }
70 |
71 | // On the first call to nonReentrant, _notEntered will be true
72 | require(_status == _NOT_ENTERED, "r1");
73 |
74 | // Any calls to nonReentrant after this point will fail
75 | assembly {
76 | sstore(LOCK_FLAG_ADDRESS, _ENTERED)
77 | }
78 |
79 | _;
80 |
81 | // By storing the original value once again, a refund is triggered (see
82 | // https://eips.ethereum.org/EIPS/eip-2200)
83 | assembly {
84 | sstore(LOCK_FLAG_ADDRESS, _NOT_ENTERED)
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/ethereum/contracts/common/interfaces/IAllowList.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | interface IAllowList {
6 | /*//////////////////////////////////////////////////////////////
7 | EVENTS
8 | //////////////////////////////////////////////////////////////*/
9 |
10 | /// @notice public access is changed
11 | event UpdatePublicAccess(address indexed target, bool newStatus);
12 |
13 | /// @notice permission to call is changed
14 | event UpdateCallPermission(address indexed caller, address indexed target, bytes4 indexed functionSig, bool status);
15 |
16 | /// @notice pendingOwner is changed
17 | /// @dev Also emitted when the new owner is accepted and in this case, `newPendingOwner` would be zero address
18 | event NewPendingOwner(address indexed oldPendingOwner, address indexed newPendingOwner);
19 |
20 | /// @notice Owner changed
21 | event NewOwner(address indexed newOwner);
22 |
23 | /*//////////////////////////////////////////////////////////////
24 | GETTERS
25 | //////////////////////////////////////////////////////////////*/
26 |
27 | function pendingOwner() external view returns (address);
28 |
29 | function owner() external view returns (address);
30 |
31 | function isAccessPublic(address _target) external view returns (bool);
32 |
33 | function hasSpecialAccessToCall(
34 | address _caller,
35 | address _target,
36 | bytes4 _functionSig
37 | ) external view returns (bool);
38 |
39 | function canCall(
40 | address _caller,
41 | address _target,
42 | bytes4 _functionSig
43 | ) external view returns (bool);
44 |
45 | /*//////////////////////////////////////////////////////////////
46 | ALLOW LIST LOGIC
47 | //////////////////////////////////////////////////////////////*/
48 |
49 | function setBatchPublicAccess(address[] calldata _targets, bool[] calldata _enables) external;
50 |
51 | function setPublicAccess(address _target, bool _enable) external;
52 |
53 | function setBatchPermissionToCall(
54 | address[] calldata _callers,
55 | address[] calldata _targets,
56 | bytes4[] calldata _functionSigs,
57 | bool[] calldata _enables
58 | ) external;
59 |
60 | function setPermissionToCall(
61 | address _caller,
62 | address _target,
63 | bytes4 _functionSig,
64 | bool _enable
65 | ) external;
66 |
67 | function setPendingOwner(address _newPendingOwner) external;
68 |
69 | function acceptOwner() external;
70 | }
71 |
--------------------------------------------------------------------------------
/ethereum/contracts/common/libraries/UncheckedMath.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | library UncheckedMath {
6 | function uncheckedInc(uint256 _number) internal pure returns (uint256) {
7 | unchecked {
8 | return _number + 1;
9 | }
10 | }
11 |
12 | function uncheckedAdd(uint256 _lhs, uint256 _rhs) internal pure returns (uint256) {
13 | unchecked {
14 | return _lhs + _rhs;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ethereum/contracts/common/libraries/UnsafeBytes.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | /**
6 | * @author Matter Labs
7 | * @dev The library provides a set of functions that help read data from an "abi.encodePacked" byte array.
8 | * @dev Each of the functions accepts the `bytes memory` and the offset where data should be read and returns a value of a certain type.
9 | *
10 | * @dev WARNING!
11 | * 1) Functions don't check the length of the bytes array, so it can go out of bounds.
12 | * The user of the library must check for bytes length before using any functions from the library!
13 | *
14 | * 2) Read variables are not cleaned up - https://docs.soliditylang.org/en/v0.8.16/internals/variable_cleanup.html.
15 | * Using data in inline assembly can lead to unexpected behavior!
16 | */
17 | library UnsafeBytes {
18 | function readUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32 result, uint256 offset) {
19 | assembly {
20 | offset := add(_start, 4)
21 | result := mload(add(_bytes, offset))
22 | }
23 | }
24 |
25 | function readAddress(bytes memory _bytes, uint256 _start) internal pure returns (address result, uint256 offset) {
26 | assembly {
27 | offset := add(_start, 20)
28 | result := mload(add(_bytes, offset))
29 | }
30 | }
31 |
32 | function readUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256 result, uint256 offset) {
33 | assembly {
34 | offset := add(_start, 32)
35 | result := mload(add(_bytes, offset))
36 | }
37 | }
38 |
39 | function readBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32 result, uint256 offset) {
40 | assembly {
41 | offset := add(_start, 32)
42 | result := mload(add(_bytes, offset))
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/ethereum/contracts/dev-contracts/ReturnSomething.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | contract ReturnSomething {
6 | fallback() external payable {
7 | assembly {
8 | return(0, 0x20)
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/ethereum/contracts/dev-contracts/RevertFallback.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | contract RevertFallback {
6 | fallback() external payable {
7 | revert();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ethereum/contracts/dev-contracts/TestnetERC20Token.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: UNLICENSED
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
6 |
7 | contract TestnetERC20Token is ERC20 {
8 | uint8 private _decimals;
9 |
10 | constructor(
11 | string memory name_,
12 | string memory symbol_,
13 | uint8 decimals_
14 | ) ERC20(name_, symbol_) {
15 | _decimals = decimals_;
16 | }
17 |
18 | function mint(address _to, uint256 _amount) public returns (bool) {
19 | _mint(_to, _amount);
20 | return true;
21 | }
22 |
23 | function decimals() public view override returns (uint8) {
24 | return _decimals;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/ethereum/contracts/dev-contracts/test/DiamondCutTest.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: UNLICENSED
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "../../zksync/libraries/Diamond.sol";
6 | import "../../zksync/facets/Getters.sol";
7 |
8 | contract DiamondCutTest is GettersFacet {
9 | function diamondCut(Diamond.DiamondCutData memory _diamondCut) external {
10 | Diamond.diamondCut(_diamondCut);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/ethereum/contracts/dev-contracts/test/DiamondProxyTest.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "../../zksync/libraries/Diamond.sol";
6 | import "../../zksync/facets/Base.sol";
7 |
8 | contract DiamondProxyTest is Base {
9 | function setFreezability(bool _freeze) external returns (bytes32) {
10 | Diamond.DiamondStorage storage diamondStorage = Diamond.getDiamondStorage();
11 | diamondStorage.isFrozen = _freeze;
12 | return Diamond.DIAMOND_INIT_SUCCESS_RETURN_VALUE;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/ethereum/contracts/dev-contracts/test/DummyERC20BytesTransferReturnValue.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: UNLICENSED
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | contract DummyERC20BytesTransferReturnValue {
6 | bytes returnValue;
7 |
8 | constructor(bytes memory _returnValue) {
9 | returnValue = _returnValue;
10 | }
11 |
12 | function transfer(address _recipient, uint256 _amount) external view returns (bytes memory) {
13 | // Hack to prevent Solidity warnings
14 | _recipient;
15 | _amount;
16 |
17 | return returnValue;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/ethereum/contracts/dev-contracts/test/DummyERC20NoTransferReturnValue.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: UNLICENSED
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | contract DummyERC20NoTransferReturnValue {
6 | function transfer(address recipient, uint256 amount) external {}
7 | }
8 |
--------------------------------------------------------------------------------
/ethereum/contracts/dev-contracts/test/GovernanceFacetTest.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: UNLICENSED
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "../../zksync/facets/Governance.sol";
6 |
7 | contract GovernanceFacetTest is GovernanceFacet {
8 | constructor() {
9 | s.governor = msg.sender;
10 | }
11 |
12 | function isValidator(address _validator) external view returns (bool) {
13 | return s.validators[_validator];
14 | }
15 |
16 | function getPendingGovernor() external view returns (address) {
17 | return s.pendingGovernor;
18 | }
19 |
20 | function getGovernor() external view returns (address) {
21 | return s.governor;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ethereum/contracts/dev-contracts/test/MerkleTest.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: UNLICENSED
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "../../zksync/libraries/Merkle.sol";
6 |
7 | contract MerkleTest {
8 | function calculateRoot(
9 | bytes32[] calldata _path,
10 | uint256 _index,
11 | bytes32 _itemHash
12 | ) external pure returns (bytes32) {
13 | return Merkle.calculateRoot(_path, _index, _itemHash);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/ethereum/contracts/dev-contracts/test/PriorityQueueTest.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: UNLICENSED
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "../../zksync/libraries/PriorityQueue.sol";
6 |
7 | contract PriorityQueueTest {
8 | using PriorityQueue for PriorityQueue.Queue;
9 |
10 | PriorityQueue.Queue priorityQueue;
11 |
12 | function getFirstUnprocessedPriorityTx() external view returns (uint256) {
13 | return priorityQueue.getFirstUnprocessedPriorityTx();
14 | }
15 |
16 | function getTotalPriorityTxs() external view returns (uint256) {
17 | return priorityQueue.getTotalPriorityTxs();
18 | }
19 |
20 | function getSize() external view returns (uint256) {
21 | return priorityQueue.getSize();
22 | }
23 |
24 | function isEmpty() external view returns (bool) {
25 | return priorityQueue.isEmpty();
26 | }
27 |
28 | function pushBack(PriorityOperation memory _operation) external {
29 | return priorityQueue.pushBack(_operation);
30 | }
31 |
32 | function front() external view returns (PriorityOperation memory) {
33 | return priorityQueue.front();
34 | }
35 |
36 | function popFront() external returns (PriorityOperation memory operation) {
37 | return priorityQueue.popFront();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/ethereum/contracts/dev-contracts/test/UnsafeBytesTest.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: UNLICENSED
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "../../common/libraries/UnsafeBytes.sol";
6 |
7 | contract UnsafeBytesTest {
8 | using UnsafeBytes for bytes;
9 |
10 | function readUint32(bytes memory _bytes, uint256 _start) external pure returns (uint32 readValue, uint256 offset) {
11 | return _bytes.readUint32(_start);
12 | }
13 |
14 | function readAddress(bytes memory _bytes, uint256 _start)
15 | external
16 | pure
17 | returns (address readValue, uint256 offset)
18 | {
19 | return _bytes.readAddress(_start);
20 | }
21 |
22 | function readUint256(bytes memory _bytes, uint256 _start)
23 | external
24 | pure
25 | returns (uint256 readValue, uint256 offset)
26 | {
27 | return _bytes.readUint256(_start);
28 | }
29 |
30 | function readBytes32(bytes memory _bytes, uint256 _start)
31 | external
32 | pure
33 | returns (bytes32 readValue, uint256 offset)
34 | {
35 | return _bytes.readBytes32(_start);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/ethereum/contracts/zksync/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code-423n4/2022-10-zksync/ffc9ad4ee3195cccb9bb6ffd236cea98bba6186b/ethereum/contracts/zksync/.DS_Store
--------------------------------------------------------------------------------
/ethereum/contracts/zksync/Config.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | bytes32 constant EMPTY_STRING_KECCAK = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
6 |
7 | /// @dev Bytes in raw L2 log
8 | /// @dev Equal to the bytes size of the tuple - (uint8 ShardId, bool isService, uint16 txNumberInBlock, address sender, bytes32 key, bytes32 value)
9 | uint256 constant L2_TO_L1_LOG_SERIALIZE_SIZE = 88;
10 |
11 | /// @dev Length of the bytes array with L2->L1 logs
12 | uint256 constant L2_TO_L1_LOGS_COMMITMENT_BYTES = 4 + L2_TO_L1_LOG_SERIALIZE_SIZE * 512;
13 |
14 | /// @dev L2 -> L1 logs Merkle tree height
15 | uint256 constant L2_TO_L1_LOG_MERKLE_TREE_HEIGHT = 9;
16 |
17 | /// @dev The value of default leaf hash for L2 -> L1 logs Merkle tree
18 | /// @dev An incomplete fixed-size tree is filled with this value to be a full binary tree
19 | /// @dev Actually equal to the `keccak256(new bytes(L2_LOG_BYTES))`
20 | bytes32 constant L2_L1_LOGS_TREE_DEFAULT_LEAF_HASH = 0x72abee45b59e344af8a6e520241c4744aff26ed411f4c4b00f8af09adada43ba;
21 |
22 | /// @dev Length of the bytes array with initial storage changes
23 | uint256 constant INITIAL_STORAGE_CHANGES_COMMITMENT_BYTES = 4 + 64 * 4896;
24 |
25 | /// @dev Length of the bytes array with repeated storage changes
26 | uint256 constant REPEATED_STORAGE_CHANGES_COMMITMENT_BYTES = 4 + 40 * 7787;
27 |
28 | // TODO: change constant to the real root hash of empty Merkle tree (SMA-184)
29 | bytes32 constant DEFAULT_L2_LOGS_TREE_ROOT_HASH = bytes32(0);
30 |
31 | /// @dev The address of the special smart contract that can send arbitrary length message as an L2 log
32 | address constant L2_TO_L1_MESSENGER = address(0x8008);
33 |
34 | /// @dev The address of the bootloader start program
35 | address constant L2_BOOTLOADER_ADDRESS = address(0x8001);
36 |
37 | /// @dev The address of the known code storage system contract
38 | address constant L2_KNOWN_CODE_STORAGE_ADDRESS = address(0x8004);
39 |
40 | /// @dev The address of the context system contract
41 | address constant L2_SYSTEM_CONTEXT_ADDRESS = address(0x800b);
42 |
43 | /// @dev Denotes the first byte of the zkSync transaction that came from L1.
44 | uint256 constant PRIORITY_OPERATION_L2_TX_TYPE = 255;
45 |
46 | /// @dev Expected average period of block creation
47 | uint256 constant BLOCK_PERIOD = 13 seconds;
48 |
49 | /// @dev Expiration delta for priority request to be satisfied (in seconds)
50 | /// @dev otherwise incorrect block with priority op could not be reverted.
51 | uint256 constant PRIORITY_EXPIRATION_PERIOD = 3 days;
52 |
53 | /// @dev Expiration delta for priority request to be satisfied (in ETH blocks)
54 | uint256 constant PRIORITY_EXPIRATION = $(
55 | defined(PRIORITY_EXPIRATION) ? PRIORITY_EXPIRATION : PRIORITY_EXPIRATION_PERIOD / BLOCK_PERIOD
56 | );
57 |
58 | /// @dev Notice period before activation preparation status of upgrade mode (in seconds)
59 | /// @dev NOTE: we must reserve for users enough time to send full exit operation, wait maximum time for processing this operation and withdraw funds from it.
60 | uint256 constant UPGRADE_NOTICE_PERIOD = $$(defined(UPGRADE_NOTICE_PERIOD) ? UPGRADE_NOTICE_PERIOD : "14 days");
61 |
62 | /// @dev Timestamp - seconds since unix epoch
63 | uint256 constant COMMIT_TIMESTAMP_NOT_OLDER = $$(
64 | defined(COMMIT_TIMESTAMP_NOT_OLDER) ? COMMIT_TIMESTAMP_NOT_OLDER : "365 days"
65 | );
66 |
67 | /// @dev Maximum available error between real commit block timestamp and analog used in the verifier (in seconds)
68 | /// @dev Must be used cause miner's `block.timestamp` value can differ on some small value (as we know - 15 seconds)
69 | uint256 constant COMMIT_TIMESTAMP_APPROXIMATION_DELTA = $$(
70 | defined(COMMIT_TIMESTAMP_APPROXIMATION_DELTA) ? COMMIT_TIMESTAMP_APPROXIMATION_DELTA : "365 days"
71 | );
72 |
73 | /// @dev Bit mask to apply for verifier public input before verifying.
74 | uint256 constant INPUT_MASK = $$(~uint256(0) >> 8);
75 |
76 | /// @dev The maximum number of ergs that a user can request for L1 -> L2 transactions
77 | uint256 constant PRIORITY_TX_MAX_ERGS_LIMIT = 2097152;
78 |
79 | /// @dev Number of security council members that should approve an emergency upgrade
80 | uint256 constant SECURITY_COUNCIL_APPROVALS_FOR_EMERGENCY_UPGRADE = $$(
81 | SECURITY_COUNCIL_APPROVALS_FOR_EMERGENCY_UPGRADE
82 | );
83 |
--------------------------------------------------------------------------------
/ethereum/contracts/zksync/DiamondInit.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "../common/interfaces/IAllowList.sol";
6 | import "./interfaces/IExecutor.sol";
7 | import "./libraries/Diamond.sol";
8 | import "./facets/Base.sol";
9 | import "./Config.sol";
10 |
11 | /// @author Matter Labs
12 | /// @dev The contract is used only once to initialize the diamond proxy.
13 | /// @dev The deployment process takes care of this contract's initialization.
14 | contract DiamondInit is Base {
15 | constructor() reentrancyGuardInitializer {}
16 |
17 | /// @notice zkSync contract initialization
18 | /// @param _verifier address of Verifier contract
19 | /// @param _governor address who can manage the contract
20 | /// @param _validator address who can make blocks
21 | /// @param _genesisBlockHash Block hash of the genesis (initial) block
22 | /// @param _genesisIndexRepeatedStorageChanges The serial number of the shortcut storage key for genesis block
23 | /// @param _genesisBlockCommitment The zk-proof commitment for the genesis block
24 | /// @return Magic 32 bytes, which indicates that the contract logic is expected to be used as a diamond proxy initializer
25 | function initialize(
26 | Verifier _verifier,
27 | address _governor,
28 | address _validator,
29 | bytes32 _genesisBlockHash,
30 | uint64 _genesisIndexRepeatedStorageChanges,
31 | bytes32 _genesisBlockCommitment,
32 | IAllowList _allowList,
33 | VerifierParams calldata _verifierParams,
34 | bool _zkPorterIsAvailable,
35 | bytes32 _l2BootloaderBytecodeHash,
36 | bytes32 _l2DefaultAccountBytecodeHash
37 | ) external reentrancyGuardInitializer returns (bytes32) {
38 | s.verifier = _verifier;
39 | s.governor = _governor;
40 | s.validators[_validator] = true;
41 |
42 | // We need to initialize the state hash because it is used in the commitment of the next block
43 | IExecutor.StoredBlockInfo memory storedBlockZero = IExecutor.StoredBlockInfo(
44 | 0,
45 | _genesisBlockHash,
46 | _genesisIndexRepeatedStorageChanges,
47 | 0,
48 | EMPTY_STRING_KECCAK,
49 | DEFAULT_L2_LOGS_TREE_ROOT_HASH,
50 | 0,
51 | _genesisBlockCommitment
52 | );
53 |
54 | s.storedBlockHashes[0] = keccak256(abi.encode(storedBlockZero));
55 | s.allowList = _allowList;
56 | s.verifierParams = _verifierParams;
57 | s.zkPorterIsAvailable = _zkPorterIsAvailable;
58 | s.l2BootloaderBytecodeHash = _l2BootloaderBytecodeHash;
59 | s.l2DefaultAccountBytecodeHash = _l2DefaultAccountBytecodeHash;
60 |
61 | return Diamond.DIAMOND_INIT_SUCCESS_RETURN_VALUE;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/ethereum/contracts/zksync/DiamondProxy.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "./libraries/Diamond.sol";
6 |
7 | /// @title Diamond Proxy Cotract (EIP-2535)
8 | /// @author Matter Labs
9 | contract DiamondProxy {
10 | constructor(uint256 _chainId, Diamond.DiamondCutData memory _diamondCut) {
11 | // Check that the contract is deployed on the expected chain.
12 | // Thus, the contract deployed by the same Create2 factory on the different chain will have different addresses!
13 | require(_chainId == block.chainid, "pr");
14 | Diamond.diamondCut(_diamondCut);
15 | }
16 |
17 | /// @dev 1. Find the facet for the function that is called.
18 | /// @dev 2. Delegate the execution to the found facet via `delegatecall`.
19 | fallback() external payable {
20 | Diamond.DiamondStorage storage diamondStorage = Diamond.getDiamondStorage();
21 | // Check whether the data contains a "full" selector or it is empty.
22 | // Required because Diamond proxy finds a facet by function signature,
23 | // which is not defined for data length in range [1, 3].
24 | require(msg.data.length >= 4 || msg.data.length == 0, "Ut");
25 | // Get facet from function selector
26 | Diamond.SelectorToFacet memory facet = diamondStorage.selectorToFacet[msg.sig];
27 | address facetAddress = facet.facetAddress;
28 |
29 | require(facetAddress != address(0), "F"); // Proxy has no facet for this selector
30 | require(!diamondStorage.isFrozen || !facet.isFreezable, "q1"); // Facet is frozen
31 |
32 | assembly {
33 | // The pointer to the free memory slot
34 | let ptr := mload(0x40)
35 | // Copy function signature and arguments from calldata at zero position into memory at pointer position
36 | calldatacopy(ptr, 0, calldatasize())
37 | // Delegatecall method of the implementation contract returns 0 on error
38 | let result := delegatecall(gas(), facetAddress, ptr, calldatasize(), 0, 0)
39 | // Get the size of the last return data
40 | let size := returndatasize()
41 | // Copy the size length of bytes from return data at zero position to pointer position
42 | returndatacopy(ptr, 0, size)
43 | // Depending on the result value
44 | switch result
45 | case 0 {
46 | // End execution and revert state changes
47 | revert(ptr, size)
48 | }
49 | default {
50 | // Return data with length of size at pointers position
51 | return(ptr, size)
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/ethereum/contracts/zksync/facets/Base.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "../Storage.sol";
6 | import "../../common/ReentrancyGuard.sol";
7 | import "../../common/AllowListed.sol";
8 |
9 | /// @title Base contract containing functions accessible to the other facets.
10 | /// @author Matter Labs
11 | contract Base is ReentrancyGuard, AllowListed {
12 | AppStorage internal s;
13 |
14 | /// @notice Checks that the message sender is an active governor
15 | modifier onlyGovernor() {
16 | require(msg.sender == s.governor, "1g"); // only by governor
17 | _;
18 | }
19 |
20 | /// @notice Checks if validator is active
21 | modifier onlyValidator() {
22 | require(s.validators[msg.sender], "1h"); // validator is not active
23 | _;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/ethereum/contracts/zksync/facets/Governance.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "../interfaces/IGovernance.sol";
6 | import "../../common/L2ContractHelper.sol";
7 | import "./Base.sol";
8 |
9 | /// @title Governance Contract controls access rights for contract management.
10 | /// @author Matter Labs
11 | contract GovernanceFacet is Base, IGovernance {
12 | /// @notice Starts the transfer of governor rights. Only the current governor can propose a new pending one.
13 | /// @notice New governor can accept governor rights by calling `acceptGovernor` function.
14 | /// @param _newPendingGovernor Address of the new governor
15 | function setPendingGovernor(address _newPendingGovernor) external onlyGovernor {
16 | // Save previous value into the stack to put it into the event later
17 | address oldPendingGovernor = s.pendingGovernor;
18 |
19 | if (oldPendingGovernor != _newPendingGovernor) {
20 | // Change pending governor
21 | s.pendingGovernor = _newPendingGovernor;
22 |
23 | emit NewPendingGovernor(oldPendingGovernor, _newPendingGovernor);
24 | }
25 | }
26 |
27 | /// @notice Accepts transfer of admin rights. Only pending governor can accept the role.
28 | function acceptGovernor() external {
29 | address pendingGovernor = s.pendingGovernor;
30 | require(msg.sender == pendingGovernor, "n4"); // Only proposed by current governor address can claim the governor rights
31 |
32 | if (pendingGovernor != s.governor) {
33 | address previousGovernor = s.governor;
34 | s.governor = pendingGovernor;
35 | delete s.pendingGovernor;
36 |
37 | emit NewPendingGovernor(pendingGovernor, address(0));
38 | emit NewGovernor(previousGovernor, pendingGovernor);
39 | }
40 | }
41 |
42 | /// @notice Change validator status (active or not active)
43 | /// @param _validator Validator address
44 | /// @param _active Active flag
45 | function setValidator(address _validator, bool _active) external onlyGovernor {
46 | if (s.validators[_validator] != _active) {
47 | s.validators[_validator] = _active;
48 | emit ValidatorStatusUpdate(_validator, _active);
49 | }
50 | }
51 |
52 | /// @notice Change bootloader bytecode hash, that is used on L2
53 | /// @param _l2BootloaderBytecodeHash The hash of bootloader L2 bytecode
54 | function setL2BootloaderBytecodeHash(bytes32 _l2BootloaderBytecodeHash) external onlyGovernor {
55 | L2ContractHelper.validateBytecodeHash(_l2BootloaderBytecodeHash);
56 |
57 | // Save previous value into the stack to put it into the event later
58 | bytes32 previousBootloaderBytecodeHash = s.l2BootloaderBytecodeHash;
59 |
60 | if (previousBootloaderBytecodeHash != _l2BootloaderBytecodeHash) {
61 | // Change the bootloader bytecode hash
62 | s.l2BootloaderBytecodeHash = _l2BootloaderBytecodeHash;
63 | emit NewL2BootloaderBytecodeHash(previousBootloaderBytecodeHash, _l2BootloaderBytecodeHash);
64 | }
65 | }
66 |
67 | /// @notice Change default account bytecode hash, that is used on L2
68 | /// @param _l2DefaultAccountBytecodeHash The hash of default account L2 bytecode
69 | function setL2DefaultAccountBytecodeHash(bytes32 _l2DefaultAccountBytecodeHash) external onlyGovernor {
70 | L2ContractHelper.validateBytecodeHash(_l2DefaultAccountBytecodeHash);
71 |
72 | // Save previous value into the stack to put it into the event later
73 | bytes32 previousDefaultAccountBytecodeHash = s.l2DefaultAccountBytecodeHash;
74 |
75 | if (previousDefaultAccountBytecodeHash != _l2DefaultAccountBytecodeHash) {
76 | // Change the default account bytecode hash
77 | s.l2DefaultAccountBytecodeHash = _l2DefaultAccountBytecodeHash;
78 | emit NewL2DefaultAccountBytecodeHash(previousDefaultAccountBytecodeHash, _l2DefaultAccountBytecodeHash);
79 | }
80 | }
81 |
82 | /// @notice Change zk porter availability
83 | /// @param _zkPorterIsAvailable The availability of zk porter shard
84 | function setPorterAvailability(bool _zkPorterIsAvailable) external onlyGovernor {
85 | if (s.zkPorterIsAvailable != _zkPorterIsAvailable) {
86 | // Change the porter availability
87 | s.zkPorterIsAvailable = _zkPorterIsAvailable;
88 | emit IsPorterAvailableStatusUpdate(_zkPorterIsAvailable);
89 | }
90 | }
91 |
92 | /// @notice Change the address of the verifier smart contract
93 | /// @param _newVerifier Verifier smart contract address
94 | function setVerifier(Verifier _newVerifier) external onlyGovernor {
95 | Verifier oldVerifier = s.verifier;
96 | if (oldVerifier != _newVerifier) {
97 | s.verifier = _newVerifier;
98 | emit NewVerifier(address(oldVerifier), address(_newVerifier));
99 | }
100 | }
101 |
102 | /// @notice Change the verifier parameters
103 | /// @param _newVerifierParams New parameters for the verifier
104 | function setVerifierParams(VerifierParams calldata _newVerifierParams) external onlyGovernor {
105 | VerifierParams memory oldVerifierParams = s.verifierParams;
106 |
107 | s.verifierParams = _newVerifierParams;
108 | emit NewVerifierParams(oldVerifierParams, _newVerifierParams);
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/ethereum/contracts/zksync/interfaces/IDiamondCut.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8;
4 |
5 | import "../libraries/Diamond.sol";
6 |
7 | interface IDiamondCut {
8 | function proposeDiamondCut(Diamond.FacetCut[] calldata _facetCuts, address _initAddress) external;
9 |
10 | function cancelDiamondCutProposal() external;
11 |
12 | function executeDiamondCutProposal(Diamond.DiamondCutData calldata _diamondCut) external;
13 |
14 | function emergencyFreezeDiamond() external;
15 |
16 | function unfreezeDiamond() external;
17 |
18 | function approveEmergencyDiamondCutAsSecurityCouncilMember(bytes32 _diamondCutHash) external;
19 |
20 | event DiamondCutProposal(Diamond.FacetCut[] _facetCuts, address _initAddress);
21 |
22 | event DiamondCutProposalCancelation(uint256 currentProposalId, bytes32 indexed proposedDiamondCutHash);
23 |
24 | event DiamondCutProposalExecution(Diamond.DiamondCutData _diamondCut);
25 |
26 | event EmergencyFreeze();
27 |
28 | event Unfreeze(uint256 lastDiamondFreezeTimestamp);
29 |
30 | event EmergencyDiamondCutApproved(
31 | address indexed _address,
32 | uint256 currentProposalId,
33 | uint256 securityCouncilEmergencyApprovals,
34 | bytes32 indexed proposedDiamondCutHash
35 | );
36 | }
37 |
--------------------------------------------------------------------------------
/ethereum/contracts/zksync/interfaces/IExecutor.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8;
4 |
5 | interface IExecutor {
6 | /// @notice Rollup block stored data
7 | /// @param blockNumber Rollup block number
8 | /// @param blockHash Hash of L2 block
9 | /// @param indexRepeatedStorageChanges The serial number of the shortcut index that's used as a unique identifier for storage keys that were used twice or more
10 | /// @param numberOfLayer1Txs Number of priority operations to be processed
11 | /// @param priorityOperationsHash Hash of all priority operations from this block
12 | /// @param l2LogsTreeRoot Root hash of tree that contains L2 -> L1 messages from this block
13 | /// @param timestamp Rollup block timestamp, have the same format as Ethereum block constant
14 | /// @param commitment Verified input for the zkSync circuit
15 | struct StoredBlockInfo {
16 | uint64 blockNumber;
17 | bytes32 blockHash;
18 | uint64 indexRepeatedStorageChanges;
19 | uint256 numberOfLayer1Txs;
20 | bytes32 priorityOperationsHash;
21 | bytes32 l2LogsTreeRoot;
22 | uint256 timestamp;
23 | bytes32 commitment;
24 | }
25 |
26 | /// @notice Data needed to commit new block
27 | /// @param blockNumber Number of the committed block
28 | /// @param timestamp Unix timestamp denoting the start of the block execution
29 | /// @param indexRepeatedStorageChanges The serial number of the shortcut index that's used as a unique identifier for storage keys that were used twice or more
30 | /// @param newStateRoot The state root of the full state tree
31 | /// @param ergsPerPubdataByteInBlock Price in ergs per one byte of published pubdata in block
32 | /// @param numberOfLayer1Txs Number of priority operations to be processed
33 | /// @param l2LogsTreeRoot The root hash of the tree that contains all L2 -> L1 logs in the block
34 | /// @param priorityOperationsHash Hash of all priority operations from this block
35 | /// @param initialStorageChanges Storage write access as a concatenation key-value
36 | /// @param repeatedStorageChanges Storage write access as a concatenation index-value
37 | /// @param l2Logs concatenation of all L2 -> L1 logs in the block
38 | /// @param l2ArbitraryLengthMessages array of hash preimages that were sent as value of L2 logs by special system L2 contract
39 | /// @param factoryDeps array of l2 bytecodes that were marked as known on L2
40 | struct CommitBlockInfo {
41 | uint64 blockNumber;
42 | uint64 timestamp;
43 | uint64 indexRepeatedStorageChanges;
44 | bytes32 newStateRoot;
45 | uint256 numberOfLayer1Txs;
46 | bytes32 l2LogsTreeRoot;
47 | bytes32 priorityOperationsHash;
48 | bytes initialStorageChanges;
49 | bytes repeatedStorageChanges;
50 | bytes l2Logs;
51 | bytes[] l2ArbitraryLengthMessages;
52 | bytes[] factoryDeps;
53 | }
54 |
55 | /// @notice Recursive proof input data (individual commitments are constructed onchain)
56 | /// TODO: The verifier integration is not finished yet, change the structure for compatibility later
57 | struct ProofInput {
58 | uint256[] recurisiveAggregationInput;
59 | uint256[] serializedProof;
60 | }
61 |
62 | function commitBlocks(StoredBlockInfo calldata _lastCommittedBlockData, CommitBlockInfo[] calldata _newBlocksData)
63 | external;
64 |
65 | function proveBlocks(
66 | StoredBlockInfo calldata _prevBlock,
67 | StoredBlockInfo[] calldata _committedBlocks,
68 | ProofInput calldata _proof
69 | ) external;
70 |
71 | function executeBlocks(StoredBlockInfo[] calldata _blocksData) external;
72 |
73 | function revertBlocks(uint256 _newLastBlock) external;
74 |
75 | /// @notice Event emitted when a block is committed
76 | event BlockCommit(uint256 indexed blockNumber, bytes32 indexed blockHash, bytes32 indexed commitment);
77 |
78 | /// @notice Event emitted when blocks are verified
79 | event BlocksVerification(uint256 indexed previousLastVerifiedBlock, uint256 indexed currentLastVerifiedBlock);
80 |
81 | /// @notice Event emitted when a block is executed
82 | event BlockExecution(uint256 indexed blockNumber, bytes32 indexed blockHash, bytes32 indexed commitment);
83 |
84 | /// @notice Event emitted when blocks are reverted
85 | event BlocksRevert(uint256 totalBlocksCommitted, uint256 totalBlocksVerified, uint256 totalBlocksExecuted);
86 | }
87 |
--------------------------------------------------------------------------------
/ethereum/contracts/zksync/interfaces/IGetters.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "../libraries/PriorityQueue.sol";
6 |
7 | interface IGetters {
8 | /*//////////////////////////////////////////////////////////////
9 | CUSTOM GETTERS
10 | //////////////////////////////////////////////////////////////*/
11 |
12 | function getVerifier() external view returns (address);
13 |
14 | function getGovernor() external view returns (address);
15 |
16 | function getPendingGovernor() external view returns (address);
17 |
18 | function getTotalBlocksCommitted() external view returns (uint256);
19 |
20 | function getTotalBlocksVerified() external view returns (uint256);
21 |
22 | function getTotalBlocksExecuted() external view returns (uint256);
23 |
24 | function getTotalPriorityTxs() external view returns (uint256);
25 |
26 | function getFirstUnprocessedPriorityTx() external view returns (uint256);
27 |
28 | function getPriorityQueueSize() external view returns (uint256);
29 |
30 | function priorityQueueFrontOperation() external view returns (PriorityOperation memory);
31 |
32 | function isValidator(address _address) external view returns (bool);
33 |
34 | function l2LogsRootHash(uint256 _blockNumber) external view returns (bytes32 hash);
35 |
36 | function storedBlockHash(uint256 _blockNumber) external view returns (bytes32);
37 |
38 | function isDiamondStorageFrozen() external view returns (bool);
39 |
40 | function getProposedDiamondCutHash() external view returns (bytes32);
41 |
42 | function getProposedDiamondCutTimestamp() external view returns (uint256);
43 |
44 | function getLastDiamondFreezeTimestamp() external view returns (uint256);
45 |
46 | function getCurrentProposalId() external view returns (uint256);
47 |
48 | function getSecurityCouncilEmergencyApprovals() external view returns (uint256);
49 |
50 | function isSecurityCouncilMember(address _address) external view returns (bool);
51 |
52 | function getSecurityCouncilMemberLastApprovedProposalId(address _address) external view returns (uint256);
53 |
54 | /*//////////////////////////////////////////////////////////////
55 | DIAMOND LOUPE
56 | //////////////////////////////////////////////////////////////*/
57 |
58 | /// @notice Faсet structure compatible with the EIP-2535 diamond loupe
59 | /// @param addr The address of the facet contract
60 | /// @param selectors The NON-sorted array with selectors associated with facet
61 | struct Facet {
62 | address addr;
63 | bytes4[] selectors;
64 | }
65 |
66 | function facets() external view returns (Facet[] memory);
67 |
68 | function facetFunctionSelectors(address _facet) external view returns (bytes4[] memory);
69 |
70 | function facetAddresses() external view returns (address[] memory facets);
71 |
72 | function facetAddress(bytes4 _selector) external view returns (address facet);
73 |
74 | function isFunctionFreezable(bytes4 _selector) external view returns (bool);
75 | }
76 |
--------------------------------------------------------------------------------
/ethereum/contracts/zksync/interfaces/IGovernance.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8;
4 |
5 | import "../Verifier.sol";
6 | import "../Storage.sol";
7 |
8 | interface IGovernance {
9 | function setPendingGovernor(address _newPendingGovernor) external;
10 |
11 | function acceptGovernor() external;
12 |
13 | function setValidator(address _validator, bool _active) external;
14 |
15 | function setL2BootloaderBytecodeHash(bytes32 _l2BootloaderBytecodeHash) external;
16 |
17 | function setL2DefaultAccountBytecodeHash(bytes32 _l2DefaultAccountBytecodeHash) external;
18 |
19 | function setPorterAvailability(bool _isPorterAvailable) external;
20 |
21 | function setVerifier(Verifier _newVerifier) external;
22 |
23 | function setVerifierParams(VerifierParams calldata _newVerifierParams) external;
24 |
25 | /// @notice Сhanges to the bytecode that is used in L2 as a bootloader (start program)
26 | event NewL2BootloaderBytecodeHash(bytes32 indexed previousBytecodeHash, bytes32 indexed newBytecodeHash);
27 |
28 | /// @notice Сhanges to the bytecode that is used in L2 as a default account
29 | event NewL2DefaultAccountBytecodeHash(bytes32 indexed previousBytecodeHash, bytes32 indexed newBytecodeHash);
30 |
31 | /// @notice Porter availability status changes
32 | event IsPorterAvailableStatusUpdate(bool isPorterAvailable);
33 |
34 | /// @notice Validator's status changed
35 | event ValidatorStatusUpdate(address indexed validatorAddress, bool isActive);
36 |
37 | /// @notice pendingGovernor is changed
38 | /// @dev Also emitted when new governor is accepted and in this case, `newPendingGovernor` would be zero address
39 | event NewPendingGovernor(address indexed oldPendingGovernor, address indexed newPendingGovernor);
40 |
41 | /// @notice Governor changed
42 | event NewGovernor(address indexed oldGovernor, address indexed newGovernor);
43 |
44 | /// @notice Verifier address changed
45 | event NewVerifier(address indexed oldVerifier, address indexed newVerifier);
46 |
47 | /// @notice Verifier address changed
48 | event NewVerifierParams(VerifierParams oldVerifierParams, VerifierParams newVerifierParams);
49 | }
50 |
--------------------------------------------------------------------------------
/ethereum/contracts/zksync/interfaces/IZkSync.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8;
4 |
5 | import "./IMailbox.sol";
6 | import "./IGovernance.sol";
7 | import "./IExecutor.sol";
8 | import "./IDiamondCut.sol";
9 | import "./IGetters.sol";
10 |
11 | interface IZkSync is IMailbox, IGovernance, IExecutor, IDiamondCut, IGetters {}
12 |
--------------------------------------------------------------------------------
/ethereum/contracts/zksync/libraries/Merkle.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "../../common/libraries/UncheckedMath.sol";
6 |
7 | /// @author Matter Labs
8 | library Merkle {
9 | using UncheckedMath for uint256;
10 |
11 | /// @dev Calculate Merkle root by the provided Merkle proof.
12 | /// NOTE: When using this function, check that the _path length is equal to the tree height to prevent shorter/longer paths attack
13 | /// @param _path Merkle path from the leaf to the root
14 | /// @param _index Leaf index in the tree
15 | /// @param _itemHash Hash of leaf content
16 | /// @return The Merkle root
17 | function calculateRoot(
18 | bytes32[] calldata _path,
19 | uint256 _index,
20 | bytes32 _itemHash
21 | ) internal pure returns (bytes32) {
22 | uint256 pathLength = _path.length;
23 | require(pathLength > 0, "xc");
24 | require(pathLength < 256, "bt");
25 | require(_index < 2**pathLength, "pz");
26 |
27 | bytes32 currentHash = _itemHash;
28 | for (uint256 i = 0; i < pathLength; i = i.uncheckedInc()) {
29 | if (_index % 2 == 0) {
30 | currentHash = keccak256(abi.encode(currentHash, _path[i]));
31 | } else {
32 | currentHash = keccak256(abi.encode(_path[i], currentHash));
33 | }
34 | _index /= 2;
35 | }
36 |
37 | return currentHash;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/ethereum/contracts/zksync/libraries/PriorityQueue.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | /// @notice The structure that contains meta information of the L2 transaction that was requested from L1
6 | /// @dev The weird size of fields was selected specifically to minimize the structure storage size
7 | /// @param canonicalTxHash Hashed L2 transaction data that is needed to process it
8 | /// @param expirationBlock Expiration block number (ETH block) for this request (must be satisfied before)
9 | /// @param layer2Tip Additional payment to the validator as an incentive to perform the operation
10 | struct PriorityOperation {
11 | bytes32 canonicalTxHash;
12 | uint64 expirationBlock;
13 | uint192 layer2Tip;
14 | }
15 |
16 | /// @author Matter Labs
17 | /// @dev The library provides the API to interact with the priority queue container
18 | /// @dev Order of processing operations from queue - FIFO (Fist in - first out)
19 | library PriorityQueue {
20 | using PriorityQueue for Queue;
21 |
22 | /// @notice Container that stores priority operations
23 | /// @param data The inner mapping that saves priority operation by its index
24 | /// @param head The pointer to the first unprocessed priority operation
25 | /// @param tail The pointer to the last added priority operation
26 | struct Queue {
27 | mapping(uint256 => PriorityOperation) data;
28 | uint256 tail;
29 | uint256 head;
30 | }
31 |
32 | /// @notice Returns zero if and only if no operations were processed from the queue
33 | /// @return Index of the oldest priority operation that wasn't processed yet
34 | function getFirstUnprocessedPriorityTx(Queue storage _queue) internal view returns (uint256) {
35 | return _queue.head;
36 | }
37 |
38 | /// @return The total number of priority operations that were added to the priority queue, including all processed ones
39 | function getTotalPriorityTxs(Queue storage _queue) internal view returns (uint256) {
40 | return _queue.tail;
41 | }
42 |
43 | /// @return The total number of unprocessed priority operations in a priority queue
44 | function getSize(Queue storage _queue) internal view returns (uint256) {
45 | return uint256(_queue.tail - _queue.head);
46 | }
47 |
48 | /// @return Whether the priority queue contains no operations
49 | function isEmpty(Queue storage _queue) internal view returns (bool) {
50 | return _queue.tail == _queue.head;
51 | }
52 |
53 | /// @notice Add the priority operation to the end of the priority queue
54 | function pushBack(Queue storage _queue, PriorityOperation memory _operation) internal {
55 | // Save value into the stack to avoid double reading from the storage
56 | uint256 tail = _queue.tail;
57 |
58 | _queue.data[tail] = _operation;
59 | _queue.tail = tail + 1;
60 | }
61 |
62 | /// @return The first unprocessed priority operation from the queue
63 | function front(Queue storage _queue) internal view returns (PriorityOperation memory) {
64 | require(!_queue.isEmpty(), "D"); // priority queue is empty
65 |
66 | return _queue.data[_queue.head];
67 | }
68 |
69 | /// @notice Remove the first unprocessed priority operation from the queue
70 | /// @return priorityOperation that was popped from the priority queue
71 | function popFront(Queue storage _queue) internal returns (PriorityOperation memory priorityOperation) {
72 | require(!_queue.isEmpty(), "s"); // priority queue is empty
73 |
74 | // Save value into the stack to avoid double reading from the storage
75 | uint256 head = _queue.head;
76 |
77 | priorityOperation = _queue.data[head];
78 | delete _queue.data[head];
79 | _queue.head = head + 1;
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/ethereum/contracts/zksync/libraries/TranscriptLib.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import "./PairingsBn254.sol";
6 |
7 | library TranscriptLib {
8 | // flip 0xe000000000000000000000000000000000000000000000000000000000000000;
9 | uint256 constant FR_MASK = 0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
10 |
11 | uint32 constant DST_0 = 0;
12 | uint32 constant DST_1 = 1;
13 | uint32 constant DST_CHALLENGE = 2;
14 |
15 | struct Transcript {
16 | bytes32 state_0;
17 | bytes32 state_1;
18 | uint32 challenge_counter;
19 | }
20 |
21 | function new_transcript() internal pure returns (Transcript memory t) {
22 | t.state_0 = bytes32(0);
23 | t.state_1 = bytes32(0);
24 | t.challenge_counter = 0;
25 | }
26 |
27 | function update_with_u256(Transcript memory self, uint256 value) internal pure {
28 | bytes32 old_state_0 = self.state_0;
29 | self.state_0 = keccak256(abi.encodePacked(DST_0, old_state_0, self.state_1, value));
30 | self.state_1 = keccak256(abi.encodePacked(DST_1, old_state_0, self.state_1, value));
31 | }
32 |
33 | function update_with_fr(Transcript memory self, PairingsBn254.Fr memory value) internal pure {
34 | update_with_u256(self, value.value);
35 | }
36 |
37 | function update_with_g1(Transcript memory self, PairingsBn254.G1Point memory p) internal pure {
38 | update_with_u256(self, p.X);
39 | update_with_u256(self, p.Y);
40 | }
41 |
42 | function get_challenge(Transcript memory self) internal pure returns (PairingsBn254.Fr memory challenge) {
43 | bytes32 query = keccak256(abi.encodePacked(DST_CHALLENGE, self.state_0, self.state_1, self.challenge_counter));
44 | self.challenge_counter += 1;
45 | challenge = PairingsBn254.Fr({value: uint256(query) & FR_MASK});
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/ethereum/hardhat.config.ts:
--------------------------------------------------------------------------------
1 | import '@nomiclabs/hardhat-solpp';
2 | import '@nomiclabs/hardhat-ethers';
3 | import "hardhat-gas-reporter";
4 | import 'hardhat-typechain';
5 | import "solidity-coverage";
6 |
7 | const prodConfig = {
8 | UPGRADE_NOTICE_PERIOD: 0,
9 | // PRIORITY_EXPIRATION: 101,
10 | // NOTE: Should be greater than 0, otherwise zero approvals will be enough to make an instant upgrade!
11 | SECURITY_COUNCIL_APPROVALS_FOR_EMERGENCY_UPGRADE: 1,
12 | DUMMY_VERIFIER: false
13 | };
14 | const testConfig = {
15 | UPGRADE_NOTICE_PERIOD: 0,
16 | PRIORITY_EXPIRATION: 101,
17 | SECURITY_COUNCIL_APPROVALS_FOR_EMERGENCY_UPGRADE: 2,
18 | DUMMY_VERIFIER: true
19 | };
20 |
21 | export default {
22 | solidity: {
23 | version: '0.8.17',
24 | settings: {
25 | optimizer: {
26 | enabled: true,
27 | runs: 200
28 | },
29 | outputSelection: {
30 | '*': {
31 | '*': ['storageLayout']
32 | }
33 | }
34 | }
35 | },
36 | contractSizer: {
37 | runOnCompile: false
38 | },
39 | paths: {
40 | sources: './contracts'
41 | },
42 | solpp: {
43 | defs: (() => {
44 | if (process.env.CONTRACT_TESTS) {
45 | return testConfig;
46 | }
47 | return prodConfig;
48 | })()
49 | }
50 | };
51 |
--------------------------------------------------------------------------------
/ethereum/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "l1-zksync-contracts",
3 | "version": "0.1.0",
4 | "license": "MIT",
5 | "devDependencies": {
6 | "@nomiclabs/hardhat-ethers": "^2.0.0",
7 | "@nomiclabs/hardhat-etherscan": "^2.1.0",
8 | "@nomiclabs/hardhat-solpp": "^2.0.0",
9 | "@openzeppelin/contracts": "4.6.0",
10 | "@openzeppelin/contracts-upgradeable": "4.6.0",
11 | "@typechain/ethers-v5": "^2.0.0",
12 | "@types/chai": "^4.2.21",
13 | "@types/chai-as-promised": "^7.1.4",
14 | "@types/mocha": "^8.2.3",
15 | "chai": "^4.3.4",
16 | "chai-as-promised": "^7.1.1",
17 | "ethers": "~5.5.0",
18 | "hardhat": "^2.7.0",
19 | "hardhat-contract-sizer": "^2.0.2",
20 | "hardhat-gas-reporter": "^1.0.7",
21 | "hardhat-typechain": "^0.3.3",
22 | "merkletreejs": "^0.2.32",
23 | "mocha": "^9.0.2",
24 | "openzeppelin-solidity": "^4.1.0",
25 | "path": "^0.12.7",
26 | "prettier": "^1.18.2",
27 | "prettier-plugin-solidity": "^1.0.0-alpha.27",
28 | "solidity-coverage": "^0.8.2",
29 | "ts-generator": "^0.1.1",
30 | "ts-node": "^10.1.0",
31 | "typechain": "^4.0.0",
32 | "typescript": "^4.3.5"
33 | },
34 | "scripts": {
35 | "build": "hardhat compile",
36 | "clean": "hardhat clean",
37 | "coverage": "CONTRACT_TESTS=1 yarn run hardhat coverage --network hardhat",
38 | "test": "CONTRACT_TESTS=1 yarn run hardhat test --network hardhat"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/ethereum/src.ts/diamondCut.ts:
--------------------------------------------------------------------------------
1 | import { Interface } from 'ethers/lib/utils';
2 |
3 | export enum Action {
4 | Add = 0,
5 | Replace = 1,
6 | Remove = 2
7 | }
8 |
9 | export interface FacetCut {
10 | facet: string;
11 | selectors: string[];
12 | action: Action;
13 | isFreezable: boolean;
14 | }
15 |
16 | export interface DiamondCut {
17 | facetCuts: FacetCut[];
18 | initAddress: string;
19 | initCalldata: string;
20 | }
21 |
22 | export function facetCut(address: string, contract: Interface, action: Action, isFreezable: boolean): FacetCut {
23 | return {
24 | facet: address,
25 | selectors: getAllSelectors(contract),
26 | action,
27 | isFreezable
28 | };
29 | }
30 |
31 | export function diamondCut(facetCuts: FacetCut[], initAddress: string, initCalldata: string): DiamondCut {
32 | return {
33 | facetCuts,
34 | initAddress,
35 | initCalldata
36 | };
37 | }
38 |
39 | export function getAllSelectors(contractInterface: Interface) {
40 | return Object.keys(contractInterface.functions).map((signature) => contractInterface.getSighash(signature));
41 | }
42 |
--------------------------------------------------------------------------------
/ethereum/test/unit_tests/governance_test.ts:
--------------------------------------------------------------------------------
1 | import { expect } from 'chai';
2 | import * as hardhat from 'hardhat';
3 | import { GovernanceFacetTest, GovernanceFacetTestFactory } from '../../typechain';
4 | import { getCallRevertReason } from './utils';
5 | import * as ethers from 'ethers';
6 |
7 | function randomAddress() {
8 | return ethers.utils.hexlify(ethers.utils.randomBytes(20));
9 | }
10 |
11 | describe('Governance facet tests', function () {
12 | let governanceTest: GovernanceFacetTest;
13 | let randomSigner: ethers.Signer;
14 |
15 | before(async () => {
16 | const contractFactory = await hardhat.ethers.getContractFactory('GovernanceFacetTest');
17 | const contract = await contractFactory.deploy();
18 | governanceTest = GovernanceFacetTestFactory.connect(contract.address, contract.signer);
19 | randomSigner = (await hardhat.ethers.getSigners())[1];
20 | });
21 |
22 | it('governor successfully set validator', async () => {
23 | const validatorAddress = randomAddress();
24 | await governanceTest.setValidator(validatorAddress, true);
25 |
26 | const isValidator = await governanceTest.isValidator(validatorAddress);
27 | expect(isValidator).to.equal(true);
28 | });
29 |
30 | it('random account fails to set validator', async () => {
31 | const validatorAddress = randomAddress();
32 | const revertReason = await getCallRevertReason(
33 | governanceTest.connect(randomSigner).setValidator(validatorAddress, true)
34 | );
35 | expect(revertReason).equal('1g');
36 | });
37 |
38 | describe('change governor', function () {
39 | let newGovernor: ethers.Signer;
40 |
41 | before(async () => {
42 | newGovernor = (await hardhat.ethers.getSigners())[2];
43 | });
44 |
45 | it('set pending governor', async () => {
46 | const proposedGovernor = await randomSigner.getAddress();
47 | await governanceTest.setPendingGovernor(proposedGovernor);
48 |
49 | const pendingGovernor = await governanceTest.getPendingGovernor();
50 | expect(pendingGovernor).equal(proposedGovernor);
51 | });
52 |
53 | it('reset pending governor', async () => {
54 | const proposedGovernor = await newGovernor.getAddress();
55 | await governanceTest.setPendingGovernor(proposedGovernor);
56 |
57 | const pendingGovernor = await governanceTest.getPendingGovernor();
58 | expect(pendingGovernor).equal(proposedGovernor);
59 | });
60 |
61 | it('failed to accept governor from not proposed account', async () => {
62 | const revertReason = await getCallRevertReason(governanceTest.connect(randomSigner).acceptGovernor());
63 | expect(revertReason).equal('n4');
64 | });
65 |
66 | it('accept governor from proposed account', async () => {
67 | await governanceTest.connect(newGovernor).acceptGovernor();
68 |
69 | const governor = await governanceTest.getGovernor();
70 | expect(governor).equal(await newGovernor.getAddress());
71 | });
72 | });
73 | });
74 |
--------------------------------------------------------------------------------
/ethereum/test/unit_tests/mailbox_test.ts:
--------------------------------------------------------------------------------
1 | import { expect } from 'chai';
2 | import * as hardhat from 'hardhat';
3 | import { Action, facetCut, diamondCut } from '../../src.ts/diamondCut';
4 | import { MailboxFacet, MailboxFacetFactory, DiamondInitFactory, AllowListFactory } from '../../typechain';
5 | import { DEFAULT_REVERT_REASON, getCallRevertReason } from './utils';
6 | import * as ethers from 'ethers';
7 |
8 | describe('Mailbox tests', function () {
9 | let mailbox: MailboxFacet;
10 | const MAX_CODE_LEN_WORDS = (1 << 16) - 1;
11 | const MAX_CODE_LEN_BYTES = MAX_CODE_LEN_WORDS * 32;
12 |
13 | before(async () => {
14 | const mailboxFactory = await hardhat.ethers.getContractFactory('MailboxFacet');
15 | const mailboxContract = await mailboxFactory.deploy();
16 | const mailboxFacet = MailboxFacetFactory.connect(mailboxContract.address, mailboxContract.signer);
17 |
18 | const allowListFactory = await hardhat.ethers.getContractFactory('AllowList');
19 | const allowListContract = await allowListFactory.deploy(await allowListFactory.signer.getAddress());
20 | const allowList = AllowListFactory.connect(allowListContract.address, allowListContract.signer);
21 |
22 | // Note, that while this testsuit is focused on testing MailboxFaucet only,
23 | // we still need to initialize its storage via DiamondProxy
24 | const diamondInitFactory = await hardhat.ethers.getContractFactory('DiamondInit');
25 | const diamondInitContract = await diamondInitFactory.deploy();
26 | const diamondInit = DiamondInitFactory.connect(diamondInitContract.address, diamondInitContract.signer);
27 |
28 | const dummyHash = new Uint8Array(32);
29 | dummyHash.set([1, 0, 0, 1]);
30 | const diamondInitData = diamondInit.interface.encodeFunctionData('initialize', [
31 | ethers.constants.AddressZero,
32 | ethers.constants.AddressZero,
33 | ethers.constants.AddressZero,
34 | ethers.constants.HashZero,
35 | 0,
36 | ethers.constants.HashZero,
37 | allowList.address,
38 | {
39 | recursionCircuitsSetVksHash: ethers.constants.HashZero,
40 | recursionLeafLevelVkHash: ethers.constants.HashZero,
41 | recursionNodeLevelVkHash: ethers.constants.HashZero
42 | },
43 | false,
44 | dummyHash,
45 | dummyHash
46 | ]);
47 |
48 | const facetCuts = [facetCut(mailboxFacet.address, mailboxFacet.interface, Action.Add, false)];
49 | const diamondCutData = diamondCut(facetCuts, diamondInit.address, diamondInitData);
50 |
51 | const contractFactory = await hardhat.ethers.getContractFactory('DiamondProxy');
52 | const chainId = hardhat.network.config.chainId;
53 | const contract = await contractFactory.deploy(chainId, diamondCutData);
54 |
55 | await (await allowList.setPublicAccess(contract.address, true)).wait();
56 |
57 | mailbox = MailboxFacetFactory.connect(contract.address, mailboxContract.signer);
58 | });
59 |
60 | it('Should accept correctly formatted bytecode', async () => {
61 | const revertReason = await getCallRevertReason(
62 | mailbox.requestL2Transaction(ethers.constants.AddressZero, 0, '0x', 100000, [new Uint8Array(32)])
63 | );
64 |
65 | expect(revertReason).equal(DEFAULT_REVERT_REASON);
66 | });
67 |
68 | it('Should not accept bytecode is not chunkable', async () => {
69 | const revertReason = await getCallRevertReason(
70 | mailbox.requestL2Transaction(ethers.constants.AddressZero, 0, '0x', 100000, [new Uint8Array(63)])
71 | );
72 |
73 | expect(revertReason).equal('po');
74 | });
75 |
76 | it('Should not accept bytecode of even length in words', async () => {
77 | const revertReason = await getCallRevertReason(
78 | mailbox.requestL2Transaction(ethers.constants.AddressZero, 0, '0x', 100000, [new Uint8Array(64)])
79 | );
80 |
81 | expect(revertReason).equal('pr');
82 | });
83 |
84 | it('Should not accept bytecode that is too long', async () => {
85 | const revertReason = await getCallRevertReason(
86 | mailbox.requestL2Transaction(ethers.constants.AddressZero, 0, '0x', 100000, [
87 | // "+64" to keep the length in words odd and bytecode chunkable
88 | new Uint8Array(MAX_CODE_LEN_BYTES + 64)
89 | ])
90 | );
91 |
92 | expect(revertReason).equal('pp');
93 | });
94 | });
95 |
--------------------------------------------------------------------------------
/ethereum/test/unit_tests/merkle_test.ts:
--------------------------------------------------------------------------------
1 | import { expect } from 'chai';
2 | import * as hardhat from 'hardhat';
3 | import { MerkleTest, MerkleTestFactory } from '../../typechain';
4 | import { MerkleTree } from 'merkletreejs';
5 | import { getCallRevertReason } from './utils';
6 | import * as ethers from 'ethers';
7 |
8 | describe('Merkle lib tests', function () {
9 | let merkleTest: MerkleTest;
10 |
11 | before(async () => {
12 | const contractFactory = await hardhat.ethers.getContractFactory('MerkleTest');
13 | const contract = await contractFactory.deploy();
14 | merkleTest = MerkleTestFactory.connect(contract.address, contract.signer);
15 | });
16 |
17 | describe('should calculate root correctly', function () {
18 | let elements;
19 | let merkleTree;
20 |
21 | before(async () => {
22 | elements = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
23 | .split('')
24 | .map((val) => ethers.utils.toUtf8Bytes(val));
25 | merkleTree = new MerkleTree(elements, ethers.utils.keccak256, { hashLeaves: true });
26 | });
27 |
28 | it('first element', async () => {
29 | const index = 0;
30 | const leaf = ethers.utils.keccak256(elements[index]);
31 | const proof = merkleTree.getHexProof(leaf, index);
32 |
33 | const rootFromContract = await merkleTest.calculateRoot(proof, index, leaf);
34 | expect(rootFromContract).to.equal(merkleTree.getHexRoot());
35 | });
36 |
37 | it('middle element', async () => {
38 | const index = Math.ceil(elements.length / 2);
39 | const leaf = ethers.utils.keccak256(elements[index]);
40 | const proof = merkleTree.getHexProof(leaf, index);
41 |
42 | const rootFromContract = await merkleTest.calculateRoot(proof, index, leaf);
43 | expect(rootFromContract).to.equal(merkleTree.getHexRoot());
44 | });
45 |
46 | it('last element', async () => {
47 | const index = elements.length - 1;
48 | const leaf = ethers.utils.keccak256(elements[index]);
49 | const proof = merkleTree.getHexProof(leaf, index);
50 |
51 | const rootFromContract = await merkleTest.calculateRoot(proof, index, leaf);
52 | expect(rootFromContract).to.equal(merkleTree.getHexRoot());
53 | });
54 | });
55 |
56 | it('shoul fail trying calculate root with empty path', async () => {
57 | const revertReason = await getCallRevertReason(merkleTest.calculateRoot([], 0, ethers.constants.HashZero));
58 | expect(revertReason).equal('xc');
59 | });
60 |
61 | it('shoul fail trying calculate root with too big leaf index', async () => {
62 | const bigIndex = ethers.BigNumber.from(2).pow(255);
63 | const revertReason = await getCallRevertReason(
64 | merkleTest.calculateRoot([ethers.constants.HashZero], bigIndex, ethers.constants.HashZero)
65 | );
66 | expect(revertReason).equal('pz');
67 | });
68 | });
69 |
--------------------------------------------------------------------------------
/ethereum/test/unit_tests/unsafe_bytes_test.ts:
--------------------------------------------------------------------------------
1 | import { expect } from 'chai';
2 | import { BigNumber } from 'ethers';
3 | import * as hardhat from 'hardhat';
4 | import { ethers } from 'hardhat';
5 | import { UnsafeBytesTest, UnsafeBytesTestFactory } from '../../typechain';
6 |
7 | async function expectReadValues(contract: UnsafeBytesTest, types: string[], values: any[]) {
8 | // `solidityPack` checks that arrays have the same length.
9 | const bytesData = ethers.utils.solidityPack(types, values);
10 |
11 | let offset = BigNumber.from(0);
12 | for (let i = 0; i < types.length; ++i) {
13 | let readValue;
14 |
15 | switch (types[i]) {
16 | case 'address': {
17 | ({ readValue, offset } = await contract.readAddress(bytesData, offset));
18 | break;
19 | }
20 | case 'uint32': {
21 | ({ readValue, offset } = await contract.readUint32(bytesData, offset));
22 | break;
23 | }
24 | case 'uint256': {
25 | ({ readValue, offset } = await contract.readUint256(bytesData, offset));
26 | break;
27 | }
28 | case 'bytes32': {
29 | ({ readValue, offset } = await contract.readBytes32(bytesData, offset));
30 | break;
31 | }
32 | }
33 | expect(ethers.BigNumber.from(readValue).eq(ethers.BigNumber.from(values[i]))).equal(true);
34 | }
35 | }
36 |
37 | describe('Unsafe bytes tests', function () {
38 | let testContract: UnsafeBytesTest;
39 |
40 | before(async () => {
41 | const unsafeBytesTestFactory = await hardhat.ethers.getContractFactory('UnsafeBytesTest');
42 | const unsafeBytesTestContract = await unsafeBytesTestFactory.deploy();
43 | testContract = UnsafeBytesTestFactory.connect(unsafeBytesTestContract.address, unsafeBytesTestContract.signer);
44 | });
45 |
46 | it('Read packed array', async () => {
47 | const types = ['address', 'address', 'uint256', 'uint32', 'uint32', 'address', 'bytes32', 'address'];
48 | const values = [
49 | '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
50 | '0x7aFd58312784ACf80E2ba97Dd84Ff2bADeA9e4A2',
51 | '0x15',
52 | '0xffffffff',
53 | '0x16',
54 | '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee',
55 | '0x4845bfb858e60647a4f22f02d3712a20fa6b557288dbe97b6ae719390482ef4b',
56 | '0xaBEA9132b05A70803a4E85094fD0e1800777fBEF'
57 | ];
58 | await expectReadValues(testContract, types, values);
59 | });
60 | });
61 |
--------------------------------------------------------------------------------
/ethereum/test/unit_tests/utils.ts:
--------------------------------------------------------------------------------
1 | import { BigNumber } from 'ethers';
2 |
3 | export const IERC20_INTERFACE = require('@openzeppelin/contracts/build/contracts/IERC20');
4 | export const DEFAULT_REVERT_REASON = 'VM did not revert';
5 |
6 | /// Set of parameters that are needed to test the processing of priority operations
7 | export class DummyOp {
8 | constructor(public id: number, public expirationBlock: BigNumber, public layer2Tip: number) {}
9 | }
10 |
11 | export async function getCallRevertReason(promise) {
12 | let revertReason = DEFAULT_REVERT_REASON;
13 | try {
14 | await promise;
15 | } catch (e) {
16 | try {
17 | revertReason = e.message.substring(e.message.lastIndexOf(' ') + 1).replace(/["']/g, '');
18 | } catch (_) {
19 | throw e;
20 | }
21 | }
22 | return revertReason;
23 | }
24 |
--------------------------------------------------------------------------------
/ethereum/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "types": [
4 | "node",
5 | "mocha"
6 | ],
7 | "downlevelIteration": true,
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ethereum/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultSeverity": "warn",
3 | "extends": [
4 | "tslint:recommended"
5 | ],
6 | "jsRules": {},
7 | "rules": {
8 | "no-console": false
9 | },
10 | "rulesDirectory": []
11 | }
12 |
--------------------------------------------------------------------------------
/zksync/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /artifacts
3 | /artifacts-zk
4 | /cache
5 | /cache-zk
6 | /typechain
7 |
--------------------------------------------------------------------------------
/zksync/.solhint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "solhint:default",
3 | "plugins": ["prettier"],
4 | "rules": {
5 | "prettier/prettier": "error",
6 | "no-inline-assembly": false
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/zksync/contracts/ExternalDecoder.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | /// @author Matter Labs
6 | /// @dev The library with which it is possible to use `abi.decode` with error handling.
7 | /// @dev All functions in this library are public and should be called in a try-catch block to handle errors.
8 | library ExternalDecoder {
9 | /// @dev External function to decode a string from bytes.
10 | function decodeString(bytes memory _input) external pure returns (string memory result) {
11 | (result) = abi.decode(_input, (string));
12 | }
13 |
14 | /// @dev External function to decode a uint8 from bytes.
15 | function decodeUint8(bytes memory _input) external pure returns (uint8 result) {
16 | (result) = abi.decode(_input, (uint8));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/zksync/contracts/L2ContractHelper.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | interface IL2Messenger {
6 | function sendToL1(bytes memory _message) external returns (bytes32);
7 | }
8 |
9 | interface IContractDeployer {
10 | function create2(
11 | bytes32 _salt,
12 | bytes32 _bytecodeHash,
13 | bytes calldata _input
14 | ) external;
15 | }
16 |
17 | uint160 constant SYSTEM_CONTRACTS_OFFSET = 0x8000; // 2^15
18 |
19 | address constant BOOTLOADER_ADDRESS = address(SYSTEM_CONTRACTS_OFFSET + 0x01);
20 | address constant VALUE_SIMULATOR_SYSTEM_CONTRACT_ADDRESS = address(SYSTEM_CONTRACTS_OFFSET + 0x09);
21 | IL2Messenger constant L2_MESSENGER = IL2Messenger(address(SYSTEM_CONTRACTS_OFFSET + 0x08));
22 |
23 | library L2ContractHelper {
24 | bytes32 constant CREATE2_PREFIX = keccak256("zksyncCreate2");
25 |
26 | function sendMessageToL1(bytes memory _message) internal returns (bytes32) {
27 | return L2_MESSENGER.sendToL1(_message);
28 | }
29 |
30 | function computeCreate2Address(
31 | address _sender,
32 | bytes32 _salt,
33 | bytes32 _bytecodeHash,
34 | bytes32 _constructorInputHash
35 | ) internal pure returns (address) {
36 | bytes32 senderBytes = bytes32(uint256(uint160(_sender)));
37 | bytes32 data = keccak256(
38 | bytes.concat(CREATE2_PREFIX, senderBytes, _salt, _bytecodeHash, _constructorInputHash)
39 | );
40 |
41 | return address(uint160(uint256(data)));
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/zksync/contracts/bridge/L2ETHBridge.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | import {L2ContractHelper} from "../L2ContractHelper.sol";
6 |
7 | import "./interfaces/IL1Bridge.sol";
8 | import "./interfaces/IL2Bridge.sol";
9 | import "./interfaces/IL2EthInitializable.sol";
10 | import "./interfaces/IL2StandardToken.sol";
11 |
12 | /// @author Matter Labs
13 | /// @dev This contract is used for bridging the ether from L1.
14 | contract L2ETHBridge is IL2Bridge {
15 | /// @dev The total amount of tokens that have been minted
16 | uint256 public totalSupply;
17 |
18 | /// @dev Mapping of address to the balance
19 | mapping(address => uint256) public balanceOf;
20 |
21 | /// @dev Address of the L1 bridge counterpart
22 | address public override l1Bridge;
23 |
24 | /// @dev System contract that is responsible for storing and changing ether balances
25 | IL2StandardToken constant ETH_TOKEN_SYSTEM_CONTRACT_ADDRESS = IL2StandardToken(address(0x800a));
26 |
27 | /// @dev Ether native coin has no real address on L1, so a conventional zero address is used
28 | address constant CONVENTIONAL_ETH_ADDRESS = address(0);
29 |
30 | constructor(address _l1Bridge) {
31 | l1Bridge = _l1Bridge;
32 |
33 | IL2EthInitializable(address(ETH_TOKEN_SYSTEM_CONTRACT_ADDRESS)).initialization(address(this));
34 | }
35 |
36 | /// @dev Finalize the deposit and mint ether to the deposited address
37 | /// @param _l1Sender The account address that initiate the deposit on L1
38 | /// @param _l2Receiver The account address that would receive minted ether
39 | /// @param _l1Token The address of the token that was locked on the L1. Always should be equal to zero (conventional value)
40 | /// @param _amount Total amount of ether deposited from L1
41 | function finalizeDeposit(
42 | address _l1Sender,
43 | address _l2Receiver,
44 | address _l1Token,
45 | uint256 _amount,
46 | bytes calldata // _data
47 | ) external {
48 | // Only L1 bridge counterpart can initiate and finalize the deposit
49 | require(msg.sender == l1Bridge, "ni");
50 | require(_l1Token == CONVENTIONAL_ETH_ADDRESS);
51 |
52 | ETH_TOKEN_SYSTEM_CONTRACT_ADDRESS.bridgeMint(_l2Receiver, _amount);
53 |
54 | emit FinalizeDeposit(_l1Sender, _l2Receiver, CONVENTIONAL_ETH_ADDRESS, _amount);
55 | }
56 |
57 | /// @dev Initiate withdrawal ethers from L2 contract to the L1
58 | /// NOTE: In order to get funds on L1, receiver should finalise deposit on L1 counterpart
59 | function withdraw(
60 | address _l1Receiver,
61 | address _l2Token,
62 | uint256 _amount
63 | ) external override {
64 | require(_l2Token == CONVENTIONAL_ETH_ADDRESS, "zn");
65 |
66 | ETH_TOKEN_SYSTEM_CONTRACT_ADDRESS.bridgeBurn(msg.sender, _amount);
67 | bytes memory message = _getL1WithdrawMessage(_l1Receiver, _amount);
68 | L2ContractHelper.sendMessageToL1(message);
69 |
70 | emit WithdrawalInitiated(msg.sender, _l1Receiver, CONVENTIONAL_ETH_ADDRESS, _amount);
71 | }
72 |
73 | /// @dev Get the "withdrawal initialized" fact message to be sent on L1
74 | function _getL1WithdrawMessage(address _to, uint256 _amount) internal pure returns (bytes memory) {
75 | return abi.encodePacked(IL1Bridge.finalizeWithdrawal.selector, _to, _amount);
76 | }
77 |
78 | /// @notice Address of the L2 token by its L1 couterpart
79 | function l2TokenAddress(address) public pure returns (address) {
80 | return CONVENTIONAL_ETH_ADDRESS;
81 | }
82 |
83 | /// @notice Address of the L1 token by its L2 couterpart
84 | function l1TokenAddress(address) public pure override returns (address) {
85 | return CONVENTIONAL_ETH_ADDRESS;
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/zksync/contracts/bridge/interfaces/IL1Bridge.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | /// @author Matter Labs
6 | interface IL1Bridge {
7 | function finalizeWithdrawal(
8 | uint256 _l2BlockNumber,
9 | uint256 _l2MessageIndex,
10 | uint16 _l2TxNumberInBlock,
11 | bytes calldata _message,
12 | bytes32[] calldata _merkleProof
13 | ) external;
14 | }
15 |
--------------------------------------------------------------------------------
/zksync/contracts/bridge/interfaces/IL2Bridge.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | /// @author Matter Labs
6 | interface IL2Bridge {
7 | event FinalizeDeposit(
8 | address indexed l1Sender,
9 | address indexed l2Receiver,
10 | address indexed l2Token,
11 | uint256 amount
12 | );
13 |
14 | event WithdrawalInitiated(
15 | address indexed l2Sender,
16 | address indexed l1Receiver,
17 | address indexed l2Token,
18 | uint256 amount
19 | );
20 |
21 | function finalizeDeposit(
22 | address _l1Sender,
23 | address _l2Receiver,
24 | address _l1Token,
25 | uint256 _amount,
26 | bytes calldata _data
27 | ) external;
28 |
29 | function withdraw(
30 | address _l1Receiver,
31 | address _l2Token,
32 | uint256 _amount
33 | ) external;
34 |
35 | function l1TokenAddress(address _l2Token) external view returns (address);
36 |
37 | function l2TokenAddress(address _l1Token) external view returns (address);
38 |
39 | function l1Bridge() external view returns (address);
40 | }
41 |
--------------------------------------------------------------------------------
/zksync/contracts/bridge/interfaces/IL2EthInitializable.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | interface IL2EthInitializable {
6 | function initialization(address _l2Bridge) external;
7 | }
8 |
--------------------------------------------------------------------------------
/zksync/contracts/bridge/interfaces/IL2StandardToken.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT OR Apache-2.0
2 |
3 | pragma solidity ^0.8.0;
4 |
5 | interface IL2StandardToken {
6 | event BridgeMint(address indexed _account, uint256 _amount);
7 |
8 | event BridgeBurn(address indexed _account, uint256 _amount);
9 |
10 | function bridgeMint(address _account, uint256 _amount) external;
11 |
12 | function bridgeBurn(address _account, uint256 _amount) external;
13 |
14 | function l1Address() external view returns (address);
15 |
16 | function l2Bridge() external view returns (address);
17 | }
18 |
--------------------------------------------------------------------------------
/zksync/hardhat.config.ts:
--------------------------------------------------------------------------------
1 | import '@nomiclabs/hardhat-solpp';
2 | import '@matterlabs/hardhat-zksync-solc';
3 | import "hardhat-gas-reporter";
4 | import 'hardhat-typechain';
5 | import "solidity-coverage";
6 |
7 | export default {
8 | zksolc: {
9 | version: 'beta',
10 | compilerSource: 'docker',
11 | settings: {
12 | optimizer: {
13 | enabled: true,
14 | runs: 200
15 | },
16 | experimental: {
17 | dockerImage: 'matterlabs/zksolc',
18 | tag: 'beta'
19 | }
20 | }
21 | },
22 | solidity: {
23 | version: '0.8.17'
24 | },
25 | paths: {
26 | sources: './contracts'
27 | },
28 | networks: {
29 | hardhat: {
30 | zksync: true
31 | }
32 | }
33 | };
34 |
--------------------------------------------------------------------------------
/zksync/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "l2-zksync-contracts",
3 | "version": "0.1.0",
4 | "license": "MIT",
5 | "devDependencies": {
6 | "@nomiclabs/hardhat-ethers": "^2.0.0",
7 | "@nomiclabs/hardhat-solpp": "^2.0.0",
8 | "@openzeppelin/contracts": "4.6.0",
9 | "@openzeppelin/contracts-upgradeable": "^4.6.0",
10 | "@typechain/ethers-v5": "^2.0.0",
11 | "@types/chai": "^4.2.21",
12 | "@types/chai-as-promised": "^7.1.4",
13 | "@types/mocha": "^8.2.3",
14 | "chai": "^4.3.4",
15 | "chai-as-promised": "^7.1.1",
16 | "chalk": "^4.1.0",
17 | "commander": "^6.0.0",
18 | "ethers": "~5.5.0",
19 | "hardhat": "^2.7.0",
20 | "hardhat-gas-reporter": "^1.0.7",
21 | "hardhat-typechain": "^0.3.3",
22 | "mocha": "^9.0.2",
23 | "prettier": "^1.18.2",
24 | "prettier-plugin-solidity": "^1.0.0-alpha.27",
25 | "solidity-coverage": "^0.8.2",
26 | "ts-node": "^10.1.0",
27 | "typechain": "^4.0.0",
28 | "typescript": "^4.3.5"
29 | },
30 | "scripts": {
31 | "build": "hardhat compile",
32 | "clean": "hardhat clean"
33 | },
34 | "dependencies": {
35 | "@matterlabs/hardhat-zksync-solc": "^0.3.9"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/zksync/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "types": [
4 | "node",
5 | "mocha",
6 | ],
7 | "downlevelIteration": true,
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/zksync/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultSeverity": "warn",
3 | "extends": [
4 | "tslint:recommended"
5 | ],
6 | "jsRules": {},
7 | "rules": {
8 | "no-console": false
9 | },
10 | "rulesDirectory": []
11 | }
12 |
--------------------------------------------------------------------------------