├── .gitignore ├── .gitmodules ├── README.md ├── SystemConfig.json ├── bootloader └── bootloader.yul ├── build-tester.sh ├── contracts ├── AccountCodeStorage.sol ├── BootloaderUtilities.sol ├── BytecodeCompressor.sol ├── Constants.sol ├── ContractDeployer.sol ├── DefaultAccount.sol ├── EmptyContract.sol ├── EventWriter.yul ├── ImmutableSimulator.sol ├── KnownCodesStorage.sol ├── L1Messenger.sol ├── L2EthToken.sol ├── MsgValueSimulator.sol ├── NonceHolder.sol ├── SystemContext.sol ├── interfaces │ ├── IAccount.sol │ ├── IAccountCodeStorage.sol │ ├── IBootloaderUtilities.sol │ ├── IBytecodeCompressor.sol │ ├── IContractDeployer.sol │ ├── IEthToken.sol │ ├── IImmutableSimulator.sol │ ├── IKnownCodesStorage.sol │ ├── IL1Messenger.sol │ ├── IL2StandardToken.sol │ ├── IMailbox.sol │ ├── INonceHolder.sol │ ├── IPaymaster.sol │ ├── IPaymasterFlow.sol │ └── ISystemContext.sol ├── libraries │ ├── EfficientCall.sol │ ├── RLPEncoder.sol │ ├── SystemContractHelper.sol │ ├── SystemContractsCaller.sol │ ├── TransactionHelper.sol │ ├── UnsafeBytesCalldata.sol │ └── Utils.sol ├── openzeppelin │ ├── token │ │ └── ERC20 │ │ │ ├── IERC20.sol │ │ │ ├── extensions │ │ │ └── IERC20Permit.sol │ │ │ └── utils │ │ │ └── SafeERC20.sol │ └── utils │ │ └── Address.sol ├── precompiles │ ├── Ecrecover.yul │ ├── Keccak256.yul │ └── SHA256.yul ├── test-contracts │ ├── TestSystemContract.sol │ └── TestSystemContractHelper.sol └── tests │ ├── Counter.sol │ └── TransactionHelperTest.sol ├── discord-export ├── Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html ├── Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files │ ├── 0-EB806.png │ ├── 02410a37de8a54f8cfb7a8842a2dd162-D2755.png │ ├── 031b7a5f3d262cf2bc59a7a43169a769-805B9.png │ ├── 0a105c5bd75ea91efb8f60bb637234d9-6F61B.png │ ├── 0ab6fddedfdca4dee0b54ab41ab4faad-3EFDA.png │ ├── 1-B2132.png │ ├── 1080667809002037320-8957D.png │ ├── 1083068770823721071-EE4F6.png │ ├── 17e75583b024fe9606de1525a9f6752a-2E795.png │ ├── 1f389-5C738.svg │ ├── 1f3c1-445DC.svg │ ├── 1f3c6-621A1.svg │ ├── 1f3fb-E58B7.svg │ ├── 1f3fc-4884A.svg │ ├── 1f43a-EB486.svg │ ├── 1f440-6C64D.svg │ ├── 1f44a-68C68.svg │ ├── 1f44b-8A059.svg │ ├── 1f44d-1f3fb-ED2AA.svg │ ├── 1f44d-1f3fc-EAB0D.svg │ ├── 1f44d-27259.svg │ ├── 1f44f-3D381.svg │ ├── 1f48e-0F688.svg │ ├── 1f4aa-1f3fc-1669B.svg │ ├── 1f4aa-2FD27.svg │ ├── 1f4af-4CFF5.svg │ ├── 1f4b8-E3468.svg │ ├── 1f4c6-44E30.svg │ ├── 1f4dc-AC641.svg │ ├── 1f50d-195C0.svg │ ├── 1f525-8FE4F.svg │ ├── 1f575-fe0f-200d-2642-fe0f-6DD50.svg │ ├── 1f600-F7528.svg │ ├── 1f601-4E9BD.svg │ ├── 1f602-168C5.svg │ ├── 1f603-5E531.svg │ ├── 1f604-BF863.svg │ ├── 1f605-42B43.svg │ ├── 1f60d-BEAFF.svg │ ├── 1f622-BDD22.svg │ ├── 1f642-83E8A.svg │ ├── 1f644-329A4.svg │ ├── 1f64c-7C820.svg │ ├── 1f64f-1f3fc-34E32.svg │ ├── 1f64f-22B8D.svg │ ├── 1f680-A35CE.svg │ ├── 1f6a8-A8AB3.svg │ ├── 1f911-F346C.svg │ ├── 1f914-15707.svg │ ├── 1f919-2BED9.svg │ ├── 1f91d-5A0F2.svg │ ├── 1f925-9FDC3.svg │ ├── 1f972-F415D.svg │ ├── 1f973-88B39.svg │ ├── 1f977-3EBDE.svg │ ├── 1f9be-DDCD0.svg │ ├── 1f9d1-5BC80.svg │ ├── 1fae1-B19DE.svg │ ├── 2-ADBB4.png │ ├── 201416e548301c474985cfff30a5c3cf-AF15B.png │ ├── 20b7a9f70866c517684cce8b521d55eb-C4D77.png │ ├── 258efb44a5e3f3ccd0db6c4b11462ff2-08900.png │ ├── 261d-23B11.svg │ ├── 2696-15F4A.svg │ ├── 2705-0589F.svg │ ├── 2764-A3D25.svg │ ├── 298683a190026937bb9033ded53b8aa3-EEC98.png │ ├── 2a9faff195fe333526cfe6ae6fce1420-49B98.png │ ├── 2fb2550eac09d68c70c3cd8bc6422685-85AD4.png │ ├── 3-FB033.png │ ├── 30024f2eab00f1f2f2caee60d2b320a7-9F811.png │ ├── 310bb104d49148a05def03fa039fef92-D894A.png │ ├── 33f66f7bab184557cfa2f4e7bf69e71f-F0109.png │ ├── 372ef936d22547148b15c3c9570382b0-6F309.png │ ├── 394983eda2eb8faf909901fe09d16b4b-BAFA3.png │ ├── 3a0f84c05690faf4bd11f0dd79c4edcc-648C3.png │ ├── 4-4551A.png │ ├── 4039a15fd47a6dde7ad0baca0415755c-55F33.png │ ├── 47a90c36a9d5ab41d808ed4927e2d160-09864.png │ ├── 47c22349beb07ff08b7d61406da2c1a8-6AC2E.png │ ├── 513108461266d642ad318e27356f7890-725A7.png │ ├── 55afac51a32db1ff015fd3a7d901e67a-A5862.png │ ├── 5a8d51f44e37ca39d7a9ca6f3beb4159-5CAEE.png │ ├── 5b2500cadb4af88b0fe342af9ae1ccd8-8446D.png │ ├── 5cb16049d5c7381f4f94e887a12a3fb0-F2295.png │ ├── 5cc1d3266f7f136e8723b66a920ac162-A08C0.png │ ├── 61086c0c5f508b48fcb3464ff7a81b95-3F1B9.png │ ├── 67594ee4b4d1fc03bca468327a0d145b-BD76A.png │ ├── 6a60498acbac0dacec078cb37030a61b-82445.png │ ├── 6bd36f153db0689fe67d47ceb253ca6c-DA0E8.png │ ├── 6ed42d9e748568dc846549b81266418b-5A740.png │ ├── 74c444ce8a15ac04da773b17117d56f6-ADB20.png │ ├── 754c60f4d2cd433f04b08f2e0b8aa798-E95F1.png │ ├── 773490663245348864-8086D.png │ ├── 774308513191165992-08A98.png │ ├── 79ed4e235411ad7a3a5971b1b3754e37-EA634.png │ ├── 7cbfcd6df2ea8a4d476d784ad1e77534-EF7B1.png │ ├── 7fb5758c5d2db4cd84defb760f0de04b-E0EA1.png │ ├── 82287b4212a9854e5730462bd70677ae-E8BF4.png │ ├── 851893827027075142-F23DF.png │ ├── 851893827089727568-5FD38.png │ ├── 851893827315826708-F59C0.png │ ├── 851893828280909886-FBF42.png │ ├── 8d4beef0-5c1a-4e84-b6fc-2318302128c9-3DECE │ ├── 909f64efe3b2494f2c83ccf0f980cdb8-3F48C.png │ ├── 920756949019148299-8903C.png │ ├── 966eaf1aafcae6abcb9e0db823947e2f-96F55.png │ ├── 970d2e2f00cd7ef2134a1a3f21326349-404EA.png │ ├── 977133670429261884-CA8EA.png │ ├── 98446738-1A1F9 │ ├── 9bf2181404e658cab4039c07df56213f-E3E89.png │ ├── Screenshot_2023-03-11_at_11.48.16_AM-2A16F.png │ ├── a15d1fd903ebf135e19766fdf040a280-46865.png │ ├── a3543456a09e49cb364c91b15541774a-61F21.png │ ├── a_26c405c08ce6d45f151153e76c2ce8fa-7BEB9.gif │ ├── aba7f6b23cd80ec9e8655016ce6ef443-529ED.png │ ├── ae55bccd105a97e5e171c290822eab04-394BB.png │ ├── b5b7f1d1df93f30497a18f2112c31d41-86D17.png │ ├── b6124217afc20c2ce40437a602272a79-37B81.png │ ├── bd217fe33d3e1032038ffed64e730db3-0E6E9.png │ ├── c013be91bdf07486e86fe172fa2b4e59-0DBFE.png │ ├── c4-og-banner-0FCFA.png │ ├── c6b85a4a6ca07ab15a30a24f570be5b8-57CB5.png │ ├── cb23e87e4eb33d228ed3294f90188951-76405.png │ ├── d2a162ea47f3840acf3a61c2542af236-3CFFE.png │ ├── d7e24e0994d277993ed07845cac9ca8b-3D9F1.png │ ├── dd3017cd-c65d-4d26-a384-4b58490795c5-C6F68 │ ├── e5499456bfd8454bbf4af67569014984-2CC2E.png │ ├── e758a8d8534081499bdf32640385a804-7F0F9.png │ ├── ed7ed62c29621bba40616fb67e937ad3-D6F1B.png │ ├── ee6c31750f46b7cd080ab8b84efae1c2-9E926.png │ ├── era-compiler-solidity-275F8 │ ├── f7147bfadb72a2afd2401e5071b39609-7268B.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 │ ├── gist-og-image-17482.png │ ├── hero-6A971.png │ ├── highlight.min-D8D27.js │ ├── image-23BA0.png │ ├── image-2E3EB.png │ ├── image-55D61.png │ ├── image-84299.png │ ├── image-8A6CE.png │ ├── image-99A02.png │ ├── image-A0C75.png │ ├── lottie.min-99657.js │ ├── message-3BE42.txt │ ├── message-5381C.txt │ ├── share_image-A9244.png │ ├── solarized-dark.min-BA98F.css │ ├── sweating-nervous-8C998.mp4 │ ├── zksolc-bin-D4F46 │ └── zksync-era-10124 ├── Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt └── Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files │ ├── 8d4beef0-5c1a-4e84-b6fc-2318302128c9-3DECE │ ├── 98446738-1A1F9 │ ├── Screenshot_2023-03-11_at_11.48.16_AM-2A16F.png │ ├── c4-og-banner-0FCFA.png │ ├── dd3017cd-c65d-4d26-a384-4b58490795c5-C6F68 │ ├── era-compiler-solidity-275F8 │ ├── gist-og-image-17482.png │ ├── hero-6A971.png │ ├── image-23BA0.png │ ├── image-2E3EB.png │ ├── image-55D61.png │ ├── image-84299.png │ ├── image-8A6CE.png │ ├── image-99A02.png │ ├── image-A0C75.png │ ├── message-3BE42.txt │ ├── message-5381C.txt │ ├── share_image-A9244.png │ ├── sweating-nervous-BFA64.png │ ├── zksolc-bin-D4F46 │ └── zksync-era-10124 ├── docs ├── VM-specific_v1.3.0_opcodes_simulation.pdf ├── VM-specific_v1.3.0_opcodes_simulation_verbatim.pdf └── zkSync_fee_model.pdf ├── hardhat.config.ts ├── package.json ├── prettier.js ├── scripts ├── compile-yul.ts ├── constants.ts ├── deploy-preimages.ts └── process.ts ├── solc-linux ├── solc-macos └── 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 | 107 | # zkSync era specific ignore 108 | cache 109 | artifacts 110 | cache-zk 111 | artifacts-zk 112 | typechain-types 113 | typechain 114 | build 115 | yarn-debug.log* 116 | yarn-error.log* 117 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "era-compiler-tester"] 2 | path = era-compiler-tester 3 | url = https://github.com/matter-labs/era-compiler-tester.git 4 | branch = code4rena 5 | -------------------------------------------------------------------------------- /SystemConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "GUARANTEED_PUBDATA_BYTES": 4000, 3 | "MAX_PUBDATA_PER_BLOCK": 110000, 4 | "MAX_TRANSACTIONS_IN_BLOCK": 1024, 5 | "BLOCK_OVERHEAD_L2_GAS": 1200000, 6 | "BLOCK_OVERHEAD_L1_GAS": 1000000, 7 | "L2_TX_INTRINSIC_GAS": 14070, 8 | "L2_TX_INTRINSIC_PUBDATA": 0, 9 | "L1_TX_INTRINSIC_L2_GAS": 167157, 10 | "L1_TX_INTRINSIC_PUBDATA": 88, 11 | "MAX_GAS_PER_TRANSACTION": 80000000, 12 | "BOOTLOADER_MEMORY_FOR_TXS": 485225, 13 | "REFUND_GAS": 7343, 14 | "KECCAK_ROUND_COST_GAS": 40, 15 | "SHA256_ROUND_COST_GAS": 7, 16 | "ECRECOVER_COST_GAS": 1112 17 | } -------------------------------------------------------------------------------- /build-tester.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cd era-compiler-tester 4 | 5 | if [[ "$OSTYPE" == "darwin"* ]]; then 6 | brew install cmake ninja coreutils parallel 7 | ln -s solc-macos ../solc 8 | elif [[ -f '/etc/arch-release' ]]; then 9 | sudo pacman -S cmake ninja clang lld parallel1 10 | ln -s solc-linux ../solc 11 | elif [[ "$OSTYPE" == "linux-gnu"* ]]; then 12 | sudo apt install cmake ninja-build clang-13 lld-13 parallel pkg-config clang lld build-essential 13 | ln -s solc-linux ../solc 14 | else 15 | echo "Unsupported OS" 16 | exit 1 17 | fi 18 | 19 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 20 | source "$HOME/.cargo/env" 21 | # You may need to restart the shell after the above to have your rust properly registered 22 | cargo install compiler-llvm-builder 23 | zkevm-llvm clone && zkevm-llvm build 24 | cargo build --release 25 | -------------------------------------------------------------------------------- /contracts/BytecodeCompressor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT OR Apache-2.0 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./interfaces/IBytecodeCompressor.sol"; 6 | import "./Constants.sol"; 7 | import "./libraries/Utils.sol"; 8 | import "./libraries/UnsafeBytesCalldata.sol"; 9 | 10 | /** 11 | * @author Matter Labs 12 | * @notice Simple implementation of the compression algorithm specialized for zkEVM bytecode. 13 | * @dev Every deployed bytecode in zkEVM should be publicly restorable from the L1 data availability. 14 | * For this reason, the user may request the sequencer to publish the original bytecode and mark it as known. 15 | * Or the user may compress the bytecode and publish it instead (fewer data onchain!). 16 | */ 17 | contract BytecodeCompressor is IBytecodeCompressor { 18 | using UnsafeBytesCalldata for bytes; 19 | 20 | /// @notice Verify the compressed bytecode and publish it on the L1. 21 | /// @param _bytecode The original bytecode to be verified against. 22 | /// @param _rawCompressedData The compressed bytecode in a format of: 23 | /// - 2 bytes: the length of the dictionary 24 | /// - N bytes: the dictionary 25 | /// - M bytes: the encoded data 26 | /// @dev The dictionary is a sequence of 8-byte chunks, each of them has the associated index. 27 | /// @dev The encoded data is a sequence of 2-byte chunks, each of them is an index of the dictionary. 28 | /// @dev The compression algorithm works as follows: 29 | /// 1. The original bytecode is split into 8-byte chunks. 30 | /// Since the bytecode size is always a multiple of 32, this is always possible. 31 | /// 2. For each 8-byte chunk in the original bytecode: 32 | /// * If the chunk is not already in the dictionary, it is added to the dictionary array. 33 | /// * If the dictionary becomes overcrowded (2^16 + 1 elements), the compression process will fail. 34 | /// * The 2-byte index of the chunk in the dictionary is added to the encoded data. 35 | function publishCompressedBytecode( 36 | bytes calldata _bytecode, 37 | bytes calldata _rawCompressedData 38 | ) external payable returns (bytes32 bytecodeHash) { 39 | unchecked { 40 | (bytes calldata dictionary, bytes calldata encodedData) = _decodeRawBytecode(_rawCompressedData); 41 | 42 | require(dictionary.length % 8 == 0, "Dictionary length should be a multiple of 8"); 43 | require(dictionary.length <= 2 ** 16 * 8, "Dictionary is too big"); 44 | require( 45 | encodedData.length * 4 == _bytecode.length, 46 | "Encoded data length should be 4 times shorter than the original bytecode" 47 | ); 48 | 49 | for (uint256 encodedDataPointer = 0; encodedDataPointer < encodedData.length; encodedDataPointer += 2) { 50 | uint256 indexOfEncodedChunk = uint256(encodedData.readUint16(encodedDataPointer)) * 8; 51 | require(indexOfEncodedChunk < dictionary.length, "Encoded chunk index is out of bounds"); 52 | 53 | uint64 encodedChunk = dictionary.readUint64(indexOfEncodedChunk); 54 | uint64 realChunk = _bytecode.readUint64(encodedDataPointer * 4); 55 | 56 | require(encodedChunk == realChunk, "Encoded chunk does not match the original bytecode"); 57 | } 58 | } 59 | 60 | bytecodeHash = Utils.hashL2Bytecode(_bytecode); 61 | 62 | bytes32 rawCompressedDataHash = L1_MESSENGER_CONTRACT.sendToL1(_rawCompressedData); 63 | KNOWN_CODE_STORAGE_CONTRACT.markBytecodeAsPublished( 64 | bytecodeHash, 65 | rawCompressedDataHash, 66 | _rawCompressedData.length 67 | ); 68 | } 69 | 70 | /// @notice Decode the raw compressed data into the dictionary and the encoded data. 71 | /// @param _rawCompressedData The compressed bytecode in a format of: 72 | /// - 2 bytes: the bytes length of the dictionary 73 | /// - N bytes: the dictionary 74 | /// - M bytes: the encoded data 75 | function _decodeRawBytecode( 76 | bytes calldata _rawCompressedData 77 | ) internal pure returns (bytes calldata dictionary, bytes calldata encodedData) { 78 | unchecked { 79 | // The dictionary length can't be more than 2^16, so it fits into 2 bytes. 80 | uint256 dictionaryLen = uint256(_rawCompressedData.readUint16(0)); 81 | dictionary = _rawCompressedData[2:2 + dictionaryLen * 8]; 82 | encodedData = _rawCompressedData[2 + dictionaryLen * 8:]; 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /contracts/Constants.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./interfaces/IAccountCodeStorage.sol"; 6 | import "./interfaces/INonceHolder.sol"; 7 | import "./interfaces/IContractDeployer.sol"; 8 | import "./interfaces/IKnownCodesStorage.sol"; 9 | import "./interfaces/IImmutableSimulator.sol"; 10 | import "./interfaces/IEthToken.sol"; 11 | import "./interfaces/IL1Messenger.sol"; 12 | import "./interfaces/ISystemContext.sol"; 13 | import "./interfaces/IBytecodeCompressor.sol"; 14 | import "./BootloaderUtilities.sol"; 15 | 16 | /// @dev All the system contracts introduced by zkSync have their addresses 17 | /// started from 2^15 in order to avoid collision with Ethereum precompiles. 18 | uint160 constant SYSTEM_CONTRACTS_OFFSET = 0x8000; // 2^15 19 | 20 | /// @dev All the system contracts must be located in the kernel space, 21 | /// i.e. their addresses must be below 2^16. 22 | uint160 constant MAX_SYSTEM_CONTRACT_ADDRESS = 0xffff; // 2^16 - 1 23 | 24 | address constant ECRECOVER_SYSTEM_CONTRACT = address(0x01); 25 | address constant SHA256_SYSTEM_CONTRACT = address(0x02); 26 | 27 | /// @dev The current maximum deployed precompile address. 28 | /// Note: currently only two precompiles are deployed: 29 | /// 0x01 - ecrecover 30 | /// 0x02 - sha256 31 | /// Important! So the constant should be updated if more precompiles are deployed. 32 | uint256 constant CURRENT_MAX_PRECOMPILE_ADDRESS = uint256(uint160(SHA256_SYSTEM_CONTRACT)); 33 | 34 | address payable constant BOOTLOADER_FORMAL_ADDRESS = payable(address(SYSTEM_CONTRACTS_OFFSET + 0x01)); 35 | IAccountCodeStorage constant ACCOUNT_CODE_STORAGE_SYSTEM_CONTRACT = IAccountCodeStorage( 36 | address(SYSTEM_CONTRACTS_OFFSET + 0x02) 37 | ); 38 | INonceHolder constant NONCE_HOLDER_SYSTEM_CONTRACT = INonceHolder(address(SYSTEM_CONTRACTS_OFFSET + 0x03)); 39 | IKnownCodesStorage constant KNOWN_CODE_STORAGE_CONTRACT = IKnownCodesStorage(address(SYSTEM_CONTRACTS_OFFSET + 0x04)); 40 | IImmutableSimulator constant IMMUTABLE_SIMULATOR_SYSTEM_CONTRACT = IImmutableSimulator( 41 | address(SYSTEM_CONTRACTS_OFFSET + 0x05) 42 | ); 43 | IContractDeployer constant DEPLOYER_SYSTEM_CONTRACT = IContractDeployer(address(SYSTEM_CONTRACTS_OFFSET + 0x06)); 44 | 45 | // A contract that is allowed to deploy any codehash 46 | // on any address. To be used only during an upgrade. 47 | address constant FORCE_DEPLOYER = address(SYSTEM_CONTRACTS_OFFSET + 0x07); 48 | IL1Messenger constant L1_MESSENGER_CONTRACT = IL1Messenger(address(SYSTEM_CONTRACTS_OFFSET + 0x08)); 49 | address constant MSG_VALUE_SYSTEM_CONTRACT = address(SYSTEM_CONTRACTS_OFFSET + 0x09); 50 | 51 | IEthToken constant ETH_TOKEN_SYSTEM_CONTRACT = IEthToken(address(SYSTEM_CONTRACTS_OFFSET + 0x0a)); 52 | 53 | address constant KECCAK256_SYSTEM_CONTRACT = address(SYSTEM_CONTRACTS_OFFSET + 0x10); 54 | 55 | ISystemContext constant SYSTEM_CONTEXT_CONTRACT = ISystemContext(payable(address(SYSTEM_CONTRACTS_OFFSET + 0x0b))); 56 | 57 | BootloaderUtilities constant BOOTLOADER_UTILITIES = BootloaderUtilities(address(SYSTEM_CONTRACTS_OFFSET + 0x0c)); 58 | 59 | address constant EVENT_WRITER_CONTRACT = address(SYSTEM_CONTRACTS_OFFSET + 0x0d); 60 | 61 | IBytecodeCompressor constant BYTECODE_COMPRESSOR_CONTRACT = IBytecodeCompressor( 62 | address(SYSTEM_CONTRACTS_OFFSET + 0x0e) 63 | ); 64 | 65 | /// @dev The number of bytes that are published during the contract deployment 66 | /// in addition to the bytecode itself. 67 | uint256 constant BYTECODE_PUBLISHING_OVERHEAD = 100; 68 | 69 | /// @dev If the bitwise AND of the extraAbi[2] param when calling the MSG_VALUE_SIMULATOR 70 | /// is non-zero, the call will be assumed to be a system one. 71 | uint256 constant MSG_VALUE_SIMULATOR_IS_SYSTEM_BIT = 1; 72 | 73 | /// @dev The maximal msg.value that context can have 74 | uint256 constant MAX_MSG_VALUE = 2 ** 128 - 1; 75 | 76 | /// @dev Prefix used during derivation of account addresses using CREATE2 77 | /// @dev keccak256("zksyncCreate2") 78 | bytes32 constant CREATE2_PREFIX = 0x2020dba91b30cc0006188af794c2fb30dd8520db7e2c088b7fc7c103c00ca494; 79 | /// @dev Prefix used during derivation of account addresses using CREATE 80 | /// @dev keccak256("zksyncCreate") 81 | bytes32 constant CREATE_PREFIX = 0x63bae3a9951d38e8a3fbb7b70909afc1200610fc5bc55ade242f815974674f23; 82 | -------------------------------------------------------------------------------- /contracts/EmptyContract.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /** 6 | * @author Matter Labs 7 | * @notice The "empty" contract that is put into some system contracts by default. 8 | * @dev The bytecode of the contract is set by default for all addresses for which no other bytecodes are deployed. 9 | */ 10 | contract EmptyContract { 11 | fallback() external payable {} 12 | 13 | receive() external payable {} 14 | } 15 | -------------------------------------------------------------------------------- /contracts/ImmutableSimulator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./interfaces/IImmutableSimulator.sol"; 6 | import {DEPLOYER_SYSTEM_CONTRACT} from "./Constants.sol"; 7 | 8 | /** 9 | * @author Matter Labs 10 | * @notice System smart contract that simulates the behavior of immutable variables in Solidity. 11 | * @dev The contract stores the immutable variables created during deployment by other contracts on his storage. 12 | * @dev This simulator is needed so that smart contracts with the same Solidity code but different 13 | * constructor parameters have the same bytecode. 14 | * @dev The users are not expected to call this contract directly, only indirectly via the compiler simulations 15 | * for the immutable variables in Solidity. 16 | */ 17 | contract ImmutableSimulator is IImmutableSimulator { 18 | /// @dev mapping (contract address) => (index of immutable variable) => value 19 | /// @notice that address uses `uint256` type to leave the option to introduce 32-byte address space in future. 20 | mapping(uint256 => mapping(uint256 => bytes32)) internal immutableDataStorage; 21 | 22 | /// @notice Method that returns the immutable with a certain index for a user. 23 | /// @param _dest The address which the immutable belongs to. 24 | /// @param _index The index of the immutable. 25 | /// @return The value of the immutables. 26 | function getImmutable(address _dest, uint256 _index) external view override returns (bytes32) { 27 | return immutableDataStorage[uint256(uint160(_dest))][_index]; 28 | } 29 | 30 | /// @notice Method used by the contract deployer to store the immutables for an account 31 | /// @param _dest The address which to store the immutables for. 32 | /// @param _immutables The list of the immutables. 33 | function setImmutables(address _dest, ImmutableData[] calldata _immutables) external override { 34 | require(msg.sender == address(DEPLOYER_SYSTEM_CONTRACT), "Callable only by the deployer system contract"); 35 | unchecked { 36 | uint256 immutablesLength = _immutables.length; 37 | for (uint256 i = 0; i < immutablesLength; ++i) { 38 | uint256 index = _immutables[i].index; 39 | bytes32 value = _immutables[i].value; 40 | immutableDataStorage[uint256(uint160(_dest))][index] = value; 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /contracts/L1Messenger.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./interfaces/IL1Messenger.sol"; 6 | import "./libraries/SystemContractHelper.sol"; 7 | import "./libraries/EfficientCall.sol"; 8 | 9 | /** 10 | * @author Matter Labs 11 | * @notice Smart contract for sending arbitrary length messages to L1 12 | * @dev by default ZkSync can send fixed length messages on L1. 13 | * A fixed length message has 4 parameters `senderAddress` `isService`, `key`, `value`, 14 | * the first one is taken from the context, the other three are chosen by the sender. 15 | * @dev To send a variable length message we use this trick: 16 | * - This system contract accepts a arbitrary length message and sends a fixed length message with 17 | * parameters `senderAddress == this`, `marker == true`, `key == msg.sender`, `value == keccak256(message)`. 18 | * - The contract on L1 accepts all sent messages and if the message came from this system contract 19 | * it requires that the preimage of `value` be provided. 20 | */ 21 | contract L1Messenger is IL1Messenger { 22 | function sendToL1(bytes calldata _message) external override returns (bytes32 hash) { 23 | hash = EfficientCall.keccak(_message); 24 | 25 | // Get cost of one byte pubdata in gas from context. 26 | uint256 meta = SystemContractHelper.getZkSyncMetaBytes(); 27 | uint32 gasPerPubdataBytes = SystemContractHelper.getGasPerPubdataByteFromMeta(meta); 28 | 29 | // Calculate how many bytes of calldata will need to be transferred to L1. 30 | // We published the data as ABI-encoded `bytes`, so we pay for: 31 | // - message length in bytes, rounded up to a multiple of 32 32 | // - 32 bytes of encoded offset 33 | // - 32 bytes of encoded length 34 | 35 | uint256 pubdataLen; 36 | unchecked { 37 | pubdataLen = ((_message.length + 31) / 32) * 32 + 64; 38 | } 39 | uint256 gasToPay = pubdataLen * gasPerPubdataBytes; 40 | 41 | // Call precompile to burn gas to cover the cost of publishing pubdata to L1. 42 | uint256 precompileParams = SystemContractHelper.packPrecompileParams(0, 0, 0, 0, 0); 43 | bool precompileCallSuccess = SystemContractHelper.precompileCall( 44 | precompileParams, 45 | Utils.safeCastToU32(gasToPay) 46 | ); 47 | require(precompileCallSuccess); 48 | 49 | SystemContractHelper.toL1(true, bytes32(uint256(uint160(msg.sender))), hash); 50 | 51 | emit L1MessageSent(msg.sender, hash, _message); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /contracts/MsgValueSimulator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "./libraries/EfficientCall.sol"; 6 | import {SystemContractHelper, ISystemContract} from "./libraries/SystemContractHelper.sol"; 7 | import {MSG_VALUE_SIMULATOR_IS_SYSTEM_BIT, ETH_TOKEN_SYSTEM_CONTRACT, MAX_MSG_VALUE} from "./Constants.sol"; 8 | 9 | /** 10 | * @author Matter Labs 11 | * @notice The contract responsible for simulating transactions with `msg.value` inside zkEVM. 12 | * @dev It accepts value and whether the call should be system in the first extraAbi param and 13 | * the address to call in the second extraAbi param, transfers the funds and uses `mimicCall` to continue the 14 | * call with the same msg.sender. 15 | */ 16 | contract MsgValueSimulator is ISystemContract { 17 | /// @notice Extract value, isSystemCall and to from the extraAbi params. 18 | /// @dev The contract accepts value, the callee and whether the call should a system one via its ABI params. 19 | /// @dev The first ABI param contains the value in the [0..127] bits. The 128th contains 20 | /// the flag whether or not the call should be a system one. 21 | /// The second ABI params contains the callee. 22 | function _getAbiParams() internal view returns (uint256 value, bool isSystemCall, address to) { 23 | value = SystemContractHelper.getExtraAbiData(0); 24 | uint256 addressAsUint = SystemContractHelper.getExtraAbiData(1); 25 | uint256 mask = SystemContractHelper.getExtraAbiData(2); 26 | 27 | isSystemCall = (mask & MSG_VALUE_SIMULATOR_IS_SYSTEM_BIT) != 0; 28 | 29 | to = address(uint160(addressAsUint)); 30 | } 31 | 32 | fallback(bytes calldata _data) external payable onlySystemCall returns (bytes memory) { 33 | (uint256 value, bool isSystemCall, address to) = _getAbiParams(); 34 | 35 | if (value != 0) { 36 | (bool success, ) = address(ETH_TOKEN_SYSTEM_CONTRACT).call( 37 | abi.encodeCall(ETH_TOKEN_SYSTEM_CONTRACT.transferFromTo, (msg.sender, to, value)) 38 | ); 39 | 40 | // If the transfer of ETH fails, we do the most Ethereum-like behaviour in such situation: revert(0,0) 41 | if (!success) { 42 | assembly { 43 | revert(0, 0) 44 | } 45 | } 46 | } 47 | 48 | if (value > MAX_MSG_VALUE) { 49 | // The if above should never be true, since noone should be able to have 50 | // MAX_MSG_VALUE wei of ether. However, if it does happen for some reason, 51 | // we will revert(0,0). 52 | // Note, that we use raw revert here instead of `panic` to emulate behaviour close to 53 | // the EVM's one, i.e. returndata should be empty. 54 | assembly { 55 | return(0, 0) 56 | } 57 | } 58 | 59 | // For the next call this `msg.value` will be used. 60 | SystemContractHelper.setValueForNextFarCall(uint128(value)); 61 | 62 | return EfficientCall.mimicCall(gasleft(), to, _data, msg.sender, false, isSystemCall); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /contracts/interfaces/IAccount.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../libraries/TransactionHelper.sol"; 6 | 7 | bytes4 constant ACCOUNT_VALIDATION_SUCCESS_MAGIC = IAccount.validateTransaction.selector; 8 | 9 | interface IAccount { 10 | /// @notice Called by the bootloader to validate that an account agrees to process the transaction 11 | /// (and potentially pay for it). 12 | /// @param _txHash The hash of the transaction to be used in the explorer 13 | /// @param _suggestedSignedHash The hash of the transaction is signed by EOAs 14 | /// @param _transaction The transaction itself 15 | /// @return magic The magic value that should be equal to the signature of this function 16 | /// if the user agrees to proceed with the transaction. 17 | /// @dev The developer should strive to preserve as many steps as possible both for valid 18 | /// and invalid transactions as this very method is also used during the gas fee estimation 19 | /// (without some of the necessary data, e.g. signature). 20 | function validateTransaction( 21 | bytes32 _txHash, 22 | bytes32 _suggestedSignedHash, 23 | Transaction calldata _transaction 24 | ) external payable returns (bytes4 magic); 25 | 26 | function executeTransaction( 27 | bytes32 _txHash, 28 | bytes32 _suggestedSignedHash, 29 | Transaction calldata _transaction 30 | ) external payable; 31 | 32 | // There is no point in providing possible signed hash in the `executeTransactionFromOutside` method, 33 | // since it typically should not be trusted. 34 | function executeTransactionFromOutside(Transaction calldata _transaction) external payable; 35 | 36 | function payForTransaction( 37 | bytes32 _txHash, 38 | bytes32 _suggestedSignedHash, 39 | Transaction calldata _transaction 40 | ) external payable; 41 | 42 | function prepareForPaymaster( 43 | bytes32 _txHash, 44 | bytes32 _possibleSignedHash, 45 | Transaction calldata _transaction 46 | ) external payable; 47 | } 48 | -------------------------------------------------------------------------------- /contracts/interfaces/IAccountCodeStorage.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | interface IAccountCodeStorage { 6 | function storeAccountConstructingCodeHash(address _address, bytes32 _hash) external; 7 | 8 | function markAccountCodeHashAsConstructed(address _address) external; 9 | 10 | function getRawCodeHash(address _address) external view returns (bytes32 codeHash); 11 | 12 | function getCodeHash(uint256 _input) external view returns (bytes32 codeHash); 13 | 14 | function getCodeSize(uint256 _input) external view returns (uint256 codeSize); 15 | } 16 | -------------------------------------------------------------------------------- /contracts/interfaces/IBootloaderUtilities.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../libraries/TransactionHelper.sol"; 6 | 7 | interface IBootloaderUtilities { 8 | function getTransactionHashes( 9 | Transaction calldata _transaction 10 | ) external view returns (bytes32 txHash, bytes32 signedTxHash); 11 | } 12 | -------------------------------------------------------------------------------- /contracts/interfaces/IBytecodeCompressor.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | interface IBytecodeCompressor { 6 | function publishCompressedBytecode( 7 | bytes calldata _bytecode, 8 | bytes calldata _rawCompressedData 9 | ) external payable returns (bytes32 bytecodeHash); 10 | } 11 | -------------------------------------------------------------------------------- /contracts/interfaces/IContractDeployer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | interface IContractDeployer { 6 | /// @notice Defines the version of the account abstraction protocol 7 | /// that a contract claims to follow. 8 | /// - `None` means that the account is just a contract and it should never be interacted 9 | /// with as a custom account 10 | /// - `Version1` means that the account follows the first version of the account abstraction protocol 11 | enum AccountAbstractionVersion { 12 | None, 13 | Version1 14 | } 15 | 16 | /// @notice Defines the nonce ordering used by the account 17 | /// - `Sequential` means that it is expected that the nonces are monotonic and increment by 1 18 | /// at a time (the same as EOAs). 19 | /// - `Arbitrary` means that the nonces for the accounts can be arbitrary. The operator 20 | /// should serve the transactions from such an account on a first-come-first-serve basis. 21 | /// @dev This ordering is more of a suggestion to the operator on how the AA expects its transactions 22 | /// to be processed and is not considered as a system invariant. 23 | enum AccountNonceOrdering { 24 | Sequential, 25 | Arbitrary 26 | } 27 | 28 | struct AccountInfo { 29 | AccountAbstractionVersion supportedAAVersion; 30 | AccountNonceOrdering nonceOrdering; 31 | } 32 | 33 | event ContractDeployed( 34 | address indexed deployerAddress, 35 | bytes32 indexed bytecodeHash, 36 | address indexed contractAddress 37 | ); 38 | 39 | event AccountNonceOrderingUpdated(address indexed accountAddress, AccountNonceOrdering nonceOrdering); 40 | 41 | event AccountVersionUpdated(address indexed accountAddress, AccountAbstractionVersion aaVersion); 42 | 43 | function getNewAddressCreate2( 44 | address _sender, 45 | bytes32 _bytecodeHash, 46 | bytes32 _salt, 47 | bytes calldata _input 48 | ) external view returns (address newAddress); 49 | 50 | function getNewAddressCreate(address _sender, uint256 _senderNonce) external pure returns (address newAddress); 51 | 52 | function create2( 53 | bytes32 _salt, 54 | bytes32 _bytecodeHash, 55 | bytes calldata _input 56 | ) external payable returns (address newAddress); 57 | 58 | function create2Account( 59 | bytes32 _salt, 60 | bytes32 _bytecodeHash, 61 | bytes calldata _input, 62 | AccountAbstractionVersion _aaVersion 63 | ) external payable returns (address newAddress); 64 | 65 | /// @dev While the `_salt` parameter is not used anywhere here, 66 | /// it is still needed for consistency between `create` and 67 | /// `create2` functions (required by the compiler). 68 | function create( 69 | bytes32 _salt, 70 | bytes32 _bytecodeHash, 71 | bytes calldata _input 72 | ) external payable returns (address newAddress); 73 | 74 | /// @dev While `_salt` is never used here, we leave it here as a parameter 75 | /// for the consistency with the `create` function. 76 | function createAccount( 77 | bytes32 _salt, 78 | bytes32 _bytecodeHash, 79 | bytes calldata _input, 80 | AccountAbstractionVersion _aaVersion 81 | ) external payable returns (address newAddress); 82 | 83 | /// @notice Returns the information about a certain AA. 84 | function getAccountInfo(address _address) external view returns (AccountInfo memory info); 85 | 86 | /// @notice Can be called by an account to update its account version 87 | function updateAccountVersion(AccountAbstractionVersion _version) external; 88 | 89 | /// @notice Can be called by an account to update its nonce ordering 90 | function updateNonceOrdering(AccountNonceOrdering _nonceOrdering) external; 91 | } 92 | -------------------------------------------------------------------------------- /contracts/interfaces/IEthToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | interface IEthToken { 6 | function balanceOf(uint256) external view returns (uint256); 7 | 8 | function transferFromTo(address _from, address _to, uint256 _amount) external; 9 | 10 | function totalSupply() external view returns (uint256); 11 | 12 | function name() external pure returns (string memory); 13 | 14 | function symbol() external pure returns (string memory); 15 | 16 | function decimals() external pure returns (uint8); 17 | 18 | function mint(address _account, uint256 _amount) external; 19 | 20 | function withdraw(address _l1Receiver) external payable; 21 | 22 | event Mint(address indexed account, uint256 amount); 23 | 24 | event Transfer(address indexed from, address indexed to, uint256 value); 25 | 26 | event Withdrawal(address indexed _l2Sender, address indexed _l1Receiver, uint256 _amount); 27 | } 28 | -------------------------------------------------------------------------------- /contracts/interfaces/IImmutableSimulator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | struct ImmutableData { 6 | uint256 index; 7 | bytes32 value; 8 | } 9 | 10 | interface IImmutableSimulator { 11 | function getImmutable(address _dest, uint256 _index) external view returns (bytes32); 12 | 13 | function setImmutables(address _dest, ImmutableData[] calldata _immutables) external; 14 | } 15 | -------------------------------------------------------------------------------- /contracts/interfaces/IKnownCodesStorage.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | interface IKnownCodesStorage { 6 | event MarkedAsKnown(bytes32 indexed bytecodeHash, bool indexed sendBytecodeToL1); 7 | 8 | function markFactoryDeps(bool _shouldSendToL1, bytes32[] calldata _hashes) external; 9 | 10 | function markBytecodeAsPublished( 11 | bytes32 _bytecodeHash, 12 | bytes32 _l1PreimageHash, 13 | uint256 _l1PreimageBytesLen 14 | ) external; 15 | 16 | function getMarker(bytes32 _hash) external view returns (uint256); 17 | } 18 | -------------------------------------------------------------------------------- /contracts/interfaces/IL1Messenger.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | interface IL1Messenger { 6 | // Possibly in the future we will be able to track the messages sent to L1 with 7 | // some hooks in the VM. For now, it is much easier to track them with L2 events. 8 | event L1MessageSent(address indexed _sender, bytes32 indexed _hash, bytes _message); 9 | 10 | function sendToL1(bytes memory _message) external returns (bytes32); 11 | } 12 | -------------------------------------------------------------------------------- /contracts/interfaces/IL2StandardToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 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 | -------------------------------------------------------------------------------- /contracts/interfaces/IMailbox.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | interface IMailbox { 6 | function finalizeEthWithdrawal( 7 | uint256 _l2BlockNumber, 8 | uint256 _l2MessageIndex, 9 | uint16 _l2TxNumberInBlock, 10 | bytes calldata _message, 11 | bytes32[] calldata _merkleProof 12 | ) external; 13 | } 14 | -------------------------------------------------------------------------------- /contracts/interfaces/INonceHolder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /** 6 | * @author Matter Labs 7 | * @dev Interface of the nonce holder contract -- a contract used by the system to ensure 8 | * that there is always a unique identifier for a transaction with a particular account (we call it nonce). 9 | * In other words, the pair of (address, nonce) should always be unique. 10 | * @dev Custom accounts should use methods of this contract to store nonces or other possible unique identifiers 11 | * for the transaction. 12 | */ 13 | interface INonceHolder { 14 | event ValueSetUnderNonce(address indexed accountAddress, uint256 indexed key, uint256 value); 15 | 16 | /// @dev Returns the current minimal nonce for account. 17 | function getMinNonce(address _address) external view returns (uint256); 18 | 19 | /// @dev Returns the raw version of the current minimal nonce 20 | /// (equal to minNonce + 2^128 * deployment nonce). 21 | function getRawNonce(address _address) external view returns (uint256); 22 | 23 | /// @dev Increases the minimal nonce for the msg.sender. 24 | function increaseMinNonce(uint256 _value) external returns (uint256); 25 | 26 | /// @dev Sets the nonce value `key` as used. 27 | function setValueUnderNonce(uint256 _key, uint256 _value) external; 28 | 29 | /// @dev Gets the value stored inside a custom nonce. 30 | function getValueUnderNonce(uint256 _key) external view returns (uint256); 31 | 32 | /// @dev A convenience method to increment the minimal nonce if it is equal 33 | /// to the `_expectedNonce`. 34 | function incrementMinNonceIfEquals(uint256 _expectedNonce) external; 35 | 36 | /// @dev Returns the deployment nonce for the accounts used for CREATE opcode. 37 | function getDeploymentNonce(address _address) external view returns (uint256); 38 | 39 | /// @dev Increments the deployment nonce for the account and returns the previous one. 40 | function incrementDeploymentNonce(address _address) external returns (uint256); 41 | 42 | /// @dev Determines whether a certain nonce has been already used for an account. 43 | function validateNonceUsage(address _address, uint256 _key, bool _shouldBeUsed) external view; 44 | 45 | /// @dev Returns whether a nonce has been used for an account. 46 | function isNonceUsed(address _address, uint256 _nonce) external view returns (bool); 47 | } 48 | -------------------------------------------------------------------------------- /contracts/interfaces/IPaymaster.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../libraries/TransactionHelper.sol"; 6 | 7 | enum ExecutionResult { 8 | Revert, 9 | Success 10 | } 11 | 12 | bytes4 constant PAYMASTER_VALIDATION_SUCCESS_MAGIC = IPaymaster.validateAndPayForPaymasterTransaction.selector; 13 | 14 | interface IPaymaster { 15 | /// @dev Called by the bootloader to verify that the paymaster agrees to pay for the 16 | /// fee for the transaction. This transaction should also send the necessary amount of funds onto the bootloader 17 | /// address. 18 | /// @param _txHash The hash of the transaction 19 | /// @param _suggestedSignedHash The hash of the transaction that is signed by an EOA 20 | /// @param _transaction The transaction itself. 21 | /// @return magic The value that should be equal to the signature of the validateAndPayForPaymasterTransaction 22 | /// if the paymaster agrees to pay for the transaction. 23 | /// @return context The "context" of the transaction: an array of bytes of length at most 1024 bytes, which will be 24 | /// passed to the `postTransaction` method of the account. 25 | /// @dev The developer should strive to preserve as many steps as possible both for valid 26 | /// and invalid transactions as this very method is also used during the gas fee estimation 27 | /// (without some of the necessary data, e.g. signature). 28 | function validateAndPayForPaymasterTransaction( 29 | bytes32 _txHash, 30 | bytes32 _suggestedSignedHash, 31 | Transaction calldata _transaction 32 | ) external payable returns (bytes4 magic, bytes memory context); 33 | 34 | /// @dev Called by the bootloader after the execution of the transaction. Please note that 35 | /// there is no guarantee that this method will be called at all. Unlike the original EIP4337, 36 | /// this method won't be called if the transaction execution results in out-of-gas. 37 | /// @param _context, the context of the execution, returned by the "validateAndPayForPaymasterTransaction" method. 38 | /// @param _transaction, the users' transaction. 39 | /// @param _txResult, the result of the transaction execution (success or failure). 40 | /// @param _maxRefundedGas, the upper bound on the amout of gas that could be refunded to the paymaster. 41 | /// @dev The exact amount refunded depends on the gas spent by the "postOp" itself and so the developers should 42 | /// take that into account. 43 | function postTransaction( 44 | bytes calldata _context, 45 | Transaction calldata _transaction, 46 | bytes32 _txHash, 47 | bytes32 _suggestedSignedHash, 48 | ExecutionResult _txResult, 49 | uint256 _maxRefundedGas 50 | ) external payable; 51 | } 52 | -------------------------------------------------------------------------------- /contracts/interfaces/IPaymasterFlow.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /** 6 | * @author Matter Labs 7 | * @dev The interface that is used for encoding/decoding of 8 | * different types of paymaster flows. 9 | * @notice This is NOT an interface to be implementated 10 | * by contracts. It is just used for encoding. 11 | */ 12 | interface IPaymasterFlow { 13 | function general(bytes calldata input) external; 14 | 15 | function approvalBased(address _token, uint256 _minAllowance, bytes calldata _innerInput) external; 16 | } 17 | -------------------------------------------------------------------------------- /contracts/interfaces/ISystemContext.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /** 6 | * @author Matter Labs 7 | * @notice Contract that stores some of the context variables, that may be either 8 | * block-scoped, tx-scoped or system-wide. 9 | */ 10 | interface ISystemContext { 11 | function chainId() external view returns (uint256); 12 | 13 | function origin() external view returns (address); 14 | 15 | function gasPrice() external view returns (uint256); 16 | 17 | function blockGasLimit() external view returns (uint256); 18 | 19 | function coinbase() external view returns (address); 20 | 21 | function difficulty() external view returns (uint256); 22 | 23 | function baseFee() external view returns (uint256); 24 | 25 | function blockHash(uint256 _block) external view returns (bytes32); 26 | 27 | function getBlockHashEVM(uint256 _block) external view returns (bytes32); 28 | 29 | function getBlockNumberAndTimestamp() external view returns (uint256 blockNumber, uint256 blockTimestamp); 30 | 31 | // Note, that for now, the implementation of the bootloader allows this variables to 32 | // be incremented multiple times inside a block, so it should not relied upon right now. 33 | function getBlockNumber() external view returns (uint256); 34 | 35 | function getBlockTimestamp() external view returns (uint256); 36 | } 37 | -------------------------------------------------------------------------------- /contracts/libraries/RLPEncoder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | library RLPEncoder { 6 | function encodeAddress(address _val) internal pure returns (bytes memory encoded) { 7 | // The size is equal to 20 bytes of the address itself + 1 for encoding bytes length in RLP. 8 | encoded = new bytes(0x15); 9 | 10 | bytes20 shiftedVal = bytes20(_val); 11 | assembly { 12 | // In the first byte we write the encoded length as 0x80 + 0x14 == 0x94. 13 | mstore(add(encoded, 0x20), 0x9400000000000000000000000000000000000000000000000000000000000000) 14 | // Write address data without stripping zeros. 15 | mstore(add(encoded, 0x21), shiftedVal) 16 | } 17 | } 18 | 19 | function encodeUint256(uint256 _val) internal pure returns (bytes memory encoded) { 20 | unchecked { 21 | if (_val < 128) { 22 | encoded = new bytes(1); 23 | // Handle zero as a non-value, since stripping zeroes results in an empty byte array 24 | encoded[0] = (_val == 0) ? bytes1(uint8(128)) : bytes1(uint8(_val)); 25 | } else { 26 | uint256 hbs = _highestByteSet(_val); 27 | 28 | encoded = new bytes(hbs + 2); 29 | encoded[0] = bytes1(uint8(hbs + 0x81)); 30 | 31 | uint256 lbs = 31 - hbs; 32 | uint256 shiftedVal = _val << (lbs * 8); 33 | 34 | assembly { 35 | mstore(add(encoded, 0x21), shiftedVal) 36 | } 37 | } 38 | } 39 | } 40 | 41 | /// @notice Encodes the size of bytes in RLP format. 42 | /// @param _len The length of the bytes to encode. It has a `uint64` type since as larger values are not supported. 43 | /// NOTE: panics if the length is 1 since the length encoding is ambiguous in this case. 44 | function encodeNonSingleBytesLen(uint64 _len) internal pure returns (bytes memory) { 45 | assert(_len != 1); 46 | return _encodeLength(_len, 0x80); 47 | } 48 | 49 | /// @notice Encodes the size of list items in RLP format. 50 | /// @param _len The length of the bytes to encode. It has a `uint64` type since as larger values are not supported. 51 | function encodeListLen(uint64 _len) internal pure returns (bytes memory) { 52 | return _encodeLength(_len, 0xc0); 53 | } 54 | 55 | function _encodeLength(uint64 _len, uint256 _offset) private pure returns (bytes memory encoded) { 56 | unchecked { 57 | if (_len < 56) { 58 | encoded = new bytes(1); 59 | encoded[0] = bytes1(uint8(_len + _offset)); 60 | } else { 61 | uint256 hbs = _highestByteSet(uint256(_len)); 62 | 63 | encoded = new bytes(hbs + 2); 64 | encoded[0] = bytes1(uint8(_offset + hbs + 56)); 65 | 66 | uint256 lbs = 31 - hbs; 67 | uint256 shiftedVal = uint256(_len) << (lbs * 8); 68 | 69 | assembly { 70 | mstore(add(encoded, 0x21), shiftedVal) 71 | } 72 | } 73 | } 74 | } 75 | 76 | /// @notice Computes the index of the highest byte set in number. 77 | /// @notice Uses little endian ordering (The least significant byte has index `0`). 78 | /// NOTE: returns `0` for `0` 79 | function _highestByteSet(uint256 _number) private pure returns (uint256 hbs) { 80 | unchecked { 81 | if (_number > type(uint128).max) { 82 | _number >>= 128; 83 | hbs += 16; 84 | } 85 | if (_number > type(uint64).max) { 86 | _number >>= 64; 87 | hbs += 8; 88 | } 89 | if (_number > type(uint32).max) { 90 | _number >>= 32; 91 | hbs += 4; 92 | } 93 | if (_number > type(uint16).max) { 94 | _number >>= 16; 95 | hbs += 2; 96 | } 97 | if (_number > type(uint8).max) { 98 | hbs += 1; 99 | } 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /contracts/libraries/UnsafeBytesCalldata.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 calldata bytes. 8 | * @dev Each of the functions accepts the `bytes calldata` 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 UnsafeBytesCalldata { 18 | function readUint16(bytes calldata _bytes, uint256 _start) internal pure returns (uint16 result) { 19 | assembly { 20 | let offset := sub(_bytes.offset, 30) 21 | result := calldataload(add(offset, _start)) 22 | } 23 | } 24 | 25 | function readUint64(bytes calldata _bytes, uint256 _start) internal pure returns (uint64 result) { 26 | assembly { 27 | let offset := sub(_bytes.offset, 24) 28 | result := calldataload(add(offset, _start)) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /contracts/libraries/Utils.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.8.0; 3 | 4 | import "./EfficientCall.sol"; 5 | 6 | /** 7 | * @author Matter Labs 8 | * @dev Common utilities used in zkSync system contracts 9 | */ 10 | library Utils { 11 | /// @dev Bit mask of bytecode hash "isConstructor" marker 12 | bytes32 constant IS_CONSTRUCTOR_BYTECODE_HASH_BIT_MASK = 13 | 0x00ff000000000000000000000000000000000000000000000000000000000000; 14 | 15 | /// @dev Bit mask to set the "isConstructor" marker in the bytecode hash 16 | bytes32 constant SET_IS_CONSTRUCTOR_MARKER_BIT_MASK = 17 | 0x0001000000000000000000000000000000000000000000000000000000000000; 18 | 19 | function safeCastToU128(uint256 _x) internal pure returns (uint128) { 20 | require(_x <= type(uint128).max, "Overflow"); 21 | 22 | return uint128(_x); 23 | } 24 | 25 | function safeCastToU32(uint256 _x) internal pure returns (uint32) { 26 | require(_x <= type(uint32).max, "Overflow"); 27 | 28 | return uint32(_x); 29 | } 30 | 31 | function safeCastToU24(uint256 _x) internal pure returns (uint24) { 32 | require(_x <= type(uint24).max, "Overflow"); 33 | 34 | return uint24(_x); 35 | } 36 | 37 | /// @return codeLength The bytecode length in bytes 38 | function bytecodeLenInBytes(bytes32 _bytecodeHash) internal pure returns (uint256 codeLength) { 39 | codeLength = bytecodeLenInWords(_bytecodeHash) << 5; // _bytecodeHash * 32 40 | } 41 | 42 | /// @return codeLengthInWords The bytecode length in machine words 43 | function bytecodeLenInWords(bytes32 _bytecodeHash) internal pure returns (uint256 codeLengthInWords) { 44 | unchecked { 45 | codeLengthInWords = uint256(uint8(_bytecodeHash[2])) * 256 + uint256(uint8(_bytecodeHash[3])); 46 | } 47 | } 48 | 49 | /// @notice Denotes whether bytecode hash corresponds to a contract that is on constructor or has already been constructed 50 | function isContractConstructing(bytes32 _bytecodeHash) internal pure returns (bool) { 51 | return _bytecodeHash[1] == 0x01; 52 | } 53 | 54 | /// @notice Sets "isConstructor" flag to TRUE for the bytecode hash 55 | /// @param _bytecodeHash The bytecode hash for which it is needed to set the constructing flag 56 | /// @return The bytecode hash with "isConstructor" flag set to TRUE 57 | function constructingBytecodeHash(bytes32 _bytecodeHash) internal pure returns (bytes32) { 58 | // Clear the "isConstructor" marker and set it to 0x01. 59 | return constructedBytecodeHash(_bytecodeHash) | SET_IS_CONSTRUCTOR_MARKER_BIT_MASK; 60 | } 61 | 62 | /// @notice Sets "isConstructor" flag to FALSE for the bytecode hash 63 | /// @param _bytecodeHash The bytecode hash for which it is needed to set the constructing flag 64 | /// @return The bytecode hash with "isConstructor" flag set to FALSE 65 | function constructedBytecodeHash(bytes32 _bytecodeHash) internal pure returns (bytes32) { 66 | return _bytecodeHash & ~IS_CONSTRUCTOR_BYTECODE_HASH_BIT_MASK; 67 | } 68 | 69 | /// @notice Validate the bytecode format and calculate its hash. 70 | /// @param _bytecode The bytecode to hash. 71 | /// @return hashedBytecode The 32-byte hash of the bytecode. 72 | /// Note: The function reverts the execution if the bytecode has non expected format: 73 | /// - Bytecode bytes length is not a multiple of 32 74 | /// - Bytecode bytes length is not less than 2^21 bytes (2^16 words) 75 | /// - Bytecode words length is not odd 76 | function hashL2Bytecode(bytes calldata _bytecode) internal view returns (bytes32 hashedBytecode) { 77 | // Note that the length of the bytecode must be provided in 32-byte words. 78 | require(_bytecode.length % 32 == 0, "po"); 79 | 80 | uint256 bytecodeLenInWords = _bytecode.length / 32; 81 | require(bytecodeLenInWords < 2 ** 16, "pp"); // bytecode length must be less than 2^16 words 82 | require(bytecodeLenInWords % 2 == 1, "pr"); // bytecode length in words must be odd 83 | hashedBytecode = 84 | EfficientCall.sha(_bytecode) & 85 | 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; 86 | // Setting the version of the hash 87 | hashedBytecode = (hashedBytecode | bytes32(uint256(1 << 248))); 88 | // Setting the length 89 | hashedBytecode = hashedBytecode | bytes32(bytecodeLenInWords << 224); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /contracts/openzeppelin/token/ERC20/IERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface of the ERC20 standard as defined in the EIP. 8 | */ 9 | interface IERC20 { 10 | /** 11 | * @dev Emitted when `value` tokens are moved from one account (`from`) to 12 | * another (`to`). 13 | * 14 | * Note that `value` may be zero. 15 | */ 16 | event Transfer(address indexed from, address indexed to, uint256 value); 17 | 18 | /** 19 | * @dev Emitted when the allowance of a `spender` for an `owner` is set by 20 | * a call to {approve}. `value` is the new allowance. 21 | */ 22 | event Approval(address indexed owner, address indexed spender, uint256 value); 23 | 24 | /** 25 | * @dev Returns the amount of tokens in existence. 26 | */ 27 | function totalSupply() external view returns (uint256); 28 | 29 | /** 30 | * @dev Returns the amount of tokens owned by `account`. 31 | */ 32 | function balanceOf(address account) external view returns (uint256); 33 | 34 | /** 35 | * @dev Moves `amount` tokens from the caller's account to `to`. 36 | * 37 | * Returns a boolean value indicating whether the operation succeeded. 38 | * 39 | * Emits a {Transfer} event. 40 | */ 41 | function transfer(address to, uint256 amount) external returns (bool); 42 | 43 | /** 44 | * @dev Returns the remaining number of tokens that `spender` will be 45 | * allowed to spend on behalf of `owner` through {transferFrom}. This is 46 | * zero by default. 47 | * 48 | * This value changes when {approve} or {transferFrom} are called. 49 | */ 50 | function allowance(address owner, address spender) external view returns (uint256); 51 | 52 | /** 53 | * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. 54 | * 55 | * Returns a boolean value indicating whether the operation succeeded. 56 | * 57 | * IMPORTANT: Beware that changing an allowance with this method brings the risk 58 | * that someone may use both the old and the new allowance by unfortunate 59 | * transaction ordering. One possible solution to mitigate this race 60 | * condition is to first reduce the spender's allowance to 0 and set the 61 | * desired value afterwards: 62 | * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 63 | * 64 | * Emits an {Approval} event. 65 | */ 66 | function approve(address spender, uint256 amount) external returns (bool); 67 | 68 | /** 69 | * @dev Moves `amount` tokens from `from` to `to` using the 70 | * allowance mechanism. `amount` is then deducted from the caller's 71 | * allowance. 72 | * 73 | * Returns a boolean value indicating whether the operation succeeded. 74 | * 75 | * Emits a {Transfer} event. 76 | */ 77 | function transferFrom( 78 | address from, 79 | address to, 80 | uint256 amount 81 | ) external returns (bool); 82 | } 83 | -------------------------------------------------------------------------------- /contracts/openzeppelin/token/ERC20/extensions/IERC20Permit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Permit.sol) 3 | 4 | pragma solidity ^0.8.0; 5 | 6 | /** 7 | * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in 8 | * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. 9 | * 10 | * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by 11 | * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't 12 | * need to send a transaction, and thus is not required to hold Ether at all. 13 | */ 14 | interface IERC20Permit { 15 | /** 16 | * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, 17 | * given ``owner``'s signed approval. 18 | * 19 | * IMPORTANT: The same issues {IERC20-approve} has related to transaction 20 | * ordering also apply here. 21 | * 22 | * Emits an {Approval} event. 23 | * 24 | * Requirements: 25 | * 26 | * - `spender` cannot be the zero address. 27 | * - `deadline` must be a timestamp in the future. 28 | * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` 29 | * over the EIP712-formatted function arguments. 30 | * - the signature must use ``owner``'s current nonce (see {nonces}). 31 | * 32 | * For more information on the signature format, see the 33 | * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP 34 | * section]. 35 | */ 36 | function permit( 37 | address owner, 38 | address spender, 39 | uint256 value, 40 | uint256 deadline, 41 | uint8 v, 42 | bytes32 r, 43 | bytes32 s 44 | ) external; 45 | 46 | /** 47 | * @dev Returns the current nonce for `owner`. This value must be 48 | * included whenever a signature is generated for {permit}. 49 | * 50 | * Every successful call to {permit} increases ``owner``'s nonce by one. This 51 | * prevents a signature from being used multiple times. 52 | */ 53 | function nonces(address owner) external view returns (uint256); 54 | 55 | /** 56 | * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. 57 | */ 58 | // solhint-disable-next-line func-name-mixedcase 59 | function DOMAIN_SEPARATOR() external view returns (bytes32); 60 | } 61 | -------------------------------------------------------------------------------- /contracts/precompiles/Ecrecover.yul: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Matter Labs 3 | * @notice The contract used to emulate EVM's ecrecover precompile. 4 | * @dev It uses `precompileCall` to call the zkEVM built-in precompiles. 5 | */ 6 | object "Ecrecover" { 7 | code { } 8 | object "Ecrecover_deployed" { 9 | code { 10 | //////////////////////////////////////////////////////////////// 11 | // CONSTANTS 12 | //////////////////////////////////////////////////////////////// 13 | 14 | // Group order of secp256k1, see https://en.bitcoin.it/wiki/Secp256k1 15 | function SECP256K1_GROUP_SIZE() -> ret { 16 | ret := 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 17 | } 18 | 19 | /// @dev The gas cost of processing ecrecover circuit precompile. 20 | function ECRECOVER_GAS_COST() -> ret { 21 | ret := 1112 22 | } 23 | 24 | //////////////////////////////////////////////////////////////// 25 | // HELPER FUNCTIONS 26 | //////////////////////////////////////////////////////////////// 27 | 28 | // @dev Packs precompile parameters into one word. 29 | // Note: functions expect to work with 32/64 bits unsigned integers. 30 | // Caller should ensure the type matching before! 31 | function unsafePackPrecompileParams( 32 | uint32_inputOffsetInWords, 33 | uint32_inputLengthInWords, 34 | uint32_outputOffsetInWords, 35 | uint32_outputLengthInWords, 36 | uint64_perPrecompileInterpreted 37 | ) -> rawParams { 38 | rawParams := uint32_inputOffsetInWords 39 | rawParams := or(rawParams, shl(32, uint32_inputLengthInWords)) 40 | rawParams := or(rawParams, shl(64, uint32_outputOffsetInWords)) 41 | rawParams := or(rawParams, shl(96, uint32_outputLengthInWords)) 42 | rawParams := or(rawParams, shl(192, uint64_perPrecompileInterpreted)) 43 | } 44 | 45 | /// @dev Executes the `precompileCall` opcode. 46 | function precompileCall(precompileParams, gasToBurn) -> ret { 47 | // Compiler simulation for calling `precompileCall` opcode 48 | ret := verbatim_2i_1o("precompile", precompileParams, gasToBurn) 49 | } 50 | 51 | //////////////////////////////////////////////////////////////// 52 | // FALLBACK 53 | //////////////////////////////////////////////////////////////// 54 | 55 | let digest := calldataload(0) 56 | let v := calldataload(32) 57 | let r := calldataload(64) 58 | let s := calldataload(96) 59 | 60 | // Validate the input by the yellow paper rules (Appendix E. Precompiled contracts) 61 | let vIsInvalid := iszero(or(eq(v, 27), eq(v, 28))) 62 | let sIsInvalid := or(eq(s, 0), gt(s, sub(SECP256K1_GROUP_SIZE(), 1))) 63 | let rIsInvalid := or(eq(r, 0), gt(r, sub(SECP256K1_GROUP_SIZE(), 1))) 64 | 65 | if or(vIsInvalid, or(sIsInvalid, rIsInvalid)) { 66 | return(0, 0) 67 | } 68 | 69 | // Store the data in memory, so the ecrecover circuit will read it 70 | mstore(0, digest) 71 | mstore(32, sub(v, 27)) 72 | mstore(64, r) 73 | mstore(96, s) 74 | 75 | let precompileParams := unsafePackPrecompileParams( 76 | 0, // input offset in words 77 | 4, // input length in words (the signed digest, v, r, s) 78 | 0, // output offset in words 79 | 2, // output length in words (success, signer) 80 | 0 // No special meaning, ecrecover circuit doesn't check this value 81 | ) 82 | let gasToPay := ECRECOVER_GAS_COST() 83 | 84 | // Check whether the call is successfully handled by the ecrecover circuit 85 | let success := precompileCall(precompileParams, gasToPay) 86 | let internalSuccess := mload(0) 87 | 88 | switch and(success, internalSuccess) 89 | case 0 { 90 | return(0, 0) 91 | } 92 | default { 93 | return(32, 32) 94 | } 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /contracts/precompiles/SHA256.yul: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Matter Labs 3 | * @notice The contract used to emulate EVM's sha256 precompile. 4 | * @dev It accepts the data to be hashed, pad it by the specification 5 | * and uses `precompileCall` to call the zkEVM built-in precompiles. 6 | * @dev Thus sha256 precompile circuit operates over padded data to perform efficient sponge round computation. 7 | */ 8 | object "SHA256" { 9 | code { } 10 | object "SHA256_deployed" { 11 | code { 12 | //////////////////////////////////////////////////////////////// 13 | // CONSTANTS 14 | //////////////////////////////////////////////////////////////// 15 | 16 | /// @dev The size of the processing sha256 block in bytes. 17 | function BLOCK_SIZE() -> ret { 18 | ret := 64 19 | } 20 | 21 | /// @dev The gas cost of processing one sha256 round. 22 | function SHA256_ROUND_GAS_COST() -> ret { 23 | ret := 7 24 | } 25 | 26 | //////////////////////////////////////////////////////////////// 27 | // HELPER FUNCTIONS 28 | //////////////////////////////////////////////////////////////// 29 | 30 | // @dev Packs precompile parameters into one word. 31 | // Note: functions expect to work with 32/64 bits unsigned integers. 32 | // Caller should ensure the type matching before! 33 | function unsafePackPrecompileParams( 34 | uint32_inputOffsetInWords, 35 | uint32_inputLengthInWords, 36 | uint32_outputOffsetInWords, 37 | uint32_outputLengthInWords, 38 | uint64_perPrecompileInterpreted 39 | ) -> rawParams { 40 | rawParams := uint32_inputOffsetInWords 41 | rawParams := or(rawParams, shl(32, uint32_inputLengthInWords)) 42 | rawParams := or(rawParams, shl(64, uint32_outputOffsetInWords)) 43 | rawParams := or(rawParams, shl(96, uint32_outputLengthInWords)) 44 | rawParams := or(rawParams, shl(192, uint64_perPrecompileInterpreted)) 45 | } 46 | 47 | /// @dev Executes the `precompileCall` opcode. 48 | function precompileCall(precompileParams, gasToBurn) -> ret { 49 | // Compiler simulation for calling `precompileCall` opcode 50 | ret := verbatim_2i_1o("precompile", precompileParams, gasToBurn) 51 | } 52 | 53 | //////////////////////////////////////////////////////////////// 54 | // FALLBACK 55 | //////////////////////////////////////////////////////////////// 56 | 57 | // Copy calldata to memory for pad it 58 | let bytesSize := calldatasize() 59 | calldatacopy(0, 0, bytesSize) 60 | 61 | // The sha256 padding includes additional 8 bytes of the total message's length in bits, 62 | // so calculate the "full" message length with it. 63 | let extendBytesLen := add(bytesSize, 8) 64 | 65 | let padLen := sub(BLOCK_SIZE(), mod(extendBytesLen, BLOCK_SIZE())) 66 | let paddedBytesSize := add(extendBytesLen, padLen) 67 | 68 | // The original message size in bits 69 | let binSize := mul(bytesSize, 8) 70 | // Same bin size, but shifted to the left, needed for the padding 71 | let leftShiftedBinSize := shl(sub(256, 64), binSize) 72 | 73 | // Write 0x80000... as padding according the sha256 specification 74 | mstore(bytesSize, 0x8000000000000000000000000000000000000000000000000000000000000000) 75 | // then will be some zeroes and BE encoded bit length 76 | mstore(sub(paddedBytesSize, 8), leftShiftedBinSize) 77 | 78 | let numRounds := div(paddedBytesSize, BLOCK_SIZE()) 79 | let precompileParams := unsafePackPrecompileParams( 80 | 0, // input offset in words 81 | // Always divisable by 32, since `BLOCK_SIZE()` is 64 bytes 82 | div(paddedBytesSize, 32), // input length in words (safe to pass, never exceed `type(uint32).max`) 83 | 0, // output offset in words 84 | 1, // output length in words 85 | numRounds // number of rounds (safe to pass, never exceed `type(uint64).max`) 86 | ) 87 | let gasToPay := mul(SHA256_ROUND_GAS_COST(), numRounds) 88 | 89 | let success := precompileCall(precompileParams, gasToPay) 90 | 91 | switch success 92 | case 0 { 93 | revert(0, 0) 94 | } 95 | default { 96 | return(0, 32) 97 | } 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /contracts/test-contracts/TestSystemContractHelper.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8; 4 | 5 | import {MAX_SYSTEM_CONTRACT_ADDRESS, MSG_VALUE_SYSTEM_CONTRACT} from "../Constants.sol"; 6 | 7 | import "../libraries/SystemContractsCaller.sol"; 8 | import "../libraries/SystemContractHelper.sol"; 9 | import "../libraries/Utils.sol"; 10 | 11 | library TestSystemContractHelper { 12 | /// @notice Perform a `mimicCall` with `isSystem` flag, with the ability to pass extra abi data. 13 | /// @param to The address to call 14 | /// @param whoToMimic The `msg.sender` for the next call. 15 | /// @param data The calldata 16 | /// @param isConstructor Whether the call should contain the `isConstructor` flag. 17 | /// @param extraAbiParam1 The first extraAbi param to pass with the call 18 | /// @param extraAbiParam2 The second extraAbi param to pass with the call 19 | /// @return The returndata if the call was successful. Reverts otherwise. 20 | /// @dev If called not in kernel mode, it will result in a revert (enforced by the VM) 21 | function systemMimicCall( 22 | address to, 23 | address whoToMimic, 24 | bytes calldata data, 25 | bool isConstructor, 26 | uint256 extraAbiParam1, 27 | uint256 extraAbiParam2 28 | ) internal returns (bytes memory) { 29 | bool success = rawSystemMimicCall(to, whoToMimic, data, isConstructor, extraAbiParam1, extraAbiParam2); 30 | 31 | uint256 size; 32 | assembly { 33 | size := returndatasize() 34 | } 35 | if (!success) { 36 | assembly { 37 | returndatacopy(0, 0, size) 38 | revert(0, size) 39 | } 40 | } 41 | 42 | bytes memory result = new bytes(size); 43 | assembly { 44 | mstore(result, size) 45 | returndatacopy(add(result, 0x20), 0, size) 46 | } 47 | return result; 48 | } 49 | 50 | /// @notice Perform a `mimicCall` with `isSystem` flag, with the ability to pass extra abi data. 51 | /// @param to The address to call 52 | /// @param whoToMimic The `msg.sender` for the next call. 53 | /// @param data The calldata 54 | /// @param isConstructor Whether the call should contain the `isConstructor` flag. 55 | /// @param extraAbiParam1 The first extraAbi param to pass with the call 56 | /// @param extraAbiParam2 The second extraAbi param to pass with the call 57 | /// @return success whether the call was successful. 58 | /// @dev If called not in kernel mode, it will result in a revert (enforced by the VM) 59 | function rawSystemMimicCall( 60 | address to, 61 | address whoToMimic, 62 | bytes calldata data, 63 | bool isConstructor, 64 | uint256 extraAbiParam1, 65 | uint256 extraAbiParam2 66 | ) internal returns (bool success) { 67 | SystemContractHelper.loadCalldataIntoActivePtr(); 68 | 69 | // Currently, zkEVM considers the pointer valid if(ptr.offset < ptr.length || (ptr.length == 0 && ptr.offset == 0)), otherwise panics. 70 | // So, if the data is empty we need to make the `ptr.length = ptr.offset = 0`, otherwise follow standard logic. 71 | if (data.length == 0) { 72 | // Safe to cast, offset is never bigger than `type(uint32).max` 73 | SystemContractHelper.ptrShrinkIntoActive(uint32(msg.data.length)); 74 | } else { 75 | uint256 dataOffset; 76 | assembly { 77 | dataOffset := data.offset 78 | } 79 | 80 | // Safe to cast, offset is never bigger than `type(uint32).max` 81 | SystemContractHelper.ptrAddIntoActive(uint32(dataOffset)); 82 | // Safe to cast, `data.length` is never bigger than `type(uint32).max` 83 | uint32 shrinkTo = uint32(msg.data.length - (data.length + dataOffset)); 84 | SystemContractHelper.ptrShrinkIntoActive(shrinkTo); 85 | } 86 | 87 | uint32 gas = Utils.safeCastToU32(gasleft()); 88 | uint256 farCallAbi = SystemContractsCaller.getFarCallABIWithEmptyFatPointer( 89 | gas, 90 | // Only rollup is supported for now 91 | 0, 92 | CalldataForwardingMode.ForwardFatPointer, 93 | isConstructor, 94 | true 95 | ); 96 | SystemContractHelper.ptrPackIntoActivePtr(farCallAbi); 97 | 98 | address callAddr = SYSTEM_MIMIC_CALL_BY_REF_CALL_ADDRESS; 99 | uint256 cleanupMask = ADDRESS_MASK; 100 | assembly { 101 | // Clearing values before usage in assembly, since Solidity 102 | // doesn't do it by default 103 | whoToMimic := and(whoToMimic, cleanupMask) 104 | 105 | success := call(to, callAddr, 0, 0, whoToMimic, extraAbiParam1, extraAbiParam2) 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /contracts/tests/Counter.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | contract Counter { 6 | uint256 public counter; 7 | 8 | function increment() public { 9 | counter += 1; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /contracts/tests/TransactionHelperTest.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import "../libraries/TransactionHelper.sol"; 6 | 7 | contract TransactionHelperTest { 8 | using TransactionHelper for Transaction; 9 | 10 | function encodeHash(Transaction calldata _transaction) public view returns (bytes32 resultHash) { 11 | resultHash = _transaction.encodeHash(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/0-EB806.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/0-EB806.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/02410a37de8a54f8cfb7a8842a2dd162-D2755.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/02410a37de8a54f8cfb7a8842a2dd162-D2755.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/031b7a5f3d262cf2bc59a7a43169a769-805B9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/031b7a5f3d262cf2bc59a7a43169a769-805B9.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/0a105c5bd75ea91efb8f60bb637234d9-6F61B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/0a105c5bd75ea91efb8f60bb637234d9-6F61B.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/0ab6fddedfdca4dee0b54ab41ab4faad-3EFDA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/0ab6fddedfdca4dee0b54ab41ab4faad-3EFDA.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1-B2132.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1-B2132.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1080667809002037320-8957D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1080667809002037320-8957D.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1083068770823721071-EE4F6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1083068770823721071-EE4F6.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/17e75583b024fe9606de1525a9f6752a-2E795.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/17e75583b024fe9606de1525a9f6752a-2E795.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f389-5C738.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f3c1-445DC.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f3c6-621A1.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f3fb-E58B7.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f3fc-4884A.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f43a-EB486.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f440-6C64D.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f44a-68C68.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f44b-8A059.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f44d-1f3fb-ED2AA.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f44d-1f3fc-EAB0D.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f44d-27259.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f44f-3D381.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f48e-0F688.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f4aa-1f3fc-1669B.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f4aa-2FD27.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f4af-4CFF5.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f4b8-E3468.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f4c6-44E30.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f4dc-AC641.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f50d-195C0.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f525-8FE4F.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f575-fe0f-200d-2642-fe0f-6DD50.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f600-F7528.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f601-4E9BD.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f602-168C5.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f603-5E531.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f604-BF863.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f605-42B43.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f60d-BEAFF.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f622-BDD22.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f642-83E8A.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f644-329A4.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f64c-7C820.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f64f-1f3fc-34E32.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f64f-22B8D.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f680-A35CE.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f6a8-A8AB3.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f911-F346C.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f914-15707.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f919-2BED9.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f91d-5A0F2.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f925-9FDC3.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f972-F415D.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f973-88B39.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f977-3EBDE.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f9be-DDCD0.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1f9d1-5BC80.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/1fae1-B19DE.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/2-ADBB4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/2-ADBB4.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/201416e548301c474985cfff30a5c3cf-AF15B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/201416e548301c474985cfff30a5c3cf-AF15B.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/20b7a9f70866c517684cce8b521d55eb-C4D77.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/20b7a9f70866c517684cce8b521d55eb-C4D77.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/258efb44a5e3f3ccd0db6c4b11462ff2-08900.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/258efb44a5e3f3ccd0db6c4b11462ff2-08900.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/261d-23B11.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/2696-15F4A.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/2705-0589F.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/2764-A3D25.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/298683a190026937bb9033ded53b8aa3-EEC98.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/298683a190026937bb9033ded53b8aa3-EEC98.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/2a9faff195fe333526cfe6ae6fce1420-49B98.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/2a9faff195fe333526cfe6ae6fce1420-49B98.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/2fb2550eac09d68c70c3cd8bc6422685-85AD4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/2fb2550eac09d68c70c3cd8bc6422685-85AD4.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/3-FB033.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/3-FB033.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/30024f2eab00f1f2f2caee60d2b320a7-9F811.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/30024f2eab00f1f2f2caee60d2b320a7-9F811.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/310bb104d49148a05def03fa039fef92-D894A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/310bb104d49148a05def03fa039fef92-D894A.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/33f66f7bab184557cfa2f4e7bf69e71f-F0109.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/33f66f7bab184557cfa2f4e7bf69e71f-F0109.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/372ef936d22547148b15c3c9570382b0-6F309.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/372ef936d22547148b15c3c9570382b0-6F309.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/394983eda2eb8faf909901fe09d16b4b-BAFA3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/394983eda2eb8faf909901fe09d16b4b-BAFA3.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/3a0f84c05690faf4bd11f0dd79c4edcc-648C3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/3a0f84c05690faf4bd11f0dd79c4edcc-648C3.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/4-4551A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/4-4551A.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/4039a15fd47a6dde7ad0baca0415755c-55F33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/4039a15fd47a6dde7ad0baca0415755c-55F33.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/47a90c36a9d5ab41d808ed4927e2d160-09864.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/47a90c36a9d5ab41d808ed4927e2d160-09864.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/47c22349beb07ff08b7d61406da2c1a8-6AC2E.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/47c22349beb07ff08b7d61406da2c1a8-6AC2E.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/513108461266d642ad318e27356f7890-725A7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/513108461266d642ad318e27356f7890-725A7.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/55afac51a32db1ff015fd3a7d901e67a-A5862.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/55afac51a32db1ff015fd3a7d901e67a-A5862.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/5a8d51f44e37ca39d7a9ca6f3beb4159-5CAEE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/5a8d51f44e37ca39d7a9ca6f3beb4159-5CAEE.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/5b2500cadb4af88b0fe342af9ae1ccd8-8446D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/5b2500cadb4af88b0fe342af9ae1ccd8-8446D.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/5cb16049d5c7381f4f94e887a12a3fb0-F2295.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/5cb16049d5c7381f4f94e887a12a3fb0-F2295.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/5cc1d3266f7f136e8723b66a920ac162-A08C0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/5cc1d3266f7f136e8723b66a920ac162-A08C0.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/61086c0c5f508b48fcb3464ff7a81b95-3F1B9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/61086c0c5f508b48fcb3464ff7a81b95-3F1B9.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/67594ee4b4d1fc03bca468327a0d145b-BD76A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/67594ee4b4d1fc03bca468327a0d145b-BD76A.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/6a60498acbac0dacec078cb37030a61b-82445.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/6a60498acbac0dacec078cb37030a61b-82445.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/6bd36f153db0689fe67d47ceb253ca6c-DA0E8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/6bd36f153db0689fe67d47ceb253ca6c-DA0E8.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/6ed42d9e748568dc846549b81266418b-5A740.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/6ed42d9e748568dc846549b81266418b-5A740.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/74c444ce8a15ac04da773b17117d56f6-ADB20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/74c444ce8a15ac04da773b17117d56f6-ADB20.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/754c60f4d2cd433f04b08f2e0b8aa798-E95F1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/754c60f4d2cd433f04b08f2e0b8aa798-E95F1.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/773490663245348864-8086D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/773490663245348864-8086D.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/774308513191165992-08A98.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/774308513191165992-08A98.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/79ed4e235411ad7a3a5971b1b3754e37-EA634.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/79ed4e235411ad7a3a5971b1b3754e37-EA634.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/7cbfcd6df2ea8a4d476d784ad1e77534-EF7B1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/7cbfcd6df2ea8a4d476d784ad1e77534-EF7B1.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/7fb5758c5d2db4cd84defb760f0de04b-E0EA1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/7fb5758c5d2db4cd84defb760f0de04b-E0EA1.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/82287b4212a9854e5730462bd70677ae-E8BF4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/82287b4212a9854e5730462bd70677ae-E8BF4.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/851893827027075142-F23DF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/851893827027075142-F23DF.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/851893827089727568-5FD38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/851893827089727568-5FD38.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/851893827315826708-F59C0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/851893827315826708-F59C0.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/851893828280909886-FBF42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/851893828280909886-FBF42.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/8d4beef0-5c1a-4e84-b6fc-2318302128c9-3DECE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/8d4beef0-5c1a-4e84-b6fc-2318302128c9-3DECE -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/909f64efe3b2494f2c83ccf0f980cdb8-3F48C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/909f64efe3b2494f2c83ccf0f980cdb8-3F48C.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/920756949019148299-8903C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/920756949019148299-8903C.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/966eaf1aafcae6abcb9e0db823947e2f-96F55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/966eaf1aafcae6abcb9e0db823947e2f-96F55.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/970d2e2f00cd7ef2134a1a3f21326349-404EA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/970d2e2f00cd7ef2134a1a3f21326349-404EA.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/977133670429261884-CA8EA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/977133670429261884-CA8EA.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/98446738-1A1F9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/98446738-1A1F9 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/9bf2181404e658cab4039c07df56213f-E3E89.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/9bf2181404e658cab4039c07df56213f-E3E89.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/Screenshot_2023-03-11_at_11.48.16_AM-2A16F.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/Screenshot_2023-03-11_at_11.48.16_AM-2A16F.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/a15d1fd903ebf135e19766fdf040a280-46865.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/a15d1fd903ebf135e19766fdf040a280-46865.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/a3543456a09e49cb364c91b15541774a-61F21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/a3543456a09e49cb364c91b15541774a-61F21.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/a_26c405c08ce6d45f151153e76c2ce8fa-7BEB9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/a_26c405c08ce6d45f151153e76c2ce8fa-7BEB9.gif -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/aba7f6b23cd80ec9e8655016ce6ef443-529ED.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/aba7f6b23cd80ec9e8655016ce6ef443-529ED.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ae55bccd105a97e5e171c290822eab04-394BB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ae55bccd105a97e5e171c290822eab04-394BB.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/b5b7f1d1df93f30497a18f2112c31d41-86D17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/b5b7f1d1df93f30497a18f2112c31d41-86D17.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/b6124217afc20c2ce40437a602272a79-37B81.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/b6124217afc20c2ce40437a602272a79-37B81.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/bd217fe33d3e1032038ffed64e730db3-0E6E9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/bd217fe33d3e1032038ffed64e730db3-0E6E9.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/c013be91bdf07486e86fe172fa2b4e59-0DBFE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/c013be91bdf07486e86fe172fa2b4e59-0DBFE.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/c4-og-banner-0FCFA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/c4-og-banner-0FCFA.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/c6b85a4a6ca07ab15a30a24f570be5b8-57CB5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/c6b85a4a6ca07ab15a30a24f570be5b8-57CB5.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/cb23e87e4eb33d228ed3294f90188951-76405.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/cb23e87e4eb33d228ed3294f90188951-76405.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/d2a162ea47f3840acf3a61c2542af236-3CFFE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/d2a162ea47f3840acf3a61c2542af236-3CFFE.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/d7e24e0994d277993ed07845cac9ca8b-3D9F1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/d7e24e0994d277993ed07845cac9ca8b-3D9F1.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/dd3017cd-c65d-4d26-a384-4b58490795c5-C6F68: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/dd3017cd-c65d-4d26-a384-4b58490795c5-C6F68 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/e5499456bfd8454bbf4af67569014984-2CC2E.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/e5499456bfd8454bbf4af67569014984-2CC2E.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/e758a8d8534081499bdf32640385a804-7F0F9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/e758a8d8534081499bdf32640385a804-7F0F9.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ed7ed62c29621bba40616fb67e937ad3-D6F1B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ed7ed62c29621bba40616fb67e937ad3-D6F1B.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ee6c31750f46b7cd080ab8b84efae1c2-9E926.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ee6c31750f46b7cd080ab8b84efae1c2-9E926.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/era-compiler-solidity-275F8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/era-compiler-solidity-275F8 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/f7147bfadb72a2afd2401e5071b39609-7268B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/f7147bfadb72a2afd2401e5071b39609-7268B.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-italic-400-E988B.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-italic-400-E988B.woff2 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-italic-500-0777F.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-italic-500-0777F.woff2 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-italic-600-CB411.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-italic-600-CB411.woff2 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-italic-700-891AC.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-italic-700-891AC.woff2 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-italic-800-D36B0.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-italic-800-D36B0.woff2 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-normal-400-1456D.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-normal-400-1456D.woff2 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-normal-500-89CE5.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-normal-500-89CE5.woff2 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-normal-600-C1EA8.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-normal-600-C1EA8.woff2 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-normal-700-1949A.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-normal-700-1949A.woff2 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-normal-800-58487.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/ggsans-normal-800-58487.woff2 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/gist-og-image-17482.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/gist-og-image-17482.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/hero-6A971.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/hero-6A971.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/image-23BA0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/image-23BA0.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/image-2E3EB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/image-2E3EB.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/image-55D61.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/image-55D61.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/image-84299.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/image-84299.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/image-8A6CE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/image-8A6CE.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/image-99A02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/image-99A02.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/image-A0C75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/image-A0C75.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/share_image-A9244.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/share_image-A9244.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].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-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/sweating-nervous-8C998.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/sweating-nervous-8C998.mp4 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/zksolc-bin-D4F46: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/zksolc-bin-D4F46 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/zksync-era-10124: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].html_Files/zksync-era-10124 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/8d4beef0-5c1a-4e84-b6fc-2318302128c9-3DECE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/8d4beef0-5c1a-4e84-b6fc-2318302128c9-3DECE -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/98446738-1A1F9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/98446738-1A1F9 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/Screenshot_2023-03-11_at_11.48.16_AM-2A16F.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/Screenshot_2023-03-11_at_11.48.16_AM-2A16F.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/c4-og-banner-0FCFA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/c4-og-banner-0FCFA.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/dd3017cd-c65d-4d26-a384-4b58490795c5-C6F68: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/dd3017cd-c65d-4d26-a384-4b58490795c5-C6F68 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/era-compiler-solidity-275F8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/era-compiler-solidity-275F8 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/gist-og-image-17482.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/gist-og-image-17482.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/hero-6A971.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/hero-6A971.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/image-23BA0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/image-23BA0.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/image-2E3EB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/image-2E3EB.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/image-55D61.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/image-55D61.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/image-84299.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/image-84299.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/image-8A6CE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/image-8A6CE.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/image-99A02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/image-99A02.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/image-A0C75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/image-A0C75.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/share_image-A9244.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/share_image-A9244.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/sweating-nervous-BFA64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/sweating-nervous-BFA64.png -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/zksolc-bin-D4F46: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/zksolc-bin-D4F46 -------------------------------------------------------------------------------- /discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/zksync-era-10124: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/discord-export/Code4rena - ARCHIVE-Q1-2023 - zksync-era-mar10 [1083054993793364038].txt_Files/zksync-era-10124 -------------------------------------------------------------------------------- /docs/VM-specific_v1.3.0_opcodes_simulation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/docs/VM-specific_v1.3.0_opcodes_simulation.pdf -------------------------------------------------------------------------------- /docs/VM-specific_v1.3.0_opcodes_simulation_verbatim.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/docs/VM-specific_v1.3.0_opcodes_simulation_verbatim.pdf -------------------------------------------------------------------------------- /docs/zkSync_fee_model.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/docs/zkSync_fee_model.pdf -------------------------------------------------------------------------------- /hardhat.config.ts: -------------------------------------------------------------------------------- 1 | import '@nomiclabs/hardhat-solpp'; 2 | import 'hardhat-typechain'; 3 | import '@nomiclabs/hardhat-ethers'; 4 | import '@matterlabs/hardhat-zksync-solc'; 5 | 6 | const systemConfig = require('./SystemConfig.json'); 7 | 8 | export default { 9 | zksolc: { 10 | version: '1.3.5', 11 | compilerSource: 'binary', 12 | settings: { 13 | isSystem: true 14 | } 15 | }, 16 | zkSyncDeploy: { 17 | zkSyncNetwork: 'http://localhost:3050', 18 | ethNetwork: 'http://localhost:8545' 19 | }, 20 | solidity: { 21 | version: '0.8.16' 22 | }, 23 | solpp: { 24 | defs: (() => { 25 | return { 26 | ECRECOVER_COST_GAS: systemConfig.ECRECOVER_COST_GAS, 27 | KECCAK_ROUND_COST_GAS: systemConfig.KECCAK_ROUND_COST_GAS, 28 | SHA256_ROUND_COST_GAS: systemConfig.SHA256_ROUND_COST_GAS 29 | } 30 | })() 31 | }, 32 | networks: { 33 | hardhat: { 34 | zksync: true 35 | } 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "system-contracts", 3 | "version": "0.1.0", 4 | "repository": "git@github.com:matter-labs/system-contracts.git", 5 | "license": "MIT", 6 | "dependencies": { 7 | "@matterlabs/hardhat-zksync-deploy": "^0.5.2", 8 | "@nomiclabs/hardhat-solpp": "^2.0.1", 9 | "commander": "^9.4.1", 10 | "ethers": "^5.7.0", 11 | "hardhat": "^2.11.0", 12 | "preprocess": "^3.2.0", 13 | "zksync-web3": "^0.13.0" 14 | }, 15 | "devDependencies": { 16 | "@matterlabs/hardhat-zksync-solc": "^0.3.14-beta.3", 17 | "@nomiclabs/hardhat-ethers": "^2.0.6", 18 | "@typechain/ethers-v5": "^2.0.0", 19 | "@types/chai": "^4.3.1", 20 | "@types/mocha": "^9.1.1", 21 | "@types/node": "^17.0.34", 22 | "chai": "^4.3.6", 23 | "hardhat-typechain": "^0.3.3", 24 | "mocha": "^10.0.0", 25 | "prettier": "^2.3.0", 26 | "prettier-plugin-solidity": "^1.0.0-alpha.27", 27 | "template-file": "^6.0.1", 28 | "ts-generator": "^0.1.1", 29 | "ts-node": "^10.7.0", 30 | "typechain": "^4.0.0", 31 | "typescript": "^4.6.4" 32 | }, 33 | "mocha": { 34 | "timeout": 240000, 35 | "exit": true, 36 | "color": false, 37 | "slow": 0, 38 | "require": [ 39 | "ts-node/register" 40 | ] 41 | }, 42 | "scripts": { 43 | "prepare": "bash build-tester.sh", 44 | "test": ". \"$HOME/.cargo/env\" && cd era-compiler-tester && cargo run --release --bin compiler-tester -- --verbose --mode='Y+MzB3 0.8.19'", 45 | "build": "hardhat compile && yarn preprocess && PATH=$PATH:`pwd` yarn ts-node scripts/compile-yul.ts", 46 | "clean": "hardhat clean", 47 | "fmt": "prettier --config prettier.js --write contracts/*.sol contracts/**/*.sol", 48 | "preprocess": "rm -rf ./bootloader/build && yarn ts-node scripts/process.ts", 49 | "deploy-preimages": "ts-node scripts/deploy-preimages.ts" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /prettier.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "printWidth": 120, 3 | "tabWidth": 4, 4 | "useTabs": false, 5 | "singleQuote": false, 6 | "bracketSpacing": false, 7 | "explicitTypes": "always" 8 | }; 9 | -------------------------------------------------------------------------------- /scripts/compile-yul.ts: -------------------------------------------------------------------------------- 1 | import * as hre from 'hardhat'; 2 | import * as fs from 'fs'; 3 | import { exec as _exec, spawn as _spawn } from 'child_process'; 4 | 5 | import { getZksolcPath, getZksolcUrl, saltFromUrl } from '@matterlabs/hardhat-zksync-solc'; 6 | 7 | const COMPILER_VERSION = '1.3.5'; 8 | const IS_COMPILER_PRE_RELEASE = false; 9 | 10 | async function compilerLocation(): Promise { 11 | if(IS_COMPILER_PRE_RELEASE) { 12 | const url = getZksolcUrl('https://github.com/matter-labs/zksolc-prerelease', hre.config.zksolc.version); 13 | const salt = saltFromUrl(url); 14 | return await getZksolcPath(COMPILER_VERSION, salt); 15 | } else { 16 | return await getZksolcPath(COMPILER_VERSION, ''); 17 | } 18 | } 19 | 20 | // executes a command in a new shell 21 | // but pipes data to parent's stdout/stderr 22 | export function spawn(command: string) { 23 | command = command.replace(/\n/g, ' '); 24 | const child = _spawn(command, { stdio: 'inherit', shell: true }); 25 | return new Promise((resolve, reject) => { 26 | child.on('error', reject); 27 | child.on('close', (code) => { 28 | code == 0 ? resolve(code) : reject(`Child process exited with code ${code}`); 29 | }); 30 | }); 31 | } 32 | 33 | export async function compileYul(path: string, files: string[], outputDirName: string | null) { 34 | if (!files.length) { 35 | console.log(`No test files provided in folder ${path}.`); 36 | return; 37 | } 38 | let paths = preparePaths(path, files, outputDirName); 39 | 40 | const zksolcLocation = await compilerLocation(); 41 | await spawn( 42 | `${zksolcLocation} ${paths.absolutePathSources}/${paths.outputDir} --system-mode --yul --optimize --bin --overwrite -o ${paths.absolutePathArtifacts}/${paths.outputDir}` 43 | ); 44 | } 45 | 46 | export async function compileYulFolder(path: string) { 47 | let files: string[] = (await fs.promises.readdir(path)).filter((fn) => fn.endsWith('.yul')); 48 | for (const file of files) { 49 | await compileYul(path, [file], `${file}`); 50 | } 51 | } 52 | 53 | 54 | function preparePaths(path: string, files: string[], outputDirName: string | null): CompilerPaths { 55 | const filePaths = files 56 | .map((val, _) => { 57 | return `sources/${val}`; 58 | }) 59 | .join(' '); 60 | const outputDir = outputDirName || files[0]; 61 | 62 | let absolutePathSources = `${process.env.PWD}/${path}`; 63 | 64 | let absolutePathArtifacts = `${process.env.PWD}/${path}/artifacts`; 65 | 66 | return new CompilerPaths(filePaths, outputDir, absolutePathSources, absolutePathArtifacts); 67 | } 68 | 69 | class CompilerPaths { 70 | public filePath: string; 71 | public outputDir: string; 72 | public absolutePathSources: string; 73 | public absolutePathArtifacts: string; 74 | constructor(filePath: string, outputDir: string, absolutePathSources: string, absolutePathArtifacts: string) { 75 | this.filePath = filePath; 76 | this.outputDir = outputDir; 77 | this.absolutePathSources = absolutePathSources; 78 | this.absolutePathArtifacts = absolutePathArtifacts; 79 | } 80 | } 81 | 82 | 83 | async function main() { 84 | await compileYulFolder('contracts'); 85 | await compileYulFolder('contracts/precompiles'); 86 | await compileYulFolder('bootloader/build'); 87 | } 88 | 89 | main() 90 | .then(() => process.exit(0)) 91 | .catch((err) => { 92 | console.error('Error:', err.message || err); 93 | process.exit(1); 94 | }); 95 | -------------------------------------------------------------------------------- /solc-linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/solc-linux -------------------------------------------------------------------------------- /solc-macos: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-423n4/2023-03-zksync/0aae1fb4065d39d955e727dd5c617ff6ab0a7eff/solc-macos --------------------------------------------------------------------------------