From a2fb9653ec1237cbbdb45d8ea01a9dc2256547d5 Mon Sep 17 00:00:00 2001 From: koloz193 Date: Wed, 24 Jul 2024 11:50:45 -0400 Subject: [PATCH] N-06 Improved Organization of Error Files (#576) --- .../contracts/common/L1ContractErrors.sol | 506 +++++++++--------- .../upgrades/ZkSyncUpgradeErrors.sol | 24 +- .../contracts/errors/L2ContractErrors.sol | 32 +- system-contracts/SystemContractsHashes.json | 50 +- .../contracts/SystemContractErrors.sol | 166 +++--- 5 files changed, 395 insertions(+), 383 deletions(-) diff --git a/l1-contracts/contracts/common/L1ContractErrors.sol b/l1-contracts/contracts/common/L1ContractErrors.sol index a9970224c..41cb11ea4 100644 --- a/l1-contracts/contracts/common/L1ContractErrors.sol +++ b/l1-contracts/contracts/common/L1ContractErrors.sol @@ -1,298 +1,302 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.24; +pragma solidity ^0.8.21; -// 0x8e4a23d6 -error Unauthorized(address caller); -// 0x95b66fe9 -error EmptyDeposit(); -// 0x626ade30 -error ValueMismatch(uint256 expected, uint256 actual); -// 0xae899454 -error WithdrawalAlreadyFinalized(); -// 0xd92e233d -error ZeroAddress(); -// 0xcac5fc40 -error SharedBridgeValueAlreadySet(SharedBridgeKey); -// 0xcab098d8 -error NoFundsTransferred(); -// 0x669567ea -error ZeroBalance(); -// 0x536ec84b -error NonEmptyMsgValue(); -// 0xa4f62e33 -error L2BridgeNotDeployed(uint256 chainId); -// 0x06439c6b -error TokenNotSupported(address token); -// 0xd769f0a3 -error WithdrawIncorrectAmount(uint256 expectedAmt, uint256 providedAmt); -// 0xad2fa98e -error DepositExists(); // 0x1ff9d522 error AddressAlreadyUsed(address addr); -// 0x09bde339 -error InvalidProof(); +// 0x86bb51b8 +error AddressHasNoCode(address); +// 0x1eee5481 +error AddressTooLow(address); +// 0x6afd6c20 +error BadReturnData(); +// 0x6ef9a972 +error BaseTokenGasPriceDenominatorNotSet(); +// 0x55ad3fd3 +error BatchHashMismatch(bytes32 expected, bytes32 actual); +// 0x2078a6a0 +error BatchNotExecuted(uint256 batchNumber); +// 0xbd4455ff +error BatchNumberMismatch(uint256 expectedBatchNumber, uint256 providedBatchNumber); +// 0xafd53e2f +error BlobHashCommitmentError(uint256 index, bool blobHashEmpty, bool blobCommitmentEmpty); +// 0x6cf12312 +error BridgeHubAlreadyRegistered(); +// 0xcf102c5a +error CalldataLengthTooBig(); +// 0xe85392f9 +error CanOnlyProcessOneBatch(); +// 0x00c6ead2 +error CantExecuteUnprovenBatches(); +// 0xe18cb383 +error CantRevertExecutedBatch(); +// 0x78d2ed02 +error ChainAlreadyLive(); +// 0x8f620a06 +error ChainIdTooBig(); +// 0xf7a01e4d +error DelegateCallFailed(bytes returnData); +// 0x0a8ed92c +error DenominatorIsZero(); // 0xc7c9660f error DepositDoesNotExist(); -// 0x356680b7 -error InsufficientFunds(); +// 0xad2fa98e +error DepositExists(); // 0x79cacff1 error DepositFailed(); -// 0x7774d2f9 -error SharedBridgeValueNotSet(SharedBridgeKey); -// 0x750b219c -error WithdrawFailed(); -// 0x16509b9a -error MalformedMessage(); -// 0x12ba286f -error InvalidSelector(bytes4 func); -// 0xd0bc70cf -error STMAlreadyRegistered(); -// 0x09865e10 -error STMNotRegistered(); -// 0x4f4b634e -error TokenAlreadyRegistered(address token); -// 0xddef98d7 -error TokenNotRegistered(address token); -// 0x7a47c9a2 -error InvalidChainId(); -// 0x6cf12312 -error BridgeHubAlreadyRegistered(); -// 0x1eee5481 -error AddressTooLow(address); -// 0xdf3a8fdd -error SlotOccupied(); -// 0x43e266b0 -error MalformedBytecode(BytecodeError); -// 0x72afcbf4 -error OperationShouldBeReady(); -// 0xee454a75 -error OperationShouldBePending(); -// 0x1a21feed -error OperationExists(); -// 0x4fbe5dba -error InvalidDelay(); -// 0x9b48e060 -error PreviousOperationNotExecuted(); +// 0x0e7ee319 +error DiamondAlreadyFrozen(); +// 0x682dabb4 +error DiamondFreezeIncorrectState(); +// 0xa7151b9a +error DiamondNotFrozen(); +// 0xfc7ab1d3 +error EmptyBlobVersionHash(uint256 index); +// 0x95b66fe9 +error EmptyDeposit(); +// 0xac4a3f98 +error FacetExists(bytes4 selector, address); +// 0x79e12cc3 +error FacetIsFrozen(bytes4 func); +// 0xc91cf3b1 +error GasPerPubdataMismatch(); +// 0x6d4a7df8 +error GenesisBatchCommitmentZero(); +// 0x7940c83f +error GenesisBatchHashZero(); +// 0xb4fc6835 +error GenesisIndexStorageZero(); +// 0x3a1a8589 +error GenesisUpgradeZero(); +// 0xd356e6ba +error HashedLogIsDefault(); // 0x0b08d5be error HashMismatch(bytes32 expected, bytes32 actual); // 0xb615c2b1 error HyperchainLimitReached(); -// 0xf0b4e88f -error TooMuchGas(); -// 0x59170bf0 -error MalformedCalldata(); -// 0x79e12cc3 -error FacetIsFrozen(bytes4 func); -// 0x2a4a14df -error PubdataPerBatchIsLessThanTxn(); -// 0x6f1cf752 -error InvalidPubdataPricingMode(); -// 0xaa7feadc -error InvalidValue(); -// 0x78d2ed02 -error ChainAlreadyLive(); -// 0x5428eae7 -error InvalidProtocolVersion(); -// 0x682dabb4 -error DiamondFreezeIncorrectState(); -// 0xc5d09071 -error InvalidPubdataMode(); +// 0x826fb11e +error InsufficientChainBalance(); +// 0x356680b7 +error InsufficientFunds(); +// 0x7a47c9a2 +error InvalidChainId(); +// 0x4fbe5dba +error InvalidDelay(); // 0x0af806e0 error InvalidHash(); +// 0xc1780bd6 +error InvalidLogSender(address sender, uint256 logKey); +// 0xd8e9405c +error InvalidNumberOfBlobs(uint256 expected, uint256 numCommitments, uint256 numHashes); +// 0x09bde339 +error InvalidProof(); +// 0x5428eae7 +error InvalidProtocolVersion(); +// 0x53e6d04d +error InvalidPubdataCommitmentsSize(); +// 0x5513177c +error InvalidPubdataHash(bytes32 expectedHash, bytes32 provided); // 0x9094af7e error InvalidPubdataLength(); -// 0xd018e08e -error NonIncreasingTimestamp(); -// 0x2d50c33b -error TimestampError(); +// 0xc5d09071 +error InvalidPubdataMode(); +// 0x6f1cf752 +error InvalidPubdataPricingMode(); +// 0x12ba286f +error InvalidSelector(bytes4 func); +// 0x5cb29523 +error InvalidTxType(uint256 txType); +// 0x5f1aa154 +error InvalidUpgradeTxn(UpgradeTxVerifyParam); +// 0xaa7feadc +error InvalidValue(); +// 0xa4f62e33 +error L2BridgeNotDeployed(uint256 chainId); +// 0xff8811ff +error L2BridgeNotSet(uint256 chainId); +// 0xcb5e4247 +error L2BytecodeHashMismatch(bytes32 expected, bytes32 provided); +// 0xfb5c22e6 +error L2TimestampTooBig(); +// 0xd2c011d6 +error L2UpgradeNonceNotEqualToNewProtocolVersion(uint256 nonce, uint256 protocolVersion); +// 0x97e1359e +error L2WithdrawalMessageWrongLength(uint256 messageLen); +// 0x32eb8b2f +error LegacyMethodIsSupportedOnlyForEra(); +// 0xe37d2c02 +error LengthIsNotDivisibleBy32(uint256 length); // 0x1b6825bb error LogAlreadyProcessed(uint8); -// 0xc1780bd6 -error InvalidLogSender(address sender, uint256 logKey); -// 0x6aa39880 -error UnexpectedSystemLog(uint256 logKey); +// 0x43e266b0 +error MalformedBytecode(BytecodeError); +// 0x59170bf0 +error MalformedCalldata(); +// 0x16509b9a +error MalformedMessage(); +// 0x9bb54c35 +error MerkleIndexOutOfBounds(); +// 0x8e23ac1a +error MerklePathEmpty(); +// 0x1c500385 +error MerklePathOutOfBounds(); // 0xfa44b527 error MissingSystemLogs(uint256 expected, uint256 actual); -// 0xe85392f9 -error CanOnlyProcessOneBatch(); -// 0x55ad3fd3 -error BatchHashMismatch(bytes32 expected, bytes32 actual); -// 0xf093c2e5 -error UpgradeBatchNumberIsNotZero(); -// 0x0105f9c0 -error NonSequentialBatch(); -// 0x00c6ead2 -error CantExecuteUnprovenBatches(); -// 0xd8e9405c -error InvalidNumberOfBlobs(uint256 expected, uint256 numCommitments, uint256 numHashes); -// 0x2dbdba00 -error VerifyProofCommittedVerifiedMismatch(); -// 0xdab52f4b -error RevertedBatchBeforeNewBatch(); -// 0xe18cb383 -error CantRevertExecutedBatch(); -// 0x4daa985d -error PointEvalFailed(bytes); -// 0xfc7ab1d3 -error EmptyBlobVersionHash(uint256 index); -// 0x4c991078 -error TxHashMismatch(); -// 0x92290acc -error NonEmptyBlobVersionHash(uint256 index); -// 0xafd53e2f -error BlobHashCommitmentError(uint256 index, bool blobHashEmpty, bool blobCommitmentEmpty); -// 0xf3ed9dfa -error OnlyEraSupported(); -// 0x2078a6a0 -error BatchNotExecuted(uint256 batchNumber); -// 0xd356e6ba -error HashedLogIsDefault(); -// 0x6ef9a972 -error BaseTokenGasPriceDenominatorNotSet(); -// 0x00c5a6a9 -error TransactionNotAllowed(); -// 0xc91cf3b1 -error GasPerPubdataMismatch(); -// 0x76da24b9 -error TooManyFactoryDeps(); +// 0x4a094431 +error MsgValueMismatch(uint256 expectedMsgValue, uint256 providedMsgValue); // 0xb385a3da error MsgValueTooLow(uint256 required, uint256 provided); +// 0x72ea85ad +error NewProtocolMajorVersionNotZero(); // 0xa6fef710 error NoFunctionsForDiamondCut(); -// 0xe52478c7 -error UndefinedDiamondCutAction(); -// 0x86bb51b8 -error AddressHasNoCode(address); -// 0xac4a3f98 -error FacetExists(bytes4 selector, address); -// 0x4ef79e5a -error NonZeroAddress(address); -// 0xd3b6535b -error SelectorsMustAllHaveSameFreezability(); +// 0xcab098d8 +error NoFundsTransferred(); +// 0x92290acc +error NonEmptyBlobVersionHash(uint256 index); // 0xc21b1ab7 error NonEmptyCalldata(); -// 0x6afd6c20 -error BadReturnData(); -// 0x8e23ac1a -error MerklePathEmpty(); -// 0x1c500385 -error MerklePathOutOfBounds(); -// 0x9bb54c35 -error MerkleIndexOutOfBounds(); -// 0x63c36549 -error QueueIsEmpty(); -// 0x5f1aa154 -error InvalidUpgradeTxn(UpgradeTxVerifyParam); +// 0x536ec84b +error NonEmptyMsgValue(); +// 0xd018e08e +error NonIncreasingTimestamp(); +// 0x0105f9c0 +error NonSequentialBatch(); +// 0x4ef79e5a +error NonZeroAddress(address); // 0xdd629f86 error NotEnoughGas(); -// 0x5cb29523 -error InvalidTxType(uint256 txType); -// 0x07218375 -error UnexpectedNumberOfFactoryDeps(); -// 0x101ba748 -error PreviousUpgradeNotFinalized(bytes32 txHash); -// 0xa0f47245 -error PreviousUpgradeNotCleaned(); -// 0x826fb11e -error InsufficientChainBalance(); -// 0x97e1359e -error L2WithdrawalMessageWrongLength(uint256 messageLen); -// 0xff8811ff -error L2BridgeNotSet(uint256 chainId); -// 0xc84885d4 -error ZeroChainId(); -// 0x8f620a06 -error ChainIdTooBig(); -// 0x856d5b77 -error SharedBridgeNotSet(); -// 0x4a094431 -error MsgValueMismatch(uint256 expectedMsgValue, uint256 providedMsgValue); -// 0x15e8e429 -error WrongMagicValue(uint256 expectedMagicValue, uint256 providedMagicValue); // 0xdd7e3621 error NotInitializedReentrancyGuard(); -// 0xab143c06 -error Reentrancy(); -// 0xe37d2c02 -error LengthIsNotDivisibleBy32(uint256 length); -// 0x0a8ed92c -error DenominatorIsZero(); +// 0xf3ed9dfa +error OnlyEraSupported(); +// 0x1a21feed +error OperationExists(); +// 0xee454a75 +error OperationShouldBePending(); +// 0x72afcbf4 +error OperationShouldBeReady(); +// 0xd7f50a9d +error PatchCantSetUpgradeTxn(); +// 0x962fd7d0 +error PatchUpgradeCantSetBootloader(); +// 0x559cc34e +error PatchUpgradeCantSetDefaultAccount(); +// 0x8d5851de +error PointEvalCallFailed(bytes); +// 0x4daa985d +error PointEvalFailed(bytes); +// 0x9b48e060 +error PreviousOperationNotExecuted(); +// 0x5c598b60 +error PreviousProtocolMajorVersionNotZero(); +// 0xa0f47245 +error PreviousUpgradeNotCleaned(); +// 0x101ba748 +error PreviousUpgradeNotFinalized(bytes32 txHash); +// 0xd5a99014 +error PriorityOperationsRollingHashMismatch(); // 0xa461f651 error ProtocolIdMismatch(uint256 expectedProtocolVersion, uint256 providedProtocolId); // 0x64f94ec2 error ProtocolIdNotGreater(); -// 0x0e7ee319 -error DiamondAlreadyFrozen(); -// 0xbd4455ff -error BatchNumberMismatch(uint256 expectedBatchNumber, uint256 providedBatchNumber); -// 0xcf102c5a -error CalldataLengthTooBig(); -// 0x5513177c -error InvalidPubdataHash(bytes32 expectedHash, bytes32 provided); -// 0xfb5c22e6 -error L2TimestampTooBig(); -// 0xf640f0e5 -error TooManyBlobs(); -// 0xd5a99014 -error PriorityOperationsRollingHashMismatch(); -// 0xae43b424 -error SystemLogsSizeTooBig(); -// 0x8d5851de -error PointEvalCallFailed(bytes); +// 0xd328c12a +error ProtocolVersionMinorDeltaTooBig(uint256 limit, uint256 proposed); +// 0x88d7b498 +error ProtocolVersionTooSmall(); // 0x53dee67b error PubdataCommitmentsEmpty(); // 0x7734c31a error PubdataCommitmentsTooBig(); -// 0x53e6d04d -error InvalidPubdataCommitmentsSize(); -// 0x3580370c -error ReplaceFunctionFacetAddressZero(); -// 0x667d17de -error RemoveFunctionFacetAddressNotZero(address facet); -// 0xf7a01e4d -error DelegateCallFailed(bytes returnData); // 0x959f26fb error PubdataGreaterThanLimit(uint256 limit, uint256 length); -// 0x2e311df8 -error TxnBodyGasLimitNotEnoughGas(); -// 0x47b3b145 -error ValidateTxnNotEnoughGas(); -// 0x08753982 -error TimeNotReached(uint256 expectedTimestamp, uint256 actualTimestamp); -// 0xd7f50a9d -error PatchCantSetUpgradeTxn(); -// 0xd2c011d6 -error L2UpgradeNonceNotEqualToNewProtocolVersion(uint256 nonce, uint256 protocolVersion); -// 0xcb5e4247 -error L2BytecodeHashMismatch(bytes32 expected, bytes32 provided); -// 0x88d7b498 -error ProtocolVersionTooSmall(); -// 0x5c598b60 -error PreviousProtocolMajorVersionNotZero(); -// 0x72ea85ad -error NewProtocolMajorVersionNotZero(); -// 0xd328c12a -error ProtocolVersionMinorDeltaTooBig(uint256 limit, uint256 proposed); -// 0x559cc34e -error PatchUpgradeCantSetDefaultAccount(); -// 0x962fd7d0 -error PatchUpgradeCantSetBootloader(); -// 0xc1d9246c -error SharedBridgeBalanceMismatch(); -// 0x3a1a8589 -error GenesisUpgradeZero(); -// 0x7940c83f -error GenesisBatchHashZero(); -// 0xb4fc6835 -error GenesisIndexStorageZero(); -// 0x6d4a7df8 -error GenesisBatchCommitmentZero(); +// 0x2a4a14df +error PubdataPerBatchIsLessThanTxn(); +// 0x63c36549 +error QueueIsEmpty(); +// 0xab143c06 +error Reentrancy(); +// 0x667d17de +error RemoveFunctionFacetAddressNotZero(address facet); // 0xa2d4b16c error RemoveFunctionFacetAddressZero(); +// 0x3580370c +error ReplaceFunctionFacetAddressZero(); +// 0xdab52f4b +error RevertedBatchBeforeNewBatch(); +// 0xd3b6535b +error SelectorsMustAllHaveSameFreezability(); +// 0x7774d2f9 +error SharedBridgeValueNotSet(SharedBridgeKey); +// 0xc1d9246c +error SharedBridgeBalanceMismatch(); +// 0x856d5b77 +error SharedBridgeNotSet(); +// 0xcac5fc40 +error SharedBridgeValueAlreadySet(SharedBridgeKey); +// 0xdf3a8fdd +error SlotOccupied(); +// 0xd0bc70cf +error STMAlreadyRegistered(); +// 0x09865e10 +error STMNotRegistered(); +// 0xae43b424 +error SystemLogsSizeTooBig(); +// 0x08753982 +error TimeNotReached(uint256 expectedTimestamp, uint256 actualTimestamp); +// 0x2d50c33b +error TimestampError(); +// 0x4f4b634e +error TokenAlreadyRegistered(address token); +// 0xddef98d7 +error TokenNotRegistered(address token); +// 0x06439c6b +error TokenNotSupported(address token); // 0x23830e28 error TokensWithFeesNotSupported(); -// 0xa7151b9a -error DiamondNotFrozen(); +// 0xf640f0e5 +error TooManyBlobs(); +// 0x76da24b9 +error TooManyFactoryDeps(); +// 0xf0b4e88f +error TooMuchGas(); +// 0x00c5a6a9 +error TransactionNotAllowed(); +// 0x4c991078 +error TxHashMismatch(); +// 0x2e311df8 +error TxnBodyGasLimitNotEnoughGas(); +// 0x8e4a23d6 +error Unauthorized(address caller); +// 0xe52478c7 +error UndefinedDiamondCutAction(); +// 0x07218375 +error UnexpectedNumberOfFactoryDeps(); +// 0x6aa39880 +error UnexpectedSystemLog(uint256 logKey); +// 0xf093c2e5 +error UpgradeBatchNumberIsNotZero(); +// 0x47b3b145 +error ValidateTxnNotEnoughGas(); +// 0x626ade30 +error ValueMismatch(uint256 expected, uint256 actual); +// 0x2dbdba00 +error VerifyProofCommittedVerifiedMismatch(); +// 0xae899454 +error WithdrawalAlreadyFinalized(); +// 0x27fcd9d1 +error WithdrawalFailed(); +// 0x750b219c +error WithdrawFailed(); +// 0xd769f0a3 +error WithdrawIncorrectAmount(uint256 expectedAmt, uint256 providedAmt); +// 0x15e8e429 +error WrongMagicValue(uint256 expectedMagicValue, uint256 providedMagicValue); +// 0xd92e233d +error ZeroAddress(); +// 0x669567ea +error ZeroBalance(); +// 0xc84885d4 +error ZeroChainId(); enum SharedBridgeKey { PostUpgradeFirstBatch, diff --git a/l1-contracts/contracts/upgrades/ZkSyncUpgradeErrors.sol b/l1-contracts/contracts/upgrades/ZkSyncUpgradeErrors.sol index 621a527e7..9fcac9806 100644 --- a/l1-contracts/contracts/upgrades/ZkSyncUpgradeErrors.sol +++ b/l1-contracts/contracts/upgrades/ZkSyncUpgradeErrors.sol @@ -1,18 +1,20 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.24; +pragma solidity ^0.8.21; -// 0x88d7b498 -error ProtocolVersionTooSmall(); -// 0xe1a9736b -error ProtocolVersionDeltaTooLarge(uint256 _proposedDelta, uint256 _maxDelta); -// 0xa0bdf77d -error PreviousUpgradeNotFinalized(); -// 0xd7f8c13e -error PreviousUpgradeBatchNotCleared(); // 0x7a47c9a2 error InvalidChainId(); -// 0xd92e233d -error ZeroAddress(); +// 0xd7f8c13e +error PreviousUpgradeBatchNotCleared(); +// 0xa0bdf77d +error PreviousUpgradeNotFinalized(); // 0x3c43ccce error ProtocolMajorVersionNotZero(); +// 0xe1a9736b +error ProtocolVersionDeltaTooLarge(uint256 _proposedDelta, uint256 _maxDelta); +// 0x6d172ab2 +error ProtocolVersionShouldBeGreater(uint256 _oldProtocolVersion, uint256 _newProtocolVersion); +// 0x88d7b498 +error ProtocolVersionTooSmall(); +// 0xd92e233d +error ZeroAddress(); diff --git a/l2-contracts/contracts/errors/L2ContractErrors.sol b/l2-contracts/contracts/errors/L2ContractErrors.sol index fe671f374..04ee4e165 100644 --- a/l2-contracts/contracts/errors/L2ContractErrors.sol +++ b/l2-contracts/contracts/errors/L2ContractErrors.sol @@ -2,33 +2,37 @@ // We use a floating point pragma here so it can be used within other projects that interact with the zkSync ecosystem without using our exact pragma version. pragma solidity ^0.8.20; -// 0xb4fa3fb3 -error InvalidInput(); -// 0x2a1b2dd8 -error InsufficientAllowance(uint256 providedAllowance, uint256 requiredAmount); -// 0x1bdfd505 -error FailedToTransferTokens(address tokenContract, address to, uint256 amount); -// 0xff15b069 -error UnsupportedPaymasterFlow(); -// 0xd92e233d -error ZeroAddress(); -// 0x1c25715b -error EmptyBytes32(); // 0x1f73225f error AddressMismatch(address expected, address supplied); // 0x5e85ae73 error AmountMustBeGreaterThanZero(); // 0xb4f54111 error DeployFailed(); -// 0x8e4a23d6 -error Unauthorized(address); +// 0x7138356f +error EmptyAddress(); +// 0x1c25715b +error EmptyBytes32(); +// 0x1bdfd505 +error FailedToTransferTokens(address tokenContract, address to, uint256 amount); +// 0x2a1b2dd8 +error InsufficientAllowance(uint256 providedAllowance, uint256 requiredAmount); +// 0xcbd9d2e0 +error InvalidCaller(address); +// 0xb4fa3fb3 +error InvalidInput(); // 0x0ac76f01 error NonSequentialVersion(); +// 0x8e4a23d6 +error Unauthorized(address); // 0x6e128399 error Unimplemented(); // 0xa4dde386 error UnimplementedMessage(string); +// 0xff15b069 +error UnsupportedPaymasterFlow(); // 0x750b219c error WithdrawFailed(); +// 0xd92e233d +error ZeroAddress(); string constant BRIDGE_MINT_NOT_IMPLEMENTED = "bridgeMint is not implemented! Use deposit/depositTo methods instead."; diff --git a/system-contracts/SystemContractsHashes.json b/system-contracts/SystemContractsHashes.json index ad893dbda..77cfcad79 100644 --- a/system-contracts/SystemContractsHashes.json +++ b/system-contracts/SystemContractsHashes.json @@ -3,49 +3,49 @@ "contractName": "AccountCodeStorage", "bytecodePath": "artifacts-zk/contracts-preprocessed/AccountCodeStorage.sol/AccountCodeStorage.json", "sourceCodePath": "contracts-preprocessed/AccountCodeStorage.sol", - "bytecodeHash": "0x0100005d91881d4c952734bbe8e1c99fd8bc1274b2606b2f8224f01d7fca847c", + "bytecodeHash": "0x0100005d3b163f32c9b9b334d3cd0aa4adb77c49f6ee037224215c99fdce3900", "sourceCodeHash": "0x69d2533e5481ff13e65f4442e650f4b90c46a48ac643cac9798bbbf421194353" }, { "contractName": "BootloaderUtilities", "bytecodePath": "artifacts-zk/contracts-preprocessed/BootloaderUtilities.sol/BootloaderUtilities.json", "sourceCodePath": "contracts-preprocessed/BootloaderUtilities.sol", - "bytecodeHash": "0x010007c75ecd733b417ddcd57042596f8fc960cc1b633e260de38c3a0a107d1b", + "bytecodeHash": "0x010007c7885228751494496d7f019e136cc082665d0e8bc4276e2e83a5dd4cf6", "sourceCodeHash": "0x26060f33c7c63bd1f8a1a2f3b368b97ef8dd939bc53e95090f2c556248b99dce" }, { "contractName": "ComplexUpgrader", "bytecodePath": "artifacts-zk/contracts-preprocessed/ComplexUpgrader.sol/ComplexUpgrader.json", "sourceCodePath": "contracts-preprocessed/ComplexUpgrader.sol", - "bytecodeHash": "0x0100004dc99e0a8002c7e1b459cfb3764f0f553055834ebae78ba5ae360374ec", + "bytecodeHash": "0x0100004d7e2b38d06607ccd9b55a0302478f4665ff3dd0015647dfba29a9ed94", "sourceCodeHash": "0xdde7c49a94cc3cd34c3e7ced1b5ba45e4740df68d26243871edbe393e7298f7a" }, { "contractName": "Compressor", "bytecodePath": "artifacts-zk/contracts-preprocessed/Compressor.sol/Compressor.json", "sourceCodePath": "contracts-preprocessed/Compressor.sol", - "bytecodeHash": "0x0100014f407f1c3a4274fe522fea6fdad39bc0e705278347a043168b5b4e3b8e", + "bytecodeHash": "0x0100014f91cbf484c4444fdd2a46b44b3fe559173c3df576b919cac6383c0c14", "sourceCodeHash": "0x5ca10312f1b6df0bfe69bf2d76d8f52dcb9415bd320faf2759a955c083155c24" }, { "contractName": "ContractDeployer", "bytecodePath": "artifacts-zk/contracts-preprocessed/ContractDeployer.sol/ContractDeployer.json", "sourceCodePath": "contracts-preprocessed/ContractDeployer.sol", - "bytecodeHash": "0x010004e518b9ac4f732d6ef710e265424f062cefdf87d9664c6ac2b6646bda67", + "bytecodeHash": "0x010004e51c91beb53fd14120ceb12dc7dc738f9c4eb1c4eb7788ab5000f3206f", "sourceCodeHash": "0x0137817fd5e67d33f02ade33cd333bd5b01288cdef454c64178afd9b4a95b576" }, { "contractName": "Create2Factory", "bytecodePath": "artifacts-zk/contracts-preprocessed/Create2Factory.sol/Create2Factory.json", "sourceCodePath": "contracts-preprocessed/Create2Factory.sol", - "bytecodeHash": "0x0100004964a69cf0ad9edde3395ab8806961c26a1739bc659c2ce30eef12bdf0", + "bytecodeHash": "0x0100004983a8874577736e4858d6da95e60a75a68461d8b0602b49d896ffe3cf", "sourceCodeHash": "0x217e65f55c8add77982171da65e0db8cc10141ba75159af582973b332a4e098a" }, { "contractName": "DefaultAccount", "bytecodePath": "artifacts-zk/contracts-preprocessed/DefaultAccount.sol/DefaultAccount.json", "sourceCodePath": "contracts-preprocessed/DefaultAccount.sol", - "bytecodeHash": "0x0100055dde946e4d1f4d8aec08c153a342f172df61ac7e49dc90c7531c16d9d4", + "bytecodeHash": "0x0100055dbf9df62990496e27d64f4557f853816c52611b512ab948020f15d023", "sourceCodeHash": "0xeb5ac8fc83e1c8619db058a9b6973958bd6ed1b6f4938f8f4541d702f12e085d" }, { @@ -59,56 +59,56 @@ "contractName": "ImmutableSimulator", "bytecodePath": "artifacts-zk/contracts-preprocessed/ImmutableSimulator.sol/ImmutableSimulator.json", "sourceCodePath": "contracts-preprocessed/ImmutableSimulator.sol", - "bytecodeHash": "0x0100003b17d6952d82914e3fc9b4bf813f65f009558172bfc70196b8e5c0836f", + "bytecodeHash": "0x0100003b1d99ee08adb8d149425ee30259af14ee5202e801f45366fac4d05938", "sourceCodeHash": "0x4212e99cbc1722887cfb5b4cb967f278ac8642834786f0e3c6f3b324a9316815" }, { "contractName": "KnownCodesStorage", "bytecodePath": "artifacts-zk/contracts-preprocessed/KnownCodesStorage.sol/KnownCodesStorage.json", "sourceCodePath": "contracts-preprocessed/KnownCodesStorage.sol", - "bytecodeHash": "0x0100006fbd25d3cb3215ae2361d4ed69ac51f519bdb3b9f7abee89d99a37097c", + "bytecodeHash": "0x0100006f6a034696250ce07c8ca6bd5821db6ceeb0f4502cf4da8aac58f19a65", "sourceCodeHash": "0x8da495a9fc5aa0d7d20a165a4fc8bc77012bec29c472015ea5ecc0a2bd706137" }, { "contractName": "L1Messenger", "bytecodePath": "artifacts-zk/contracts-preprocessed/L1Messenger.sol/L1Messenger.json", "sourceCodePath": "contracts-preprocessed/L1Messenger.sol", - "bytecodeHash": "0x010002956a370eacf281d04d903aeb4f9400c41874fd585c2f54de45ec57e574", + "bytecodeHash": "0x01000295078c194d5b884027bb26b7ea57ad3b29cbba9463f871925743056414", "sourceCodeHash": "0x56b52c45f8ae34153833d79903a5cce6351fa770362e51cfc4c32842f32dfdca" }, { "contractName": "L2BaseToken", "bytecodePath": "artifacts-zk/contracts-preprocessed/L2BaseToken.sol/L2BaseToken.json", "sourceCodePath": "contracts-preprocessed/L2BaseToken.sol", - "bytecodeHash": "0x01000105106de4e04e674b2658c432ac31f152f10200f4b06259f2c666c38ab4", + "bytecodeHash": "0x01000105eab57a653ca158f9f3a84036fe0ddf0e45e82c4bcdf75536be075d56", "sourceCodeHash": "0x4cdafafd4cfdf410b31641e14487ea657be3af25e5ec1754fcd7ad67ec23d8be" }, { "contractName": "MsgValueSimulator", "bytecodePath": "artifacts-zk/contracts-preprocessed/MsgValueSimulator.sol/MsgValueSimulator.json", "sourceCodePath": "contracts-preprocessed/MsgValueSimulator.sol", - "bytecodeHash": "0x0100005da728f09718d77848af51dfa705041f597045a1a1aa890338830985f8", + "bytecodeHash": "0x0100005d0dbf298609aef3f44fd2f7fad864dcd8e9399df1535480fff9d3c044", "sourceCodeHash": "0x4834adf62dbaefa1a1c15d36b5ad1bf2826e7d888a17be495f7ed4e4ea381aa8" }, { "contractName": "NonceHolder", "bytecodePath": "artifacts-zk/contracts-preprocessed/NonceHolder.sol/NonceHolder.json", "sourceCodePath": "contracts-preprocessed/NonceHolder.sol", - "bytecodeHash": "0x010000db565c8a5aec948d1b3eeab55b772a061f845df55adb7d1ad7e8c2848d", + "bytecodeHash": "0x010000db5657ca0991c23993d212e8bf94cf99fdab6e7867dd37ac4492c79e33", "sourceCodeHash": "0x4016403a10fdc850226193b990a646953b34a939ea53d442cdd6c5a85bd5ac08" }, { "contractName": "PubdataChunkPublisher", "bytecodePath": "artifacts-zk/contracts-preprocessed/PubdataChunkPublisher.sol/PubdataChunkPublisher.json", "sourceCodePath": "contracts-preprocessed/PubdataChunkPublisher.sol", - "bytecodeHash": "0x01000047dfa5892b10dbfb54afe5d8ad6a35b8bdf043b80c18c624f8b8e4c140", + "bytecodeHash": "0x0100004754eae333cc56bf0237c40481ca48540a976fffbbf1c0f45a87804d35", "sourceCodeHash": "0x0568a9a12bdac94c9e055ca303824a6bf4dc4aa503cfe9a2586c7d3dda8d45da" }, { "contractName": "SystemContext", "bytecodePath": "artifacts-zk/contracts-preprocessed/SystemContext.sol/SystemContext.json", "sourceCodePath": "contracts-preprocessed/SystemContext.sol", - "bytecodeHash": "0x010001a59e1fb239a4fd8cd649deea46cd0e13a32298b71345a895e33869d1de", + "bytecodeHash": "0x010001a5ad6162eedcf124ae5b98e441872616c20107b7737768622a84e3687f", "sourceCodeHash": "0xf23d12ad2f17ad3b26e909fabfdcfaf4e1d158923e7cb8eeb9b5965a0b464406" }, { @@ -178,35 +178,35 @@ "contractName": "bootloader_test", "bytecodePath": "bootloader/build/artifacts/bootloader_test.yul.zbin", "sourceCodePath": "bootloader/build/bootloader_test.yul", - "bytecodeHash": "0x010003cbe4a3c8ec369632d0b16e9da5d858c78471aecc65bdfc3ff296bdd9f5", - "sourceCodeHash": "0x9cbb929022e504d07efd7540421dcc9b9ee26f470fb80b95a00c7cf174eb9b06" + "bytecodeHash": "0x010003cb52ea9cff75344dede59a2b8163881ac0ccea5813f4d04a35b341ed56", + "sourceCodeHash": "0xf8e37c10143ab3a43da782ecbbd236c18d7492cdb2a6c71f4b12a5741243c178" }, { "contractName": "fee_estimate", "bytecodePath": "bootloader/build/artifacts/fee_estimate.yul.zbin", "sourceCodePath": "bootloader/build/fee_estimate.yul", - "bytecodeHash": "0x0100094f6ee2c7c176857802ec4481d4a2649b67efd5d68de2d4dd1471f81861", - "sourceCodeHash": "0x78e55935f5bd1e09a2d084878e6974b44d7564c84b33fa52588777012661137f" + "bytecodeHash": "0x0100094fb8fbbd0e9c76c7e68cc0a0faecda23ebd8e4eec200f494e9342fe17f", + "sourceCodeHash": "0xec00261d49d0b82811a8d7529252d76d7f3bfa42d91c5600785b013d2a5df327" }, { "contractName": "gas_test", "bytecodePath": "bootloader/build/artifacts/gas_test.yul.zbin", "sourceCodePath": "bootloader/build/gas_test.yul", - "bytecodeHash": "0x010008d59743b8cbd52a2a034a1d5200aafa7d7c2784aa69c1a4333d1f453f54", - "sourceCodeHash": "0x799854bdd48b5a0d4be4efcf601542c6fc6fb5937a29365f7daf68ec301f0972" + "bytecodeHash": "0x010008d5478540ee3e984dac9a2c23aba4b82c1408053ed73e7c39e4c65a89e2", + "sourceCodeHash": "0x9d5225c795d0709610f10fa059c6d6e4d4964f51baefc97ad643848c580c2a91" }, { "contractName": "playground_batch", "bytecodePath": "bootloader/build/artifacts/playground_batch.yul.zbin", "sourceCodePath": "bootloader/build/playground_batch.yul", - "bytecodeHash": "0x0100095546b959505b9f632dec28f5f331c639825b63c25efadc3e3d22b4206b", - "sourceCodeHash": "0x7c2d69744a7a4ae800dcf27ea0d19fa9d5e1f3d849482aba1482768b4e09e71a" + "bytecodeHash": "0x010009557711302d8ce42f7aaecee355b0cade173c7e2f6b09c1ce67d84cf497", + "sourceCodeHash": "0x56afe1cda5a4b377173e0784b30c6c2922f17a112bf5eb79a82e4c0fd8fbd053" }, { "contractName": "proved_batch", "bytecodePath": "bootloader/build/artifacts/proved_batch.yul.zbin", "sourceCodePath": "bootloader/build/proved_batch.yul", - "bytecodeHash": "0x010008e57fa98b54ec86c7ea969e29563ca156f29c4e7517fc21462a7bf661c0", - "sourceCodeHash": "0x0ee3065668bc1bc82cad2f458763022bed8c4e1ef02c0a88f81fd380b1ee1698" + "bytecodeHash": "0x010008e5f411e0446e70b14a994e657d11a0767ea58969167204e4735be8971f", + "sourceCodeHash": "0xec280a94e69fc22885ae46f7f405d053179d71b03d2ebb7720ea4a2b7c2f60a3" } ] diff --git a/system-contracts/contracts/SystemContractErrors.sol b/system-contracts/contracts/SystemContractErrors.sol index b89cd8022..21d0ae065 100644 --- a/system-contracts/contracts/SystemContractErrors.sol +++ b/system-contracts/contracts/SystemContractErrors.sol @@ -2,114 +2,116 @@ // We use a floating point pragma here so it can be used within other projects that interact with the zkSync ecosystem without using our exact pragma version. pragma solidity ^0.8.20; -// 0x8e4a23d6 -error Unauthorized(address); -// 0x6a84bc39 -error InvalidCodeHash(CodeHashReason); -// 0x17a84415 -error UnsupportedTxType(uint256); // 0x86bb51b8 error AddressHasNoCode(address); -// 0x4e23d035 -error IndexOutOfBounds(); -// 0x626ade30 -error ValueMismatch(uint256 expected, uint256 actual); -// 0x86302004 -error HashMismatch(bytes32 expected, uint256 actual); -// 0x122e73e9 -error IndexSizeError(); -// 0x9ba6061b -error UnsupportedOperation(); -// 0x60b85677 -error InvalidNonceOrderingChange(); +// 0xefce78c7 +error CallerMustBeBootloader(); +// 0xb7549616 +error CallerMustBeForceDeployer(); +// 0x9eedbd2b +error CallerMustBeSystemContract(); +// 0x4f951510 +error CompressionValueAddError(uint256 expected, uint256 actual); +// 0x1e6aff87 +error CompressionValueTransformError(uint256 expected, uint256 actual); +// 0xc2ea251e +error CompressionValueSubError(uint256 expected, uint256 actual); +// 0x849acb7f +error CompressorInitialWritesProcessedNotEqual(uint256 expected, uint256 actual); +// 0x61a6a4b3 +error CompressorEnumIndexNotEqual(uint256 expected, uint256 actual); +// 0x9be48d8d +error DerivedKeyNotEqualToCompressedValue(bytes32 expected, bytes32 provided); +// 0xe223db5e +error DictionaryDividedByEightNotGreaterThanEncodedDividedByTwo(); // 0x1c25715b error EmptyBytes32(); -// 0x50df6bc3 -error NotAllowedToDeployInKernelSpace(); +// 0x92bf3cf8 +error EmptyVirtualBlocks(); +// 0xc06d5cb2 +error EncodedAndRealBytecodeChunkNotEqual(uint64 expected, uint64 provided); +// 0x2bfbfc11 +error EncodedLengthNotFourTimesSmallerThanOriginal(); +// 0xe95a1fbe +error FailedToChargeGas(); +// 0x1f70c58f +error FailedToPayOperator(); +// 0x9d5da395 +error FirstL2BlockInitializationError(); // 0x9e4a3c8a error HashIsNonZero(bytes32); -// 0x760a1568 -error NonEmptyAccount(); -// 0x3e5efef9 -error UnknownCodeHash(bytes32); -// 0x536ec84b -error NonEmptyMsgValue(); +// 0x86302004 +error HashMismatch(bytes32 expected, uint256 actual); +// 0x4e23d035 +error IndexOutOfBounds(); +// 0x122e73e9 +error IndexSizeError(); // 0x03eb8b54 error InsufficientFunds(uint256 required, uint256 actual); -// 0x90f049c9 -error InvalidSig(SigField, uint256); -// 0x1f70c58f -error FailedToPayOperator(); // 0x1c26714c error InsufficientGas(); -// 0x43e266b0 -error MalformedBytecode(BytecodeError); -// 0x7f7b0cf7 -error ReconstructionMismatch(PubdataField, bytes32 expected, bytes32 actual); // 0xae962d4e error InvalidCall(); +// 0x6a84bc39 +error InvalidCodeHash(CodeHashReason); +// 0xb4fa3fb3 +error InvalidInput(); +// 0x60b85677 +error InvalidNonceOrderingChange(); +// 0x90f049c9 +error InvalidSig(SigField, uint256); +// 0xf4a271b5 +error Keccak256InvalidReturnData(); +// 0xd2906dd9 +error L2BlockMustBeGreaterThanZero(); +// 0x43e266b0 +error MalformedBytecode(BytecodeError); +// 0xe90aded4 +error NonceAlreadyUsed(address account, uint256 nonce); // 0x45ac24a6 error NonceIncreaseError(uint256 max, uint256 proposed); -// 0x6818f3f9 -error ZeroNonceError(); // 0x13595475 error NonceJumpError(); -// 0xe90aded4 -error NonceAlreadyUsed(address account, uint256 nonce); // 0x1f2f8478 error NonceNotUsed(address account, uint256 nonce); -// 0xe0456dfe -error TooMuchPubdata(uint256 limit, uint256 supplied); -// 0x5708aead -error UpgradeMustBeFirstTxn(); -// 0xd2906dd9 -error L2BlockMustBeGreaterThanZero(); -// 0x9d5da395 -error FirstL2BlockInitializationError(); +// 0x760a1568 +error NonEmptyAccount(); +// 0x536ec84b +error NonEmptyMsgValue(); // 0xd018e08e error NonIncreasingTimestamp(); -// 0x92bf3cf8 -error EmptyVirtualBlocks(); -// 0x71c3da01 -error SystemCallFlagRequired(); -// 0x9eedbd2b -error CallerMustBeSystemContract(); -// 0xefce78c7 -error CallerMustBeBootloader(); -// 0xb7549616 -error CallerMustBeForceDeployer(); -// 0xe95a1fbe -error FailedToChargeGas(); +// 0x50df6bc3 +error NotAllowedToDeployInKernelSpace(); // 0x35278d12 error Overflow(); -// 0xb4fa3fb3 -error InvalidInput(); -// 0xff15b069 -error UnsupportedPaymasterFlow(); -// 0x2bfbfc11 -error EncodedLengthNotFourTimesSmallerThanOriginal(); -// 0xc06d5cb2 -error EncodedAndRealBytecodeChunkNotEqual(uint64 expected, uint64 provided); -// 0x9be48d8d -error DerivedKeyNotEqualToCompressedValue(bytes32 expected, bytes32 provided); -// 0xf4a271b5 -error Keccak256InvalidReturnData(); +// 0x7f7b0cf7 +error ReconstructionMismatch(PubdataField, bytes32 expected, bytes32 actual); // 0x3adb5f1d error ShaInvalidReturnData(); -// 0x849acb7f -error CompressorInitialWritesProcessedNotEqual(uint256 expected, uint256 actual); -// 0x61a6a4b3 -error CompressorEnumIndexNotEqual(uint256 expected, uint256 actual); // 0xbd8665e2 error StateDiffLengthMismatch(); -// 0x1e6aff87 -error CompressionValueTransformError(uint256 expected, uint256 actual); -// 0x4f951510 -error CompressionValueAddError(uint256 expected, uint256 actual); -// 0xc2ea251e -error CompressionValueSubError(uint256 expected, uint256 actual); -// 0xe223db5e -error DictionaryDividedByEightNotGreaterThanEncodedDividedByTwo(); +// 0x71c3da01 +error SystemCallFlagRequired(); +// 0xe0456dfe +error TooMuchPubdata(uint256 limit, uint256 supplied); +// 0x8e4a23d6 +error Unauthorized(address); +// 0x3e5efef9 +error UnknownCodeHash(bytes32); +// 0x9ba6061b +error UnsupportedOperation(); +// 0xff15b069 +error UnsupportedPaymasterFlow(); +// 0x17a84415 +error UnsupportedTxType(uint256); +// 0x5708aead +error UpgradeMustBeFirstTxn(); +// 0x626ade30 +error ValueMismatch(uint256 expected, uint256 actual); +// 0x460b9939 +error ValuesNotEqual(uint256 expected, uint256 actual); +// 0x6818f3f9 +error ZeroNonceError(); enum CodeHashReason { NotContractOnConstructor,