From 07f80d528e1cadc4ef27153f120471d95d88301b Mon Sep 17 00:00:00 2001 From: VGau Date: Mon, 9 Dec 2024 17:26:57 +0100 Subject: [PATCH 01/14] fix: update contracts folder structure --- .../contracts/tools/ProxyAdminReplica.sol | 12 ---------- contracts/foundry.toml | 2 +- contracts/hardhat.config.ts | 1 + .../IntegrationTestTrueVerifier.sol | 2 +- .../L2MessageServiceLineaMainnet.sol | 0 .../_testing/integration}/LineaRollupV5.sol | 0 .../_testing/integration}/ProxyAdmin.sol | 0 .../integration}/TokenBridgeFlatten.sol | 0 .../TransparentUpgradeableProxy.sol | 0 .../mocks/base}/RevertingVerifier.sol | 2 +- .../mocks/base}/TestClaimingCaller.sol | 2 +- .../mocks/base}/TestL1RevertContract.sol | 0 .../mocks/base}/TestReceivingContract.sol | 0 .../mocks/bridging}/MockMessageService.sol | 2 +- .../mocks/bridging}/MockMessageServiceV2.sol | 6 ++--- .../mocks/bridging}/MockTokenBridge.sol | 2 +- .../mocks/bridging}/TestTokenBridge.sol | 2 +- .../mocks/bridging}/UpgradedBridgedToken.sol | 2 +- .../security/reentrancy}/MaliciousERC777.sol | 0 .../reentrancy}/ReentrancyContract.sol | 2 +- .../_testing/mocks/tokens}/ERC20MintBurn.sol | 0 .../mocks/tokens}/ERC20NoNameMintBurn.sol | 0 .../mocks/tokens}/ERC20UnknownDecimals.sol | 0 .../mocks/tokens}/ERC20WeirdNameSymbol.sol | 0 .../_testing/mocks/tokens}/ERCFees.sol | 0 .../_testing/mocks/tokens}/TestERC20.sol | 0 .../_testing/unit}/TestEIP4844.sol | 0 .../_testing/unit}/TestExternalCalls.sol | 0 .../_testing/unit}/TestL1MessageManager.sol | 2 +- .../_testing/unit}/TestL1MessageService.sol | 2 +- .../unit}/TestL1MessageServiceMerkleProof.sol | 4 ++-- .../_testing/unit}/TestL2MessageManager.sol | 4 ++-- .../_testing/unit}/TestL2MessageService.sol | 2 +- .../_testing/unit}/TestLineaRollup.sol | 2 +- .../_testing/unit}/TestLineaRollupV5.sol | 2 +- .../_testing/unit}/TestLineaSurgeXP.sol | 0 .../_testing/unit}/TestMessageServiceBase.sol | 2 +- .../_testing/unit}/TestPauseManager.sol | 2 +- .../TestPlonkVerifierForDataAggregation.sol | 0 .../unit}/TestPublicInputVerifier.sol | 2 +- .../_testing/unit}/TestRateLimiter.sol | 2 +- .../_testing/unit}/TestSetPauseTypeRoles.sol | 2 +- .../unit}/TestSparseMerkleTreeVerifier.sol | 4 ++-- .../_testing/unit}/TestUtils.sol | 2 +- .../bridging/token}/BridgedToken.sol | 0 .../bridging/token}/CustomBridgedToken.sol | 0 .../bridging/token}/TokenBridge.sol | 12 +++++----- .../token}/interfaces/ITokenBridge.sol | 4 ++-- .../bridging/token/utils}/StorageFiller39.sol | 0 .../lib => src/governance}/TimeLock.sol | 0 .../interfaces/IGenericErrors.sol | 0 .../{contracts/lib => src/libraries}/Mimc.sol | 0 .../libraries}/SparseMerkleProof.sol | 0 .../libraries}/TransientStorageHelpers.sol | 0 .../lib => src/libraries}/Utils.sol | 0 .../messaging}/MessageServiceBase.sol | 2 +- .../messaging}/interfaces/IMessageService.sol | 0 .../messaging}/l1/L1MessageManager.sol | 4 ++-- .../messaging}/l1/L1MessageService.sol | 8 +++---- .../l1/interfaces}/IL1MessageManager.sol | 0 .../l1/interfaces}/IL1MessageService.sol | 0 .../messaging}/l1/v1/L1MessageManagerV1.sol | 2 +- .../messaging}/l1/v1/L1MessageServiceV1.sol | 12 +++++----- .../l1/v1/interfaces}/IL1MessageManagerV1.sol | 0 .../messaging}/l2/L2MessageManager.sol | 4 ++-- .../messaging}/l2/L2MessageService.sol | 2 +- .../l2/interfaces}/IL2MessageManager.sol | 0 .../messaging}/l2/v1/L2MessageManagerV1.sol | 4 ++-- .../messaging}/l2/v1/L2MessageServiceV1.sol | 8 +++---- .../l2/v1/interfaces}/IL2MessageManagerV1.sol | 0 .../l2/v1/interfaces}/IL2MessageServiceV1.sol | 0 .../messaging/libraries}/MessageHashing.sol | 0 .../libraries}/SparseMerkleTreeVerifier.sol | 2 +- .../proxies}/CallForwardingProxy.sol | 0 .../tools => src/recovery}/RecoverFunds.sol | 2 +- .../recovery/interfaces}/IRecoverFunds.sol | 0 .../{contracts => src/rollup}/LineaRollup.sol | 8 +++---- .../{contracts => src/rollup}/ZkEvmV2.sol | 6 ++--- .../rollup/interfaces}/ILineaRollup.sol | 4 ++-- .../l1 => src/rollup/interfaces}/IZkEvmV2.sol | 0 .../security/access}/PermissionsManager.sol | 4 ++-- .../interfaces/IPermissionsManager.sol | 0 .../security/limiting}/RateLimiter.sol | 2 +- .../limiting}/interfaces/IRateLimiter.sol | 0 .../pausing}/L2MessageServicePauseManager.sol | 0 .../pausing}/LineaRollupPauseManager.sol | 0 .../security/pausing}/PauseManager.sol | 2 +- .../pausing}/TokenBridgePauseManager.sol | 0 .../pausing}/interfaces/IPauseManager.sol | 0 ...sientStorageReentrancyGuardUpgradeable.sol | 2 +- .../token => src/tokens}/LineaSurgeXP.sol | 0 .../token => src/tokens}/LineaVoyageXP.sol | 0 .../tokens}/TokenMintingRateLimiter.sol | 4 ++-- .../tokens/interfaces}/ITokenMinter.sol | 0 .../interfaces}/ITokenMintingRateLimiter.sol | 0 .../verifiers/PlonkVerifierDev.sol | 0 .../PlonkVerifierForDataAggregation.sol | 0 ...onkVerifierForMultiTypeDataAggregation.sol | 0 .../{contracts => src}/verifiers/Utils.sol | 0 .../verifiers/interfaces}/IPlonkVerifier.sol | 0 contracts/test/LineaRollup.ts | 24 +++++++++---------- .../messageService/l2/L2MessageService.ts | 10 ++++---- contracts/test/tokenBridge/TokenBridge.ts | 4 ++-- 103 files changed, 98 insertions(+), 109 deletions(-) delete mode 100644 contracts/contracts/tools/ProxyAdminReplica.sol rename contracts/{contracts/test-contracts => src/_testing/integration}/IntegrationTestTrueVerifier.sol (78%) rename contracts/{contracts/test-contracts => src/_testing/integration}/L2MessageServiceLineaMainnet.sol (100%) rename contracts/{contracts/test-contracts => src/_testing/integration}/LineaRollupV5.sol (100%) rename contracts/{contracts/proxies => src/_testing/integration}/ProxyAdmin.sol (100%) rename contracts/{contracts/tokenBridge/mocks => src/_testing/integration}/TokenBridgeFlatten.sol (100%) rename contracts/{contracts/proxies => src/_testing/integration}/TransparentUpgradeableProxy.sol (100%) rename contracts/{contracts/test-contracts => src/_testing/mocks/base}/RevertingVerifier.sol (88%) rename contracts/{contracts/test-contracts => src/_testing/mocks/base}/TestClaimingCaller.sol (81%) rename contracts/{contracts/test-contracts => src/_testing/mocks/base}/TestL1RevertContract.sol (100%) rename contracts/{contracts/test-contracts => src/_testing/mocks/base}/TestReceivingContract.sol (100%) rename contracts/{contracts/tokenBridge/mocks => src/_testing/mocks/bridging}/MockMessageService.sol (93%) rename contracts/{contracts/tokenBridge/mocks/MessageBridgeV2 => src/_testing/mocks/bridging}/MockMessageServiceV2.sol (88%) rename contracts/{contracts/tokenBridge/mocks => src/_testing/mocks/bridging}/MockTokenBridge.sol (76%) rename contracts/{contracts/tokenBridge/mocks => src/_testing/mocks/bridging}/TestTokenBridge.sol (77%) rename contracts/{contracts/tokenBridge/mocks => src/_testing/mocks/bridging}/UpgradedBridgedToken.sol (72%) rename contracts/{contracts/tokenBridge/mocks/Reentrancy => src/_testing/mocks/security/reentrancy}/MaliciousERC777.sol (100%) rename contracts/{contracts/tokenBridge/mocks/Reentrancy => src/_testing/mocks/security/reentrancy}/ReentrancyContract.sol (92%) rename contracts/{contracts/tokenBridge/mocks => src/_testing/mocks/tokens}/ERC20MintBurn.sol (100%) rename contracts/{contracts/tokenBridge/mocks => src/_testing/mocks/tokens}/ERC20NoNameMintBurn.sol (100%) rename contracts/{contracts/tokenBridge/mocks => src/_testing/mocks/tokens}/ERC20UnknownDecimals.sol (100%) rename contracts/{contracts/tokenBridge/mocks => src/_testing/mocks/tokens}/ERC20WeirdNameSymbol.sol (100%) rename contracts/{contracts/tokenBridge/mocks => src/_testing/mocks/tokens}/ERCFees.sol (100%) rename contracts/{contracts/tokenBridge/mocks => src/_testing/mocks/tokens}/TestERC20.sol (100%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestEIP4844.sol (100%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestExternalCalls.sol (100%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestL1MessageManager.sol (94%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestL1MessageService.sol (97%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestL1MessageServiceMerkleProof.sol (94%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestL2MessageManager.sol (90%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestL2MessageService.sol (96%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestLineaRollup.sol (96%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestLineaRollupV5.sol (84%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestLineaSurgeXP.sol (100%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestMessageServiceBase.sol (90%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestPauseManager.sol (87%) rename contracts/{contracts/verifiers/test => src/_testing/unit}/TestPlonkVerifierForDataAggregation.sol (100%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestPublicInputVerifier.sol (85%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestRateLimiter.sol (91%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestSetPauseTypeRoles.sol (83%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestSparseMerkleTreeVerifier.sol (87%) rename contracts/{contracts/test-contracts => src/_testing/unit}/TestUtils.sol (82%) rename contracts/{contracts/tokenBridge => src/bridging/token}/BridgedToken.sol (100%) rename contracts/{contracts/tokenBridge => src/bridging/token}/CustomBridgedToken.sol (100%) rename contracts/{contracts/tokenBridge => src/bridging/token}/TokenBridge.sol (98%) rename contracts/{contracts/tokenBridge => src/bridging/token}/interfaces/ITokenBridge.sol (98%) rename contracts/{contracts/tokenBridge/lib => src/bridging/token/utils}/StorageFiller39.sol (100%) rename contracts/{contracts/messageService/lib => src/governance}/TimeLock.sol (100%) rename contracts/{contracts => src}/interfaces/IGenericErrors.sol (100%) rename contracts/{contracts/lib => src/libraries}/Mimc.sol (100%) rename contracts/{contracts/lib => src/libraries}/SparseMerkleProof.sol (100%) rename contracts/{contracts/messageService/lib => src/libraries}/TransientStorageHelpers.sol (100%) rename contracts/{contracts/lib => src/libraries}/Utils.sol (100%) rename contracts/{contracts/messageService => src/messaging}/MessageServiceBase.sol (97%) rename contracts/{contracts => src/messaging}/interfaces/IMessageService.sol (100%) rename contracts/{contracts/messageService => src/messaging}/l1/L1MessageManager.sol (97%) rename contracts/{contracts/messageService => src/messaging}/l1/L1MessageService.sol (94%) rename contracts/{contracts/interfaces/l1 => src/messaging/l1/interfaces}/IL1MessageManager.sol (100%) rename contracts/{contracts/interfaces/l1 => src/messaging/l1/interfaces}/IL1MessageService.sol (100%) rename contracts/{contracts/messageService => src/messaging}/l1/v1/L1MessageManagerV1.sol (96%) rename contracts/{contracts/messageService => src/messaging}/l1/v1/L1MessageServiceV1.sol (90%) rename contracts/{contracts/interfaces/l1 => src/messaging/l1/v1/interfaces}/IL1MessageManagerV1.sol (100%) rename contracts/{contracts/messageService => src/messaging}/l2/L2MessageManager.sol (96%) rename contracts/{contracts/messageService => src/messaging}/l2/L2MessageService.sol (97%) rename contracts/{contracts/interfaces/l2 => src/messaging/l2/interfaces}/IL2MessageManager.sol (100%) rename contracts/{contracts/messageService => src/messaging}/l2/v1/L2MessageManagerV1.sol (90%) rename contracts/{contracts/messageService => src/messaging}/l2/v1/L2MessageServiceV1.sol (96%) rename contracts/{contracts/interfaces/l2 => src/messaging/l2/v1/interfaces}/IL2MessageManagerV1.sol (100%) rename contracts/{contracts/interfaces/l2 => src/messaging/l2/v1/interfaces}/IL2MessageServiceV1.sol (100%) rename contracts/{contracts/messageService/lib => src/messaging/libraries}/MessageHashing.sol (100%) rename contracts/{contracts/messageService/lib => src/messaging/libraries}/SparseMerkleTreeVerifier.sol (97%) rename contracts/{contracts/lib => src/proxies}/CallForwardingProxy.sol (100%) rename contracts/{contracts/tools => src/recovery}/RecoverFunds.sol (96%) rename contracts/{contracts/interfaces/tools => src/recovery/interfaces}/IRecoverFunds.sol (100%) rename contracts/{contracts => src/rollup}/LineaRollup.sol (99%) rename contracts/{contracts => src/rollup}/ZkEvmV2.sol (93%) rename contracts/{contracts/interfaces/l1 => src/rollup/interfaces}/ILineaRollup.sol (98%) rename contracts/{contracts/interfaces/l1 => src/rollup/interfaces}/IZkEvmV2.sol (100%) rename contracts/{contracts/lib => src/security/access}/PermissionsManager.sol (88%) rename contracts/{contracts => src/security/access}/interfaces/IPermissionsManager.sol (100%) rename contracts/{contracts/messageService/lib => src/security/limiting}/RateLimiter.sol (98%) rename contracts/{contracts => src/security/limiting}/interfaces/IRateLimiter.sol (100%) rename contracts/{contracts/lib => src/security/pausing}/L2MessageServicePauseManager.sol (100%) rename contracts/{contracts/lib => src/security/pausing}/LineaRollupPauseManager.sol (100%) rename contracts/{contracts/lib => src/security/pausing}/PauseManager.sol (98%) rename contracts/{contracts/lib => src/security/pausing}/TokenBridgePauseManager.sol (100%) rename contracts/{contracts => src/security/pausing}/interfaces/IPauseManager.sol (100%) rename contracts/{contracts/messageService/l1 => src/security/reentrancy}/TransientStorageReentrancyGuardUpgradeable.sol (94%) rename contracts/{contracts/token => src/tokens}/LineaSurgeXP.sol (100%) rename contracts/{contracts/token => src/tokens}/LineaVoyageXP.sol (100%) rename contracts/{contracts/token => src/tokens}/TokenMintingRateLimiter.sol (97%) rename contracts/{contracts/token => src/tokens/interfaces}/ITokenMinter.sol (100%) rename contracts/{contracts/token => src/tokens/interfaces}/ITokenMintingRateLimiter.sol (100%) rename contracts/{contracts => src}/verifiers/PlonkVerifierDev.sol (100%) rename contracts/{contracts => src}/verifiers/PlonkVerifierForDataAggregation.sol (100%) rename contracts/{contracts => src}/verifiers/PlonkVerifierForMultiTypeDataAggregation.sol (100%) rename contracts/{contracts => src}/verifiers/Utils.sol (100%) rename contracts/{contracts/interfaces/l1 => src/verifiers/interfaces}/IPlonkVerifier.sol (100%) diff --git a/contracts/contracts/tools/ProxyAdminReplica.sol b/contracts/contracts/tools/ProxyAdminReplica.sol deleted file mode 100644 index a88c32897..000000000 --- a/contracts/contracts/tools/ProxyAdminReplica.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.8.3) (proxy/transparent/ProxyAdmin.sol) - -pragma solidity ^0.8.0; - -/** - * @dev This is only for operational scripts. Do not use for anything else. - @dev This generates an artefact and contract types in order to use when transferring ownership. - */ -contract ProxyAdminReplica { - function transferOwnership(address newOwner) public {} -} diff --git a/contracts/foundry.toml b/contracts/foundry.toml index 92a329340..c7a025b9f 100644 --- a/contracts/foundry.toml +++ b/contracts/foundry.toml @@ -1,5 +1,5 @@ [profile.default] -src = 'contracts' +src = 'src' out = 'out' libs = ['node_modules', 'lib'] cache_path = 'cache_forge' diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 8fdaad00d..71ac5017f 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -30,6 +30,7 @@ const useViaIR = process.env.ENABLE_VIA_IR === "true"; const config: HardhatUserConfig = { paths: { artifacts: "./build", + sources: "./src", }, solidity: { // NB: double check the autoupdate shell script version complies to the latest solidity version if you add a new one. diff --git a/contracts/contracts/test-contracts/IntegrationTestTrueVerifier.sol b/contracts/src/_testing/integration/IntegrationTestTrueVerifier.sol similarity index 78% rename from contracts/contracts/test-contracts/IntegrationTestTrueVerifier.sol rename to contracts/src/_testing/integration/IntegrationTestTrueVerifier.sol index 597c55e55..f48795aa3 100644 --- a/contracts/contracts/test-contracts/IntegrationTestTrueVerifier.sol +++ b/contracts/src/_testing/integration/IntegrationTestTrueVerifier.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { IPlonkVerifier } from "../interfaces/l1/IPlonkVerifier.sol"; +import { IPlonkVerifier } from "../../verifiers/interfaces/IPlonkVerifier.sol"; contract IntegrationTestTrueVerifier is IPlonkVerifier { /// @dev Always returns true for quick turnaround testing. diff --git a/contracts/contracts/test-contracts/L2MessageServiceLineaMainnet.sol b/contracts/src/_testing/integration/L2MessageServiceLineaMainnet.sol similarity index 100% rename from contracts/contracts/test-contracts/L2MessageServiceLineaMainnet.sol rename to contracts/src/_testing/integration/L2MessageServiceLineaMainnet.sol diff --git a/contracts/contracts/test-contracts/LineaRollupV5.sol b/contracts/src/_testing/integration/LineaRollupV5.sol similarity index 100% rename from contracts/contracts/test-contracts/LineaRollupV5.sol rename to contracts/src/_testing/integration/LineaRollupV5.sol diff --git a/contracts/contracts/proxies/ProxyAdmin.sol b/contracts/src/_testing/integration/ProxyAdmin.sol similarity index 100% rename from contracts/contracts/proxies/ProxyAdmin.sol rename to contracts/src/_testing/integration/ProxyAdmin.sol diff --git a/contracts/contracts/tokenBridge/mocks/TokenBridgeFlatten.sol b/contracts/src/_testing/integration/TokenBridgeFlatten.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/TokenBridgeFlatten.sol rename to contracts/src/_testing/integration/TokenBridgeFlatten.sol diff --git a/contracts/contracts/proxies/TransparentUpgradeableProxy.sol b/contracts/src/_testing/integration/TransparentUpgradeableProxy.sol similarity index 100% rename from contracts/contracts/proxies/TransparentUpgradeableProxy.sol rename to contracts/src/_testing/integration/TransparentUpgradeableProxy.sol diff --git a/contracts/contracts/test-contracts/RevertingVerifier.sol b/contracts/src/_testing/mocks/base/RevertingVerifier.sol similarity index 88% rename from contracts/contracts/test-contracts/RevertingVerifier.sol rename to contracts/src/_testing/mocks/base/RevertingVerifier.sol index 30653630f..fd165a9c1 100644 --- a/contracts/contracts/test-contracts/RevertingVerifier.sol +++ b/contracts/src/_testing/mocks/base/RevertingVerifier.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { IPlonkVerifier } from "../interfaces/l1/IPlonkVerifier.sol"; +import { IPlonkVerifier } from "../../../verifiers/interfaces/IPlonkVerifier.sol"; /// @dev Test verifier contract that returns true. contract RevertingVerifier is IPlonkVerifier { diff --git a/contracts/contracts/test-contracts/TestClaimingCaller.sol b/contracts/src/_testing/mocks/base/TestClaimingCaller.sol similarity index 81% rename from contracts/contracts/test-contracts/TestClaimingCaller.sol rename to contracts/src/_testing/mocks/base/TestClaimingCaller.sol index db67b8374..96171370c 100644 --- a/contracts/contracts/test-contracts/TestClaimingCaller.sol +++ b/contracts/src/_testing/mocks/base/TestClaimingCaller.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { IMessageService } from "../interfaces/IMessageService.sol"; +import { IMessageService } from "../../../messaging/interfaces/IMessageService.sol"; contract TestClaimingCaller { address private expectedAddress; diff --git a/contracts/contracts/test-contracts/TestL1RevertContract.sol b/contracts/src/_testing/mocks/base/TestL1RevertContract.sol similarity index 100% rename from contracts/contracts/test-contracts/TestL1RevertContract.sol rename to contracts/src/_testing/mocks/base/TestL1RevertContract.sol diff --git a/contracts/contracts/test-contracts/TestReceivingContract.sol b/contracts/src/_testing/mocks/base/TestReceivingContract.sol similarity index 100% rename from contracts/contracts/test-contracts/TestReceivingContract.sol rename to contracts/src/_testing/mocks/base/TestReceivingContract.sol diff --git a/contracts/contracts/tokenBridge/mocks/MockMessageService.sol b/contracts/src/_testing/mocks/bridging/MockMessageService.sol similarity index 93% rename from contracts/contracts/tokenBridge/mocks/MockMessageService.sol rename to contracts/src/_testing/mocks/bridging/MockMessageService.sol index 1b0eeb926..b933e4315 100644 --- a/contracts/contracts/tokenBridge/mocks/MockMessageService.sol +++ b/contracts/src/_testing/mocks/bridging/MockMessageService.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.19; -import { IMessageService } from "../../interfaces/IMessageService.sol"; +import { IMessageService } from "../../../messaging/interfaces/IMessageService.sol"; contract MockMessageService is IMessageService { uint256 public constant CALL_GAS_LIMIT = 1000000; diff --git a/contracts/contracts/tokenBridge/mocks/MessageBridgeV2/MockMessageServiceV2.sol b/contracts/src/_testing/mocks/bridging/MockMessageServiceV2.sol similarity index 88% rename from contracts/contracts/tokenBridge/mocks/MessageBridgeV2/MockMessageServiceV2.sol rename to contracts/src/_testing/mocks/bridging/MockMessageServiceV2.sol index 420f78e59..07596e0c4 100644 --- a/contracts/contracts/tokenBridge/mocks/MessageBridgeV2/MockMessageServiceV2.sol +++ b/contracts/src/_testing/mocks/bridging/MockMessageServiceV2.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity >=0.8.19 <=0.8.26; -import { IMessageService } from "../../../interfaces/IMessageService.sol"; +import { IMessageService } from "../../../messaging/interfaces/IMessageService.sol"; import { IGenericErrors } from "../../../interfaces/IGenericErrors.sol"; -import { LineaRollupPauseManager } from "../../../lib/LineaRollupPauseManager.sol"; -import { L1MessageManager } from "../../../messageService/l1/L1MessageManager.sol"; +import { LineaRollupPauseManager } from "../../../security/pausing/LineaRollupPauseManager.sol"; +import { L1MessageManager } from "../../../messaging/l1/L1MessageManager.sol"; contract MockMessageServiceV2 is L1MessageManager, IMessageService, LineaRollupPauseManager, IGenericErrors { address internal messageSender = address(0); diff --git a/contracts/contracts/tokenBridge/mocks/MockTokenBridge.sol b/contracts/src/_testing/mocks/bridging/MockTokenBridge.sol similarity index 76% rename from contracts/contracts/tokenBridge/mocks/MockTokenBridge.sol rename to contracts/src/_testing/mocks/bridging/MockTokenBridge.sol index a2ff67338..5e60f5960 100644 --- a/contracts/contracts/tokenBridge/mocks/MockTokenBridge.sol +++ b/contracts/src/_testing/mocks/bridging/MockTokenBridge.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.19; -import { TokenBridge } from "../TokenBridge.sol"; +import { TokenBridge } from "../../../bridging/token/TokenBridge.sol"; contract MockTokenBridge is TokenBridge { function setNativeMappingValue(address token, address value) external { diff --git a/contracts/contracts/tokenBridge/mocks/TestTokenBridge.sol b/contracts/src/_testing/mocks/bridging/TestTokenBridge.sol similarity index 77% rename from contracts/contracts/tokenBridge/mocks/TestTokenBridge.sol rename to contracts/src/_testing/mocks/bridging/TestTokenBridge.sol index fdf8e926b..75796e338 100644 --- a/contracts/contracts/tokenBridge/mocks/TestTokenBridge.sol +++ b/contracts/src/_testing/mocks/bridging/TestTokenBridge.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.19; -import { TokenBridge } from "../TokenBridge.sol"; +import { TokenBridge } from "../../../bridging/token/TokenBridge.sol"; contract TestTokenBridge is TokenBridge { function testReturnDataToString(bytes memory _data) public pure returns (string memory) { diff --git a/contracts/contracts/tokenBridge/mocks/UpgradedBridgedToken.sol b/contracts/src/_testing/mocks/bridging/UpgradedBridgedToken.sol similarity index 72% rename from contracts/contracts/tokenBridge/mocks/UpgradedBridgedToken.sol rename to contracts/src/_testing/mocks/bridging/UpgradedBridgedToken.sol index fcdca2bcf..723a744e5 100644 --- a/contracts/contracts/tokenBridge/mocks/UpgradedBridgedToken.sol +++ b/contracts/src/_testing/mocks/bridging/UpgradedBridgedToken.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.19; -import { BridgedToken } from "../BridgedToken.sol"; +import { BridgedToken } from "../../../bridging/token/BridgedToken.sol"; contract UpgradedBridgedToken is BridgedToken { function isUpgraded() external pure returns (bool) { diff --git a/contracts/contracts/tokenBridge/mocks/Reentrancy/MaliciousERC777.sol b/contracts/src/_testing/mocks/security/reentrancy/MaliciousERC777.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/Reentrancy/MaliciousERC777.sol rename to contracts/src/_testing/mocks/security/reentrancy/MaliciousERC777.sol diff --git a/contracts/contracts/tokenBridge/mocks/Reentrancy/ReentrancyContract.sol b/contracts/src/_testing/mocks/security/reentrancy/ReentrancyContract.sol similarity index 92% rename from contracts/contracts/tokenBridge/mocks/Reentrancy/ReentrancyContract.sol rename to contracts/src/_testing/mocks/security/reentrancy/ReentrancyContract.sol index 9a071b18b..9868204cf 100644 --- a/contracts/contracts/tokenBridge/mocks/Reentrancy/ReentrancyContract.sol +++ b/contracts/src/_testing/mocks/security/reentrancy/ReentrancyContract.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; -import { TokenBridge } from "../../TokenBridge.sol"; +import { TokenBridge } from "../../../../bridging/token/TokenBridge.sol"; contract ReentrancyContract { // The Linea `TokenBridge` contract diff --git a/contracts/contracts/tokenBridge/mocks/ERC20MintBurn.sol b/contracts/src/_testing/mocks/tokens/ERC20MintBurn.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/ERC20MintBurn.sol rename to contracts/src/_testing/mocks/tokens/ERC20MintBurn.sol diff --git a/contracts/contracts/tokenBridge/mocks/ERC20NoNameMintBurn.sol b/contracts/src/_testing/mocks/tokens/ERC20NoNameMintBurn.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/ERC20NoNameMintBurn.sol rename to contracts/src/_testing/mocks/tokens/ERC20NoNameMintBurn.sol diff --git a/contracts/contracts/tokenBridge/mocks/ERC20UnknownDecimals.sol b/contracts/src/_testing/mocks/tokens/ERC20UnknownDecimals.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/ERC20UnknownDecimals.sol rename to contracts/src/_testing/mocks/tokens/ERC20UnknownDecimals.sol diff --git a/contracts/contracts/tokenBridge/mocks/ERC20WeirdNameSymbol.sol b/contracts/src/_testing/mocks/tokens/ERC20WeirdNameSymbol.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/ERC20WeirdNameSymbol.sol rename to contracts/src/_testing/mocks/tokens/ERC20WeirdNameSymbol.sol diff --git a/contracts/contracts/tokenBridge/mocks/ERCFees.sol b/contracts/src/_testing/mocks/tokens/ERCFees.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/ERCFees.sol rename to contracts/src/_testing/mocks/tokens/ERCFees.sol diff --git a/contracts/contracts/tokenBridge/mocks/TestERC20.sol b/contracts/src/_testing/mocks/tokens/TestERC20.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/TestERC20.sol rename to contracts/src/_testing/mocks/tokens/TestERC20.sol diff --git a/contracts/contracts/test-contracts/TestEIP4844.sol b/contracts/src/_testing/unit/TestEIP4844.sol similarity index 100% rename from contracts/contracts/test-contracts/TestEIP4844.sol rename to contracts/src/_testing/unit/TestEIP4844.sol diff --git a/contracts/contracts/test-contracts/TestExternalCalls.sol b/contracts/src/_testing/unit/TestExternalCalls.sol similarity index 100% rename from contracts/contracts/test-contracts/TestExternalCalls.sol rename to contracts/src/_testing/unit/TestExternalCalls.sol diff --git a/contracts/contracts/test-contracts/TestL1MessageManager.sol b/contracts/src/_testing/unit/TestL1MessageManager.sol similarity index 94% rename from contracts/contracts/test-contracts/TestL1MessageManager.sol rename to contracts/src/_testing/unit/TestL1MessageManager.sol index 5b0705f5e..869a5f10b 100644 --- a/contracts/contracts/test-contracts/TestL1MessageManager.sol +++ b/contracts/src/_testing/unit/TestL1MessageManager.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { L1MessageManager } from "../messageService/l1/L1MessageManager.sol"; +import { L1MessageManager } from "../../messaging/l1/L1MessageManager.sol"; contract TestL1MessageManager is L1MessageManager { /** diff --git a/contracts/contracts/test-contracts/TestL1MessageService.sol b/contracts/src/_testing/unit/TestL1MessageService.sol similarity index 97% rename from contracts/contracts/test-contracts/TestL1MessageService.sol rename to contracts/src/_testing/unit/TestL1MessageService.sol index b4032bc4c..4c48dbf4b 100644 --- a/contracts/contracts/test-contracts/TestL1MessageService.sol +++ b/contracts/src/_testing/unit/TestL1MessageService.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { L1MessageService } from "../messageService/l1/L1MessageService.sol"; +import { L1MessageService } from "../../messaging/l1/L1MessageService.sol"; import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol"; contract TestL1MessageService is L1MessageService, TestSetPauseTypeRoles { diff --git a/contracts/contracts/test-contracts/TestL1MessageServiceMerkleProof.sol b/contracts/src/_testing/unit/TestL1MessageServiceMerkleProof.sol similarity index 94% rename from contracts/contracts/test-contracts/TestL1MessageServiceMerkleProof.sol rename to contracts/src/_testing/unit/TestL1MessageServiceMerkleProof.sol index 456bd01d5..f5c59b181 100644 --- a/contracts/contracts/test-contracts/TestL1MessageServiceMerkleProof.sol +++ b/contracts/src/_testing/unit/TestL1MessageServiceMerkleProof.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { L1MessageService } from "../messageService/l1/L1MessageService.sol"; -import { IL1MessageService } from "../interfaces/l1/IL1MessageService.sol"; +import { L1MessageService } from "../../messaging/l1/L1MessageService.sol"; +import { IL1MessageService } from "../../messaging/l1/interfaces/IL1MessageService.sol"; import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol"; interface ITestL1MessageService { diff --git a/contracts/contracts/test-contracts/TestL2MessageManager.sol b/contracts/src/_testing/unit/TestL2MessageManager.sol similarity index 90% rename from contracts/contracts/test-contracts/TestL2MessageManager.sol rename to contracts/src/_testing/unit/TestL2MessageManager.sol index 435f2c97e..9a19aad6b 100644 --- a/contracts/contracts/test-contracts/TestL2MessageManager.sol +++ b/contracts/src/_testing/unit/TestL2MessageManager.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; -import { L2MessageManager } from "../messageService/l2/L2MessageManager.sol"; -import { IGenericErrors } from "../interfaces/IGenericErrors.sol"; +import { L2MessageManager } from "../../messaging/l2/L2MessageManager.sol"; +import { IGenericErrors } from "../../interfaces/IGenericErrors.sol"; import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol"; contract TestL2MessageManager is Initializable, L2MessageManager, IGenericErrors, TestSetPauseTypeRoles { diff --git a/contracts/contracts/test-contracts/TestL2MessageService.sol b/contracts/src/_testing/unit/TestL2MessageService.sol similarity index 96% rename from contracts/contracts/test-contracts/TestL2MessageService.sol rename to contracts/src/_testing/unit/TestL2MessageService.sol index cf7e5b16f..8b1469533 100644 --- a/contracts/contracts/test-contracts/TestL2MessageService.sol +++ b/contracts/src/_testing/unit/TestL2MessageService.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.19; -import { L2MessageService } from "../messageService/l2/L2MessageService.sol"; +import { L2MessageService } from "../../messaging/l2/L2MessageService.sol"; contract TestL2MessageService is L2MessageService { address public originalSender; diff --git a/contracts/contracts/test-contracts/TestLineaRollup.sol b/contracts/src/_testing/unit/TestLineaRollup.sol similarity index 96% rename from contracts/contracts/test-contracts/TestLineaRollup.sol rename to contracts/src/_testing/unit/TestLineaRollup.sol index 17083ba45..6233a55e9 100644 --- a/contracts/contracts/test-contracts/TestLineaRollup.sol +++ b/contracts/src/_testing/unit/TestLineaRollup.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { LineaRollup } from "../LineaRollup.sol"; +import { LineaRollup } from "../../rollup/LineaRollup.sol"; contract TestLineaRollup is LineaRollup { function addRollingHash(uint256 _messageNumber, bytes32 _messageHash) external { diff --git a/contracts/contracts/test-contracts/TestLineaRollupV5.sol b/contracts/src/_testing/unit/TestLineaRollupV5.sol similarity index 84% rename from contracts/contracts/test-contracts/TestLineaRollupV5.sol rename to contracts/src/_testing/unit/TestLineaRollupV5.sol index 6c880cb7d..9fa1e15f2 100644 --- a/contracts/contracts/test-contracts/TestLineaRollupV5.sol +++ b/contracts/src/_testing/unit/TestLineaRollupV5.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.24; -import { LineaRollupV5 } from "./LineaRollupV5.sol"; +import { LineaRollupV5 } from "../integration/LineaRollupV5.sol"; contract TestLineaRollupV5 is LineaRollupV5 { function setDefaultShnarfExistValue(bytes32 _shnarf) external { diff --git a/contracts/contracts/test-contracts/TestLineaSurgeXP.sol b/contracts/src/_testing/unit/TestLineaSurgeXP.sol similarity index 100% rename from contracts/contracts/test-contracts/TestLineaSurgeXP.sol rename to contracts/src/_testing/unit/TestLineaSurgeXP.sol diff --git a/contracts/contracts/test-contracts/TestMessageServiceBase.sol b/contracts/src/_testing/unit/TestMessageServiceBase.sol similarity index 90% rename from contracts/contracts/test-contracts/TestMessageServiceBase.sol rename to contracts/src/_testing/unit/TestMessageServiceBase.sol index 63b548b9f..71705dcbd 100644 --- a/contracts/contracts/test-contracts/TestMessageServiceBase.sol +++ b/contracts/src/_testing/unit/TestMessageServiceBase.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity >=0.8.19 <=0.8.26; -import { MessageServiceBase } from "../messageService/MessageServiceBase.sol"; +import { MessageServiceBase } from "../../messaging/MessageServiceBase.sol"; contract TestMessageServiceBase is MessageServiceBase { function initialize(address _messageService, address _remoteSender) external initializer { diff --git a/contracts/contracts/test-contracts/TestPauseManager.sol b/contracts/src/_testing/unit/TestPauseManager.sol similarity index 87% rename from contracts/contracts/test-contracts/TestPauseManager.sol rename to contracts/src/_testing/unit/TestPauseManager.sol index 5e7084f1a..152bc6f28 100644 --- a/contracts/contracts/test-contracts/TestPauseManager.sol +++ b/contracts/src/_testing/unit/TestPauseManager.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity >=0.8.19 <=0.8.26; -import { PauseManager } from "../lib/PauseManager.sol"; +import { PauseManager } from "../../security/pausing/PauseManager.sol"; import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol"; contract TestPauseManager is PauseManager, TestSetPauseTypeRoles { diff --git a/contracts/contracts/verifiers/test/TestPlonkVerifierForDataAggregation.sol b/contracts/src/_testing/unit/TestPlonkVerifierForDataAggregation.sol similarity index 100% rename from contracts/contracts/verifiers/test/TestPlonkVerifierForDataAggregation.sol rename to contracts/src/_testing/unit/TestPlonkVerifierForDataAggregation.sol diff --git a/contracts/contracts/test-contracts/TestPublicInputVerifier.sol b/contracts/src/_testing/unit/TestPublicInputVerifier.sol similarity index 85% rename from contracts/contracts/test-contracts/TestPublicInputVerifier.sol rename to contracts/src/_testing/unit/TestPublicInputVerifier.sol index c94494aef..63d95660e 100644 --- a/contracts/contracts/test-contracts/TestPublicInputVerifier.sol +++ b/contracts/src/_testing/unit/TestPublicInputVerifier.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { IPlonkVerifier } from "../interfaces/l1/IPlonkVerifier.sol"; +import { IPlonkVerifier } from "../../verifiers/interfaces/IPlonkVerifier.sol"; /// @dev Test verifier contract that returns true. contract TestPublicInputVerifier is IPlonkVerifier { diff --git a/contracts/contracts/test-contracts/TestRateLimiter.sol b/contracts/src/_testing/unit/TestRateLimiter.sol similarity index 91% rename from contracts/contracts/test-contracts/TestRateLimiter.sol rename to contracts/src/_testing/unit/TestRateLimiter.sol index b60cde25b..b27f12e64 100644 --- a/contracts/contracts/test-contracts/TestRateLimiter.sol +++ b/contracts/src/_testing/unit/TestRateLimiter.sol @@ -2,7 +2,7 @@ pragma solidity >=0.8.19 <=0.8.26; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; -import { RateLimiter } from "../messageService/lib/RateLimiter.sol"; +import { RateLimiter } from "../../security/limiting/RateLimiter.sol"; contract TestRateLimiter is Initializable, RateLimiter { // we need eth to test the limits with diff --git a/contracts/contracts/test-contracts/TestSetPauseTypeRoles.sol b/contracts/src/_testing/unit/TestSetPauseTypeRoles.sol similarity index 83% rename from contracts/contracts/test-contracts/TestSetPauseTypeRoles.sol rename to contracts/src/_testing/unit/TestSetPauseTypeRoles.sol index cd384c022..f8f6c8f4c 100644 --- a/contracts/contracts/test-contracts/TestSetPauseTypeRoles.sol +++ b/contracts/src/_testing/unit/TestSetPauseTypeRoles.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity >=0.8.19 <=0.8.26; -import { PauseManager } from "../lib/PauseManager.sol"; +import { PauseManager } from "../../security/pausing/PauseManager.sol"; contract TestSetPauseTypeRoles is PauseManager { function initializePauseTypesAndPermissions( diff --git a/contracts/contracts/test-contracts/TestSparseMerkleTreeVerifier.sol b/contracts/src/_testing/unit/TestSparseMerkleTreeVerifier.sol similarity index 87% rename from contracts/contracts/test-contracts/TestSparseMerkleTreeVerifier.sol rename to contracts/src/_testing/unit/TestSparseMerkleTreeVerifier.sol index b595b7872..37ff6f548 100644 --- a/contracts/contracts/test-contracts/TestSparseMerkleTreeVerifier.sol +++ b/contracts/src/_testing/unit/TestSparseMerkleTreeVerifier.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { SparseMerkleTreeVerifier } from "../messageService/lib/SparseMerkleTreeVerifier.sol"; -import { Utils } from "../lib/Utils.sol"; +import { SparseMerkleTreeVerifier } from "../../messaging/libraries/SparseMerkleTreeVerifier.sol"; +import { Utils } from "../../libraries/Utils.sol"; contract TestSparseMerkleTreeVerifier { using SparseMerkleTreeVerifier for *; diff --git a/contracts/contracts/test-contracts/TestUtils.sol b/contracts/src/_testing/unit/TestUtils.sol similarity index 82% rename from contracts/contracts/test-contracts/TestUtils.sol rename to contracts/src/_testing/unit/TestUtils.sol index e21bd044f..e6b8124d4 100644 --- a/contracts/contracts/test-contracts/TestUtils.sol +++ b/contracts/src/_testing/unit/TestUtils.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { Utils } from "../lib/Utils.sol"; +import { Utils } from "../../libraries/Utils.sol"; contract TestUtils { function efficientKeccak(bytes32 _left, bytes32 _right) external pure returns (bytes32 value) { diff --git a/contracts/contracts/tokenBridge/BridgedToken.sol b/contracts/src/bridging/token/BridgedToken.sol similarity index 100% rename from contracts/contracts/tokenBridge/BridgedToken.sol rename to contracts/src/bridging/token/BridgedToken.sol diff --git a/contracts/contracts/tokenBridge/CustomBridgedToken.sol b/contracts/src/bridging/token/CustomBridgedToken.sol similarity index 100% rename from contracts/contracts/tokenBridge/CustomBridgedToken.sol rename to contracts/src/bridging/token/CustomBridgedToken.sol diff --git a/contracts/contracts/tokenBridge/TokenBridge.sol b/contracts/src/bridging/token/TokenBridge.sol similarity index 98% rename from contracts/contracts/tokenBridge/TokenBridge.sol rename to contracts/src/bridging/token/TokenBridge.sol index c2d1f49ac..9ffce5b26 100644 --- a/contracts/contracts/tokenBridge/TokenBridge.sol +++ b/contracts/src/bridging/token/TokenBridge.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import { ITokenBridge } from "./interfaces/ITokenBridge.sol"; -import { IMessageService } from "../interfaces/IMessageService.sol"; +import { IMessageService } from "../../messaging/interfaces/IMessageService.sol"; import { IERC20PermitUpgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol"; import { IERC20MetadataUpgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; @@ -14,14 +14,14 @@ import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/ import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import { BridgedToken } from "./BridgedToken.sol"; -import { MessageServiceBase } from "../messageService/MessageServiceBase.sol"; +import { MessageServiceBase } from "../../messaging/MessageServiceBase.sol"; -import { TokenBridgePauseManager } from "../lib/TokenBridgePauseManager.sol"; +import { TokenBridgePauseManager } from "../../security/pausing/TokenBridgePauseManager.sol"; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; -import { StorageFiller39 } from "./lib/StorageFiller39.sol"; -import { PermissionsManager } from "../lib/PermissionsManager.sol"; +import { StorageFiller39 } from "./utils/StorageFiller39.sol"; +import { PermissionsManager } from "../../security/access/PermissionsManager.sol"; -import { Utils } from "../lib/Utils.sol"; +import { Utils } from "../../libraries/Utils.sol"; /** * @title Linea Canonical Token Bridge * @notice Contract to manage cross-chain ERC20 bridging. diff --git a/contracts/contracts/tokenBridge/interfaces/ITokenBridge.sol b/contracts/src/bridging/token/interfaces/ITokenBridge.sol similarity index 98% rename from contracts/contracts/tokenBridge/interfaces/ITokenBridge.sol rename to contracts/src/bridging/token/interfaces/ITokenBridge.sol index 330d6ba4f..41fb93f50 100644 --- a/contracts/contracts/tokenBridge/interfaces/ITokenBridge.sol +++ b/contracts/src/bridging/token/interfaces/ITokenBridge.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.19; -import { IPauseManager } from "../../interfaces/IPauseManager.sol"; -import { IPermissionsManager } from "../../interfaces/IPermissionsManager.sol"; +import { IPauseManager } from "../../../security/pausing/interfaces/IPauseManager.sol"; +import { IPermissionsManager } from "../../../security/access/interfaces/IPermissionsManager.sol"; /** * @title Interface declaring Canonical Token Bridge struct, functions, events and errors. diff --git a/contracts/contracts/tokenBridge/lib/StorageFiller39.sol b/contracts/src/bridging/token/utils/StorageFiller39.sol similarity index 100% rename from contracts/contracts/tokenBridge/lib/StorageFiller39.sol rename to contracts/src/bridging/token/utils/StorageFiller39.sol diff --git a/contracts/contracts/messageService/lib/TimeLock.sol b/contracts/src/governance/TimeLock.sol similarity index 100% rename from contracts/contracts/messageService/lib/TimeLock.sol rename to contracts/src/governance/TimeLock.sol diff --git a/contracts/contracts/interfaces/IGenericErrors.sol b/contracts/src/interfaces/IGenericErrors.sol similarity index 100% rename from contracts/contracts/interfaces/IGenericErrors.sol rename to contracts/src/interfaces/IGenericErrors.sol diff --git a/contracts/contracts/lib/Mimc.sol b/contracts/src/libraries/Mimc.sol similarity index 100% rename from contracts/contracts/lib/Mimc.sol rename to contracts/src/libraries/Mimc.sol diff --git a/contracts/contracts/lib/SparseMerkleProof.sol b/contracts/src/libraries/SparseMerkleProof.sol similarity index 100% rename from contracts/contracts/lib/SparseMerkleProof.sol rename to contracts/src/libraries/SparseMerkleProof.sol diff --git a/contracts/contracts/messageService/lib/TransientStorageHelpers.sol b/contracts/src/libraries/TransientStorageHelpers.sol similarity index 100% rename from contracts/contracts/messageService/lib/TransientStorageHelpers.sol rename to contracts/src/libraries/TransientStorageHelpers.sol diff --git a/contracts/contracts/lib/Utils.sol b/contracts/src/libraries/Utils.sol similarity index 100% rename from contracts/contracts/lib/Utils.sol rename to contracts/src/libraries/Utils.sol diff --git a/contracts/contracts/messageService/MessageServiceBase.sol b/contracts/src/messaging/MessageServiceBase.sol similarity index 97% rename from contracts/contracts/messageService/MessageServiceBase.sol rename to contracts/src/messaging/MessageServiceBase.sol index 77c2957aa..7434e6d16 100644 --- a/contracts/contracts/messageService/MessageServiceBase.sol +++ b/contracts/src/messaging/MessageServiceBase.sol @@ -2,7 +2,7 @@ pragma solidity >=0.8.19 <=0.8.26; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; -import { IMessageService } from "../interfaces/IMessageService.sol"; +import { IMessageService } from "./interfaces/IMessageService.sol"; import { IGenericErrors } from "../interfaces/IGenericErrors.sol"; /** diff --git a/contracts/contracts/interfaces/IMessageService.sol b/contracts/src/messaging/interfaces/IMessageService.sol similarity index 100% rename from contracts/contracts/interfaces/IMessageService.sol rename to contracts/src/messaging/interfaces/IMessageService.sol diff --git a/contracts/contracts/messageService/l1/L1MessageManager.sol b/contracts/src/messaging/l1/L1MessageManager.sol similarity index 97% rename from contracts/contracts/messageService/l1/L1MessageManager.sol rename to contracts/src/messaging/l1/L1MessageManager.sol index 1afe831ae..58e549226 100644 --- a/contracts/contracts/messageService/l1/L1MessageManager.sol +++ b/contracts/src/messaging/l1/L1MessageManager.sol @@ -3,8 +3,8 @@ pragma solidity 0.8.26; import { BitMaps } from "@openzeppelin/contracts/utils/structs/BitMaps.sol"; import { L1MessageManagerV1 } from "./v1/L1MessageManagerV1.sol"; -import { IL1MessageManager } from "../../interfaces/l1/IL1MessageManager.sol"; -import { Utils } from "../../lib/Utils.sol"; +import { IL1MessageManager } from "./interfaces/IL1MessageManager.sol"; +import { Utils } from "../../libraries/Utils.sol"; /** * @title Contract to manage cross-chain message rolling hash computation and storage on L1. diff --git a/contracts/contracts/messageService/l1/L1MessageService.sol b/contracts/src/messaging/l1/L1MessageService.sol similarity index 94% rename from contracts/contracts/messageService/l1/L1MessageService.sol rename to contracts/src/messaging/l1/L1MessageService.sol index a8e18f897..5a02ecb0c 100644 --- a/contracts/contracts/messageService/l1/L1MessageService.sol +++ b/contracts/src/messaging/l1/L1MessageService.sol @@ -4,11 +4,11 @@ pragma solidity 0.8.26; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import { L1MessageServiceV1 } from "./v1/L1MessageServiceV1.sol"; import { L1MessageManager } from "./L1MessageManager.sol"; -import { IL1MessageService } from "../../interfaces/l1/IL1MessageService.sol"; +import { IL1MessageService } from "./interfaces/IL1MessageService.sol"; import { IGenericErrors } from "../../interfaces/IGenericErrors.sol"; -import { SparseMerkleTreeVerifier } from "../lib/SparseMerkleTreeVerifier.sol"; -import { TransientStorageHelpers } from "../lib/TransientStorageHelpers.sol"; -import { MessageHashing } from "../lib/MessageHashing.sol"; +import { SparseMerkleTreeVerifier } from "../libraries/SparseMerkleTreeVerifier.sol"; +import { TransientStorageHelpers } from "../../libraries/TransientStorageHelpers.sol"; +import { MessageHashing } from "../libraries/MessageHashing.sol"; /** * @title Contract to manage cross-chain messaging on L1. diff --git a/contracts/contracts/interfaces/l1/IL1MessageManager.sol b/contracts/src/messaging/l1/interfaces/IL1MessageManager.sol similarity index 100% rename from contracts/contracts/interfaces/l1/IL1MessageManager.sol rename to contracts/src/messaging/l1/interfaces/IL1MessageManager.sol diff --git a/contracts/contracts/interfaces/l1/IL1MessageService.sol b/contracts/src/messaging/l1/interfaces/IL1MessageService.sol similarity index 100% rename from contracts/contracts/interfaces/l1/IL1MessageService.sol rename to contracts/src/messaging/l1/interfaces/IL1MessageService.sol diff --git a/contracts/contracts/messageService/l1/v1/L1MessageManagerV1.sol b/contracts/src/messaging/l1/v1/L1MessageManagerV1.sol similarity index 96% rename from contracts/contracts/messageService/l1/v1/L1MessageManagerV1.sol rename to contracts/src/messaging/l1/v1/L1MessageManagerV1.sol index ca808b53e..1c98962f9 100644 --- a/contracts/contracts/messageService/l1/v1/L1MessageManagerV1.sol +++ b/contracts/src/messaging/l1/v1/L1MessageManagerV1.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { IL1MessageManagerV1 } from "../../../interfaces/l1/IL1MessageManagerV1.sol"; +import { IL1MessageManagerV1 } from "./interfaces/IL1MessageManagerV1.sol"; /** * @title Contract to manage cross-chain message hashes storage and status on L1. diff --git a/contracts/contracts/messageService/l1/v1/L1MessageServiceV1.sol b/contracts/src/messaging/l1/v1/L1MessageServiceV1.sol similarity index 90% rename from contracts/contracts/messageService/l1/v1/L1MessageServiceV1.sol rename to contracts/src/messaging/l1/v1/L1MessageServiceV1.sol index 06cce7834..b15ca491b 100644 --- a/contracts/contracts/messageService/l1/v1/L1MessageServiceV1.sol +++ b/contracts/src/messaging/l1/v1/L1MessageServiceV1.sol @@ -2,13 +2,13 @@ pragma solidity 0.8.26; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; -import { LineaRollupPauseManager } from "../../../lib/LineaRollupPauseManager.sol"; -import { RateLimiter } from "../../lib/RateLimiter.sol"; +import { LineaRollupPauseManager } from "../../../security/pausing/LineaRollupPauseManager.sol"; +import { RateLimiter } from "../../../security/limiting/RateLimiter.sol"; import { L1MessageManagerV1 } from "./L1MessageManagerV1.sol"; -import { TransientStorageReentrancyGuardUpgradeable } from "../TransientStorageReentrancyGuardUpgradeable.sol"; -import { IMessageService } from "../../../interfaces/IMessageService.sol"; -import { TransientStorageHelpers } from "../../lib/TransientStorageHelpers.sol"; -import { MessageHashing } from "../../lib/MessageHashing.sol"; +import { TransientStorageReentrancyGuardUpgradeable } from "../../../security/reentrancy/TransientStorageReentrancyGuardUpgradeable.sol"; +import { IMessageService } from "../../interfaces/IMessageService.sol"; +import { TransientStorageHelpers } from "../../../libraries/TransientStorageHelpers.sol"; +import { MessageHashing } from "../../libraries/MessageHashing.sol"; /** * @title Contract to manage cross-chain messaging on L1. diff --git a/contracts/contracts/interfaces/l1/IL1MessageManagerV1.sol b/contracts/src/messaging/l1/v1/interfaces/IL1MessageManagerV1.sol similarity index 100% rename from contracts/contracts/interfaces/l1/IL1MessageManagerV1.sol rename to contracts/src/messaging/l1/v1/interfaces/IL1MessageManagerV1.sol diff --git a/contracts/contracts/messageService/l2/L2MessageManager.sol b/contracts/src/messaging/l2/L2MessageManager.sol similarity index 96% rename from contracts/contracts/messageService/l2/L2MessageManager.sol rename to contracts/src/messaging/l2/L2MessageManager.sol index 8869daa68..a679cf00e 100644 --- a/contracts/contracts/messageService/l2/L2MessageManager.sol +++ b/contracts/src/messaging/l2/L2MessageManager.sol @@ -3,8 +3,8 @@ pragma solidity 0.8.19; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import { L2MessageManagerV1 } from "./v1/L2MessageManagerV1.sol"; -import { IL2MessageManager } from "../../interfaces/l2/IL2MessageManager.sol"; -import { Utils } from "../../lib/Utils.sol"; +import { IL2MessageManager } from "./interfaces/IL2MessageManager.sol"; +import { Utils } from "../../libraries/Utils.sol"; /** * @title Contract to manage cross-chain message hashes storage and statuses on L2. diff --git a/contracts/contracts/messageService/l2/L2MessageService.sol b/contracts/src/messaging/l2/L2MessageService.sol similarity index 97% rename from contracts/contracts/messageService/l2/L2MessageService.sol rename to contracts/src/messaging/l2/L2MessageService.sol index c6568e78c..8a2c99bcd 100644 --- a/contracts/contracts/messageService/l2/L2MessageService.sol +++ b/contracts/src/messaging/l2/L2MessageService.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.19; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import { L2MessageServiceV1 } from "./v1/L2MessageServiceV1.sol"; import { L2MessageManager } from "./L2MessageManager.sol"; -import { PermissionsManager } from "../../lib/PermissionsManager.sol"; +import { PermissionsManager } from "../../security/access/PermissionsManager.sol"; /** * @title Contract to manage cross-chain messaging on L2. diff --git a/contracts/contracts/interfaces/l2/IL2MessageManager.sol b/contracts/src/messaging/l2/interfaces/IL2MessageManager.sol similarity index 100% rename from contracts/contracts/interfaces/l2/IL2MessageManager.sol rename to contracts/src/messaging/l2/interfaces/IL2MessageManager.sol diff --git a/contracts/contracts/messageService/l2/v1/L2MessageManagerV1.sol b/contracts/src/messaging/l2/v1/L2MessageManagerV1.sol similarity index 90% rename from contracts/contracts/messageService/l2/v1/L2MessageManagerV1.sol rename to contracts/src/messaging/l2/v1/L2MessageManagerV1.sol index ffd6150c8..93245f4ff 100644 --- a/contracts/contracts/messageService/l2/v1/L2MessageManagerV1.sol +++ b/contracts/src/messaging/l2/v1/L2MessageManagerV1.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; -import { IL2MessageManagerV1 } from "../../../interfaces/l2/IL2MessageManagerV1.sol"; -import { L2MessageServicePauseManager } from "../../../lib/L2MessageServicePauseManager.sol"; +import { IL2MessageManagerV1 } from "./interfaces/IL2MessageManagerV1.sol"; +import { L2MessageServicePauseManager } from "../../../security/pausing/L2MessageServicePauseManager.sol"; /** * @title Contract to manage cross-chain message hashes storage and statuses on L2. diff --git a/contracts/contracts/messageService/l2/v1/L2MessageServiceV1.sol b/contracts/src/messaging/l2/v1/L2MessageServiceV1.sol similarity index 96% rename from contracts/contracts/messageService/l2/v1/L2MessageServiceV1.sol rename to contracts/src/messaging/l2/v1/L2MessageServiceV1.sol index 975cce51f..18221c2cf 100644 --- a/contracts/contracts/messageService/l2/v1/L2MessageServiceV1.sol +++ b/contracts/src/messaging/l2/v1/L2MessageServiceV1.sol @@ -3,12 +3,12 @@ pragma solidity 0.8.19; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; -import { IMessageService } from "../../../interfaces/IMessageService.sol"; -import { IL2MessageServiceV1 } from "../../../interfaces/l2/IL2MessageServiceV1.sol"; +import { IMessageService } from "../../interfaces/IMessageService.sol"; +import { IL2MessageServiceV1 } from "./interfaces/IL2MessageServiceV1.sol"; import { IGenericErrors } from "../../../interfaces/IGenericErrors.sol"; -import { RateLimiter } from "../../lib/RateLimiter.sol"; +import { RateLimiter } from "../../../security/limiting/RateLimiter.sol"; import { L2MessageManagerV1 } from "./L2MessageManagerV1.sol"; -import { MessageHashing } from "../../lib/MessageHashing.sol"; +import { MessageHashing } from "../../libraries/MessageHashing.sol"; /** * @title Contract to manage cross-chain messaging on L2. diff --git a/contracts/contracts/interfaces/l2/IL2MessageManagerV1.sol b/contracts/src/messaging/l2/v1/interfaces/IL2MessageManagerV1.sol similarity index 100% rename from contracts/contracts/interfaces/l2/IL2MessageManagerV1.sol rename to contracts/src/messaging/l2/v1/interfaces/IL2MessageManagerV1.sol diff --git a/contracts/contracts/interfaces/l2/IL2MessageServiceV1.sol b/contracts/src/messaging/l2/v1/interfaces/IL2MessageServiceV1.sol similarity index 100% rename from contracts/contracts/interfaces/l2/IL2MessageServiceV1.sol rename to contracts/src/messaging/l2/v1/interfaces/IL2MessageServiceV1.sol diff --git a/contracts/contracts/messageService/lib/MessageHashing.sol b/contracts/src/messaging/libraries/MessageHashing.sol similarity index 100% rename from contracts/contracts/messageService/lib/MessageHashing.sol rename to contracts/src/messaging/libraries/MessageHashing.sol diff --git a/contracts/contracts/messageService/lib/SparseMerkleTreeVerifier.sol b/contracts/src/messaging/libraries/SparseMerkleTreeVerifier.sol similarity index 97% rename from contracts/contracts/messageService/lib/SparseMerkleTreeVerifier.sol rename to contracts/src/messaging/libraries/SparseMerkleTreeVerifier.sol index 0f07ad829..6b188b9d8 100644 --- a/contracts/contracts/messageService/lib/SparseMerkleTreeVerifier.sol +++ b/contracts/src/messaging/libraries/SparseMerkleTreeVerifier.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { Utils } from "../../lib/Utils.sol"; +import { Utils } from "../../libraries/Utils.sol"; /** * @title Library to verify sparse merkle proofs and to get the leaf hash value diff --git a/contracts/contracts/lib/CallForwardingProxy.sol b/contracts/src/proxies/CallForwardingProxy.sol similarity index 100% rename from contracts/contracts/lib/CallForwardingProxy.sol rename to contracts/src/proxies/CallForwardingProxy.sol diff --git a/contracts/contracts/tools/RecoverFunds.sol b/contracts/src/recovery/RecoverFunds.sol similarity index 96% rename from contracts/contracts/tools/RecoverFunds.sol rename to contracts/src/recovery/RecoverFunds.sol index 36210aa18..c6e2f172d 100644 --- a/contracts/contracts/tools/RecoverFunds.sol +++ b/contracts/src/recovery/RecoverFunds.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.26; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import { IGenericErrors } from "../interfaces/IGenericErrors.sol"; -import { IRecoverFunds } from "../interfaces/tools/IRecoverFunds.sol"; +import { IRecoverFunds } from "./interfaces/IRecoverFunds.sol"; /** * @title Contract to recover funds sent to the message service address on the alternate chain. diff --git a/contracts/contracts/interfaces/tools/IRecoverFunds.sol b/contracts/src/recovery/interfaces/IRecoverFunds.sol similarity index 100% rename from contracts/contracts/interfaces/tools/IRecoverFunds.sol rename to contracts/src/recovery/interfaces/IRecoverFunds.sol diff --git a/contracts/contracts/LineaRollup.sol b/contracts/src/rollup/LineaRollup.sol similarity index 99% rename from contracts/contracts/LineaRollup.sol rename to contracts/src/rollup/LineaRollup.sol index bdc28b863..1460ca916 100644 --- a/contracts/contracts/LineaRollup.sol +++ b/contracts/src/rollup/LineaRollup.sol @@ -3,12 +3,12 @@ pragma solidity 0.8.26; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; -import { L1MessageService } from "./messageService/l1/L1MessageService.sol"; +import { L1MessageService } from "../messaging/l1/L1MessageService.sol"; import { ZkEvmV2 } from "./ZkEvmV2.sol"; -import { ILineaRollup } from "./interfaces/l1/ILineaRollup.sol"; -import { PermissionsManager } from "./lib/PermissionsManager.sol"; +import { ILineaRollup } from "./interfaces/ILineaRollup.sol"; +import { PermissionsManager } from "../security/access/PermissionsManager.sol"; -import { Utils } from "./lib/Utils.sol"; +import { Utils } from "../libraries/Utils.sol"; /** * @title Contract to manage cross-chain messaging on L1, L2 data submission, and rollup proof verification. * @author ConsenSys Software Inc. diff --git a/contracts/contracts/ZkEvmV2.sol b/contracts/src/rollup/ZkEvmV2.sol similarity index 93% rename from contracts/contracts/ZkEvmV2.sol rename to contracts/src/rollup/ZkEvmV2.sol index 2fb702236..7e7c9c33e 100644 --- a/contracts/contracts/ZkEvmV2.sol +++ b/contracts/src/rollup/ZkEvmV2.sol @@ -3,9 +3,9 @@ pragma solidity 0.8.26; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; -import { L1MessageServiceV1 } from "./messageService/l1/v1/L1MessageServiceV1.sol"; -import { IZkEvmV2 } from "./interfaces/l1/IZkEvmV2.sol"; -import { IPlonkVerifier } from "./interfaces/l1/IPlonkVerifier.sol"; +import { L1MessageServiceV1 } from "../messaging/l1/v1/L1MessageServiceV1.sol"; +import { IZkEvmV2 } from "./interfaces/IZkEvmV2.sol"; +import { IPlonkVerifier } from "../verifiers/interfaces/IPlonkVerifier.sol"; /** * @title Contract to manage cross-chain L1 rollup proving. * @author ConsenSys Software Inc. diff --git a/contracts/contracts/interfaces/l1/ILineaRollup.sol b/contracts/src/rollup/interfaces/ILineaRollup.sol similarity index 98% rename from contracts/contracts/interfaces/l1/ILineaRollup.sol rename to contracts/src/rollup/interfaces/ILineaRollup.sol index d7d31c4b4..75178600c 100644 --- a/contracts/contracts/interfaces/l1/ILineaRollup.sol +++ b/contracts/src/rollup/interfaces/ILineaRollup.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.26; -import { IPauseManager } from "../../interfaces/IPauseManager.sol"; -import { IPermissionsManager } from "../../interfaces/IPermissionsManager.sol"; +import { IPauseManager } from "../../security/pausing/interfaces/IPauseManager.sol"; +import { IPermissionsManager } from "../../security/access/interfaces/IPermissionsManager.sol"; /** * @title LineaRollup interface for current functions, structs, events and errors. diff --git a/contracts/contracts/interfaces/l1/IZkEvmV2.sol b/contracts/src/rollup/interfaces/IZkEvmV2.sol similarity index 100% rename from contracts/contracts/interfaces/l1/IZkEvmV2.sol rename to contracts/src/rollup/interfaces/IZkEvmV2.sol diff --git a/contracts/contracts/lib/PermissionsManager.sol b/contracts/src/security/access/PermissionsManager.sol similarity index 88% rename from contracts/contracts/lib/PermissionsManager.sol rename to contracts/src/security/access/PermissionsManager.sol index 477628c29..b98dd686f 100644 --- a/contracts/contracts/lib/PermissionsManager.sol +++ b/contracts/src/security/access/PermissionsManager.sol @@ -3,8 +3,8 @@ pragma solidity >=0.8.19 <=0.8.26; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; -import { IGenericErrors } from "../interfaces/IGenericErrors.sol"; -import { IPermissionsManager } from "../interfaces/IPermissionsManager.sol"; +import { IGenericErrors } from "../../interfaces/IGenericErrors.sol"; +import { IPermissionsManager } from "./interfaces/IPermissionsManager.sol"; /** * @title Contract to manage permissions initialization. diff --git a/contracts/contracts/interfaces/IPermissionsManager.sol b/contracts/src/security/access/interfaces/IPermissionsManager.sol similarity index 100% rename from contracts/contracts/interfaces/IPermissionsManager.sol rename to contracts/src/security/access/interfaces/IPermissionsManager.sol diff --git a/contracts/contracts/messageService/lib/RateLimiter.sol b/contracts/src/security/limiting/RateLimiter.sol similarity index 98% rename from contracts/contracts/messageService/lib/RateLimiter.sol rename to contracts/src/security/limiting/RateLimiter.sol index b2b3637fc..79ed7c942 100644 --- a/contracts/contracts/messageService/lib/RateLimiter.sol +++ b/contracts/src/security/limiting/RateLimiter.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.19 <=0.8.26; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; -import { IRateLimiter } from "../../interfaces/IRateLimiter.sol"; +import { IRateLimiter } from "./interfaces/IRateLimiter.sol"; /** * @title Rate Limiter by period and amount using the block timestamp. diff --git a/contracts/contracts/interfaces/IRateLimiter.sol b/contracts/src/security/limiting/interfaces/IRateLimiter.sol similarity index 100% rename from contracts/contracts/interfaces/IRateLimiter.sol rename to contracts/src/security/limiting/interfaces/IRateLimiter.sol diff --git a/contracts/contracts/lib/L2MessageServicePauseManager.sol b/contracts/src/security/pausing/L2MessageServicePauseManager.sol similarity index 100% rename from contracts/contracts/lib/L2MessageServicePauseManager.sol rename to contracts/src/security/pausing/L2MessageServicePauseManager.sol diff --git a/contracts/contracts/lib/LineaRollupPauseManager.sol b/contracts/src/security/pausing/LineaRollupPauseManager.sol similarity index 100% rename from contracts/contracts/lib/LineaRollupPauseManager.sol rename to contracts/src/security/pausing/LineaRollupPauseManager.sol diff --git a/contracts/contracts/lib/PauseManager.sol b/contracts/src/security/pausing/PauseManager.sol similarity index 98% rename from contracts/contracts/lib/PauseManager.sol rename to contracts/src/security/pausing/PauseManager.sol index 55be8f03b..ac724d9ed 100644 --- a/contracts/contracts/lib/PauseManager.sol +++ b/contracts/src/security/pausing/PauseManager.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.19 <=0.8.26; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; -import { IPauseManager } from "../interfaces/IPauseManager.sol"; +import { IPauseManager } from "./interfaces/IPauseManager.sol"; /** * @title Contract to manage cross-chain function pausing. diff --git a/contracts/contracts/lib/TokenBridgePauseManager.sol b/contracts/src/security/pausing/TokenBridgePauseManager.sol similarity index 100% rename from contracts/contracts/lib/TokenBridgePauseManager.sol rename to contracts/src/security/pausing/TokenBridgePauseManager.sol diff --git a/contracts/contracts/interfaces/IPauseManager.sol b/contracts/src/security/pausing/interfaces/IPauseManager.sol similarity index 100% rename from contracts/contracts/interfaces/IPauseManager.sol rename to contracts/src/security/pausing/interfaces/IPauseManager.sol diff --git a/contracts/contracts/messageService/l1/TransientStorageReentrancyGuardUpgradeable.sol b/contracts/src/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.sol similarity index 94% rename from contracts/contracts/messageService/l1/TransientStorageReentrancyGuardUpgradeable.sol rename to contracts/src/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.sol index d635384a0..b60f0274e 100644 --- a/contracts/contracts/messageService/l1/TransientStorageReentrancyGuardUpgradeable.sol +++ b/contracts/src/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { TransientStorageHelpers } from "../lib/TransientStorageHelpers.sol"; +import { TransientStorageHelpers } from "../../libraries/TransientStorageHelpers.sol"; /** * @title Contract that helps prevent reentrant calls. diff --git a/contracts/contracts/token/LineaSurgeXP.sol b/contracts/src/tokens/LineaSurgeXP.sol similarity index 100% rename from contracts/contracts/token/LineaSurgeXP.sol rename to contracts/src/tokens/LineaSurgeXP.sol diff --git a/contracts/contracts/token/LineaVoyageXP.sol b/contracts/src/tokens/LineaVoyageXP.sol similarity index 100% rename from contracts/contracts/token/LineaVoyageXP.sol rename to contracts/src/tokens/LineaVoyageXP.sol diff --git a/contracts/contracts/token/TokenMintingRateLimiter.sol b/contracts/src/tokens/TokenMintingRateLimiter.sol similarity index 97% rename from contracts/contracts/token/TokenMintingRateLimiter.sol rename to contracts/src/tokens/TokenMintingRateLimiter.sol index 60356b138..b877ffd75 100644 --- a/contracts/contracts/token/TokenMintingRateLimiter.sol +++ b/contracts/src/tokens/TokenMintingRateLimiter.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol"; -import { ITokenMinter } from "./ITokenMinter.sol"; -import { ITokenMintingRateLimiter } from "./ITokenMintingRateLimiter.sol"; +import { ITokenMinter } from "./interfaces/ITokenMinter.sol"; +import { ITokenMintingRateLimiter } from "./interfaces/ITokenMintingRateLimiter.sol"; /** * @title Token minting rate limiter. diff --git a/contracts/contracts/token/ITokenMinter.sol b/contracts/src/tokens/interfaces/ITokenMinter.sol similarity index 100% rename from contracts/contracts/token/ITokenMinter.sol rename to contracts/src/tokens/interfaces/ITokenMinter.sol diff --git a/contracts/contracts/token/ITokenMintingRateLimiter.sol b/contracts/src/tokens/interfaces/ITokenMintingRateLimiter.sol similarity index 100% rename from contracts/contracts/token/ITokenMintingRateLimiter.sol rename to contracts/src/tokens/interfaces/ITokenMintingRateLimiter.sol diff --git a/contracts/contracts/verifiers/PlonkVerifierDev.sol b/contracts/src/verifiers/PlonkVerifierDev.sol similarity index 100% rename from contracts/contracts/verifiers/PlonkVerifierDev.sol rename to contracts/src/verifiers/PlonkVerifierDev.sol diff --git a/contracts/contracts/verifiers/PlonkVerifierForDataAggregation.sol b/contracts/src/verifiers/PlonkVerifierForDataAggregation.sol similarity index 100% rename from contracts/contracts/verifiers/PlonkVerifierForDataAggregation.sol rename to contracts/src/verifiers/PlonkVerifierForDataAggregation.sol diff --git a/contracts/contracts/verifiers/PlonkVerifierForMultiTypeDataAggregation.sol b/contracts/src/verifiers/PlonkVerifierForMultiTypeDataAggregation.sol similarity index 100% rename from contracts/contracts/verifiers/PlonkVerifierForMultiTypeDataAggregation.sol rename to contracts/src/verifiers/PlonkVerifierForMultiTypeDataAggregation.sol diff --git a/contracts/contracts/verifiers/Utils.sol b/contracts/src/verifiers/Utils.sol similarity index 100% rename from contracts/contracts/verifiers/Utils.sol rename to contracts/src/verifiers/Utils.sol diff --git a/contracts/contracts/interfaces/l1/IPlonkVerifier.sol b/contracts/src/verifiers/interfaces/IPlonkVerifier.sol similarity index 100% rename from contracts/contracts/interfaces/l1/IPlonkVerifier.sol rename to contracts/src/verifiers/interfaces/IPlonkVerifier.sol diff --git a/contracts/test/LineaRollup.ts b/contracts/test/LineaRollup.ts index 5b8c9c59d..50070df3f 100644 --- a/contracts/test/LineaRollup.ts +++ b/contracts/test/LineaRollup.ts @@ -198,7 +198,7 @@ describe("Linea Rollup contract", () => { defaultAdmin: securityCouncil.address, }; - const deployCall = deployUpgradableFromFactory("contracts/LineaRollup.sol:LineaRollup", [initializationData], { + const deployCall = deployUpgradableFromFactory("src/rollup/LineaRollup.sol:LineaRollup", [initializationData], { initializer: LINEA_ROLLUP_INITIALIZE_SIGNATURE, unsafeAllow: ["constructor"], }); @@ -265,7 +265,7 @@ describe("Linea Rollup contract", () => { }; const lineaRollup = await deployUpgradableFromFactory( - "contracts/LineaRollup.sol:LineaRollup", + "src/rollup/LineaRollup.sol:LineaRollup", [initializationData], { initializer: LINEA_ROLLUP_INITIALIZE_SIGNATURE, @@ -292,7 +292,7 @@ describe("Linea Rollup contract", () => { }; const lineaRollup = await deployUpgradableFromFactory( - "contracts/LineaRollup.sol:LineaRollup", + "src/rollup/LineaRollup.sol:LineaRollup", [initializationData], { initializer: LINEA_ROLLUP_INITIALIZE_SIGNATURE, @@ -2377,7 +2377,7 @@ describe("Linea Rollup contract", () => { verifier = await plonkVerifier.getAddress(); const lineaRollup = (await deployUpgradableFromFactory( - "contracts/test-contracts/TestLineaRollupV5.sol:TestLineaRollupV5", + "src/_testing/unit/TestLineaRollupV5.sol:TestLineaRollupV5", [ parentStateRootHash, 0, @@ -2435,7 +2435,7 @@ describe("Linea Rollup contract", () => { // Deploy new implementation const newLineaRollupFactory = await ethers.getContractFactory( - "contracts/test-contracts/TestLineaRollup.sol:TestLineaRollup", + "src/_testing/unit/TestLineaRollup.sol:TestLineaRollup", ); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, @@ -2463,7 +2463,7 @@ describe("Linea Rollup contract", () => { // Deploy new LineaRollup implementation const newLineaRollupFactory = await ethers.getContractFactory( - "contracts/test-contracts/TestLineaRollup.sol:TestLineaRollup", + "src/_testing/unit/TestLineaRollup.sol:TestLineaRollup", ); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, @@ -2510,7 +2510,7 @@ describe("Linea Rollup contract", () => { expect(await lineaRollupV5.currentL2BlockNumber()).to.equal(0); // Deploy new implementation - const newLineaRollupFactory = await ethers.getContractFactory("contracts/LineaRollup.sol:LineaRollup"); + const newLineaRollupFactory = await ethers.getContractFactory("src/rollup/LineaRollup.sol:LineaRollup"); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, }); @@ -2536,7 +2536,7 @@ describe("Linea Rollup contract", () => { expect(await lineaRollupV5.currentL2BlockNumber()).to.equal(0); // Deploy new implementation - const newLineaRollupFactory = await ethers.getContractFactory("contracts/LineaRollup.sol:LineaRollup"); + const newLineaRollupFactory = await ethers.getContractFactory("src/rollup/LineaRollup.sol:LineaRollup"); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, }); @@ -2558,7 +2558,7 @@ describe("Linea Rollup contract", () => { expect(await lineaRollupV5.currentL2BlockNumber()).to.equal(0); // Deploy new implementation - const newLineaRollupFactory = await ethers.getContractFactory("contracts/LineaRollup.sol:LineaRollup"); + const newLineaRollupFactory = await ethers.getContractFactory("src/rollup/LineaRollup.sol:LineaRollup"); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, }); @@ -2582,7 +2582,7 @@ describe("Linea Rollup contract", () => { it("Should revert with ZeroAddressNotAllowed when addressWithRole is zero address in reinitializeLineaRollupV6", async () => { // Deploy new implementation - const newLineaRollupFactory = await ethers.getContractFactory("contracts/LineaRollup.sol:LineaRollup"); + const newLineaRollupFactory = await ethers.getContractFactory("src/rollup/LineaRollup.sol:LineaRollup"); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, }); @@ -2603,7 +2603,7 @@ describe("Linea Rollup contract", () => { it("Should set all permissions", async () => { // Deploy new implementation - const newLineaRollupFactory = await ethers.getContractFactory("contracts/LineaRollup.sol:LineaRollup"); + const newLineaRollupFactory = await ethers.getContractFactory("src/rollup/LineaRollup.sol:LineaRollup"); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, }); @@ -2623,7 +2623,7 @@ describe("Linea Rollup contract", () => { it("Should set all pause types and unpause types in mappings and emit events", async () => { // Deploy new implementation - const newLineaRollupFactory = await ethers.getContractFactory("contracts/LineaRollup.sol:LineaRollup"); + const newLineaRollupFactory = await ethers.getContractFactory("src/rollup/LineaRollup.sol:LineaRollup"); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, }); diff --git a/contracts/test/messageService/l2/L2MessageService.ts b/contracts/test/messageService/l2/L2MessageService.ts index 18aeaba0a..e59d51415 100644 --- a/contracts/test/messageService/l2/L2MessageService.ts +++ b/contracts/test/messageService/l2/L2MessageService.ts @@ -1431,7 +1431,7 @@ describe("L2MessageService", () => { async function deployL2MessageServiceFixture() { return deployUpgradableFromFactory( - "contracts/test-contracts/L2MessageServiceLineaMainnet.sol:L2MessageServiceLineaMainnet", + "src/_testing/integration/L2MessageServiceLineaMainnet.sol:L2MessageServiceLineaMainnet", [securityCouncil.address, l1l2MessageSetter.address, ONE_DAY_IN_SECONDS, INITIAL_WITHDRAW_LIMIT], ) as unknown as Promise; } @@ -1460,7 +1460,7 @@ describe("L2MessageService", () => { // Deploy new implementation const newL2MessageServiceFactory = await ethers.getContractFactory( - "contracts/messageService/l2/L2MessageService.sol:L2MessageService", + "src/messaging/l2/L2MessageService.sol:L2MessageService", ); const newL2MessageService = await upgrades.upgradeProxy(l2MessageService, newL2MessageServiceFactory); @@ -1476,7 +1476,7 @@ describe("L2MessageService", () => { it("Should revert with ZeroAddressNotAllowed when addressWithRole is zero address in reinitializePauseTypesAndPermissions", async () => { // Deploy new implementation const newL2MessageServiceFactory = await ethers.getContractFactory( - "contracts/messageService/l2/L2MessageService.sol:L2MessageService", + "src/messaging/l2/L2MessageService.sol:L2MessageService", ); const newL2MessageService = await upgrades.upgradeProxy(l2MessageService, newL2MessageServiceFactory); @@ -1496,7 +1496,7 @@ describe("L2MessageService", () => { it("Should set all permissions", async () => { // Deploy new implementation const newL2MessageServiceFactory = await ethers.getContractFactory( - "contracts/messageService/l2/L2MessageService.sol:L2MessageService", + "src/messaging/l2/L2MessageService.sol:L2MessageService", ); const newL2MessageService = await upgrades.upgradeProxy(l2MessageService, newL2MessageServiceFactory); @@ -1514,7 +1514,7 @@ describe("L2MessageService", () => { it("Should set all pause types and unpause types in mappings and emit events", async () => { // Deploy new implementation const newL2MessageServiceFactory = await ethers.getContractFactory( - "contracts/messageService/l2/L2MessageService.sol:L2MessageService", + "src/messaging/l2/L2MessageService.sol:L2MessageService", ); const newL2MessageService = await upgrades.upgradeProxy(l2MessageService, newL2MessageServiceFactory); diff --git a/contracts/test/tokenBridge/TokenBridge.ts b/contracts/test/tokenBridge/TokenBridge.ts index 23c5061ed..d979b777d 100644 --- a/contracts/test/tokenBridge/TokenBridge.ts +++ b/contracts/test/tokenBridge/TokenBridge.ts @@ -958,7 +958,7 @@ describe("TokenBridge", function () { const { owner, messageService, chainIds } = await loadFixture(deployContractsFixture); const TokenBridgeV1 = await ethers.getContractFactory( - "contracts/tokenBridge/mocks/TokenBridgeFlatten.sol:TokenBridgeFlatten", + "src/_testing/integration/TokenBridgeFlatten.sol:TokenBridgeFlatten", ); const tokenBridgeV1 = (await upgrades.deployProxy(TokenBridgeV1, [ owner.address, @@ -1053,7 +1053,7 @@ describe("TokenBridge", function () { const { owner, messageService, chainIds } = await loadFixture(deployContractsFixture); const TokenBridgeV1 = await ethers.getContractFactory( - "contracts/tokenBridge/mocks/TokenBridgeFlatten.sol:TokenBridgeFlatten", + "src/_testing/integration/TokenBridgeFlatten.sol:TokenBridgeFlatten", ); const tokenBridgeV1 = (await upgrades.deployProxy(TokenBridgeV1, [ owner.address, From 3f25b966ad8e2f625d8134caf3ad23f66a6051eb Mon Sep 17 00:00:00 2001 From: VGau Date: Wed, 11 Dec 2024 09:41:32 +0100 Subject: [PATCH 02/14] fix: update contracts documentation --- .../token}/BridgedToken.md | 0 .../token}/CustomBridgedToken.md | 0 .../token}/TokenBridge.md | 0 .../token}/interfaces/ITokenBridge.md | 0 .../token/utils}/StorageFiller39.md | 0 .../lib => governance}/TimeLock.md | 0 .../docs/api/interfaces/l1/IPlonkVerifier.md | 25 ------------------- contracts/docs/api/{lib => libraries}/Mimc.md | 0 .../{lib => libraries}/SparseMerkleProof.md | 0 .../TransientStorageHelpers.md | 0 .../docs/api/{lib => libraries}/Utils.md | 0 .../MessageServiceBase.md | 0 .../interfaces/IMessageService.md | 0 .../l1/L1MessageManager.md | 0 .../l1/L1MessageService.md | 0 .../l1/interfaces}/IL1MessageManager.md | 0 .../l1/interfaces}/IL1MessageService.md | 0 .../l1/v1/L1MessageManagerV1.md | 0 .../l1/v1/L1MessageServiceV1.md | 0 .../l1/v1/interfaces}/IL1MessageManagerV1.md | 0 .../l2/L2MessageManager.md | 0 .../l2/L2MessageService.md | 0 .../l2/interfaces}/IL2MessageManager.md | 0 .../l2/v1/L2MessageManagerV1.md | 0 .../l2/v1/L2MessageServiceV1.md | 0 .../l2/v1/interfaces}/IL2MessageManagerV1.md | 0 .../l2/v1/interfaces}/IL2MessageServiceV1.md | 0 .../libraries}/MessageHashing.md | 0 .../libraries}/SparseMerkleTreeVerifier.md | 0 .../docs/api/{ => rollup}/LineaRollup.md | 0 contracts/docs/api/{ => rollup}/ZkEvmV2.md | 0 .../l1 => rollup/interfaces}/ILineaRollup.md | 0 .../l1 => rollup/interfaces}/IZkEvmV2.md | 0 .../access}/PermissionsManager.md | 0 .../access}/interfaces/IPermissionsManager.md | 0 .../lib => security/limiting}/RateLimiter.md | 0 .../limiting}/interfaces/IRateLimiter.md | 0 .../pausing}/L2MessageServicePauseManager.md | 0 .../pausing}/LineaRollupPauseManager.md | 0 .../{lib => security/pausing}/PauseManager.md | 0 .../pausing}/TokenBridgePauseManager.md | 0 .../pausing}/interfaces/IPauseManager.md | 0 ...nsientStorageReentrancyGuardUpgradeable.md | 0 contracts/hardhat.config.ts | 2 +- 44 files changed, 1 insertion(+), 26 deletions(-) rename contracts/docs/api/{tokenBridge => bridging/token}/BridgedToken.md (100%) rename contracts/docs/api/{tokenBridge => bridging/token}/CustomBridgedToken.md (100%) rename contracts/docs/api/{tokenBridge => bridging/token}/TokenBridge.md (100%) rename contracts/docs/api/{tokenBridge => bridging/token}/interfaces/ITokenBridge.md (100%) rename contracts/docs/api/{tokenBridge/lib => bridging/token/utils}/StorageFiller39.md (100%) rename contracts/docs/api/{messageService/lib => governance}/TimeLock.md (100%) delete mode 100644 contracts/docs/api/interfaces/l1/IPlonkVerifier.md rename contracts/docs/api/{lib => libraries}/Mimc.md (100%) rename contracts/docs/api/{lib => libraries}/SparseMerkleProof.md (100%) rename contracts/docs/api/{messageService/lib => libraries}/TransientStorageHelpers.md (100%) rename contracts/docs/api/{lib => libraries}/Utils.md (100%) rename contracts/docs/api/{messageService => messaging}/MessageServiceBase.md (100%) rename contracts/docs/api/{ => messaging}/interfaces/IMessageService.md (100%) rename contracts/docs/api/{messageService => messaging}/l1/L1MessageManager.md (100%) rename contracts/docs/api/{messageService => messaging}/l1/L1MessageService.md (100%) rename contracts/docs/api/{interfaces/l1 => messaging/l1/interfaces}/IL1MessageManager.md (100%) rename contracts/docs/api/{interfaces/l1 => messaging/l1/interfaces}/IL1MessageService.md (100%) rename contracts/docs/api/{messageService => messaging}/l1/v1/L1MessageManagerV1.md (100%) rename contracts/docs/api/{messageService => messaging}/l1/v1/L1MessageServiceV1.md (100%) rename contracts/docs/api/{interfaces/l1 => messaging/l1/v1/interfaces}/IL1MessageManagerV1.md (100%) rename contracts/docs/api/{messageService => messaging}/l2/L2MessageManager.md (100%) rename contracts/docs/api/{messageService => messaging}/l2/L2MessageService.md (100%) rename contracts/docs/api/{interfaces/l2 => messaging/l2/interfaces}/IL2MessageManager.md (100%) rename contracts/docs/api/{messageService => messaging}/l2/v1/L2MessageManagerV1.md (100%) rename contracts/docs/api/{messageService => messaging}/l2/v1/L2MessageServiceV1.md (100%) rename contracts/docs/api/{interfaces/l2 => messaging/l2/v1/interfaces}/IL2MessageManagerV1.md (100%) rename contracts/docs/api/{interfaces/l2 => messaging/l2/v1/interfaces}/IL2MessageServiceV1.md (100%) rename contracts/docs/api/{messageService/lib => messaging/libraries}/MessageHashing.md (100%) rename contracts/docs/api/{messageService/lib => messaging/libraries}/SparseMerkleTreeVerifier.md (100%) rename contracts/docs/api/{ => rollup}/LineaRollup.md (100%) rename contracts/docs/api/{ => rollup}/ZkEvmV2.md (100%) rename contracts/docs/api/{interfaces/l1 => rollup/interfaces}/ILineaRollup.md (100%) rename contracts/docs/api/{interfaces/l1 => rollup/interfaces}/IZkEvmV2.md (100%) rename contracts/docs/api/{lib => security/access}/PermissionsManager.md (100%) rename contracts/docs/api/{ => security/access}/interfaces/IPermissionsManager.md (100%) rename contracts/docs/api/{messageService/lib => security/limiting}/RateLimiter.md (100%) rename contracts/docs/api/{ => security/limiting}/interfaces/IRateLimiter.md (100%) rename contracts/docs/api/{lib => security/pausing}/L2MessageServicePauseManager.md (100%) rename contracts/docs/api/{lib => security/pausing}/LineaRollupPauseManager.md (100%) rename contracts/docs/api/{lib => security/pausing}/PauseManager.md (100%) rename contracts/docs/api/{lib => security/pausing}/TokenBridgePauseManager.md (100%) rename contracts/docs/api/{ => security/pausing}/interfaces/IPauseManager.md (100%) rename contracts/docs/api/{messageService/l1 => security/reentrancy}/TransientStorageReentrancyGuardUpgradeable.md (100%) diff --git a/contracts/docs/api/tokenBridge/BridgedToken.md b/contracts/docs/api/bridging/token/BridgedToken.md similarity index 100% rename from contracts/docs/api/tokenBridge/BridgedToken.md rename to contracts/docs/api/bridging/token/BridgedToken.md diff --git a/contracts/docs/api/tokenBridge/CustomBridgedToken.md b/contracts/docs/api/bridging/token/CustomBridgedToken.md similarity index 100% rename from contracts/docs/api/tokenBridge/CustomBridgedToken.md rename to contracts/docs/api/bridging/token/CustomBridgedToken.md diff --git a/contracts/docs/api/tokenBridge/TokenBridge.md b/contracts/docs/api/bridging/token/TokenBridge.md similarity index 100% rename from contracts/docs/api/tokenBridge/TokenBridge.md rename to contracts/docs/api/bridging/token/TokenBridge.md diff --git a/contracts/docs/api/tokenBridge/interfaces/ITokenBridge.md b/contracts/docs/api/bridging/token/interfaces/ITokenBridge.md similarity index 100% rename from contracts/docs/api/tokenBridge/interfaces/ITokenBridge.md rename to contracts/docs/api/bridging/token/interfaces/ITokenBridge.md diff --git a/contracts/docs/api/tokenBridge/lib/StorageFiller39.md b/contracts/docs/api/bridging/token/utils/StorageFiller39.md similarity index 100% rename from contracts/docs/api/tokenBridge/lib/StorageFiller39.md rename to contracts/docs/api/bridging/token/utils/StorageFiller39.md diff --git a/contracts/docs/api/messageService/lib/TimeLock.md b/contracts/docs/api/governance/TimeLock.md similarity index 100% rename from contracts/docs/api/messageService/lib/TimeLock.md rename to contracts/docs/api/governance/TimeLock.md diff --git a/contracts/docs/api/interfaces/l1/IPlonkVerifier.md b/contracts/docs/api/interfaces/l1/IPlonkVerifier.md deleted file mode 100644 index 72ed2cd7b..000000000 --- a/contracts/docs/api/interfaces/l1/IPlonkVerifier.md +++ /dev/null @@ -1,25 +0,0 @@ -# Solidity API - -## IPlonkVerifier - -### Verify - -```solidity -function Verify(bytes _proof, uint256[] _public_inputs) external returns (bool success) -``` - -Interface for verifier contracts. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _proof | bytes | The proof used to verify. | -| _public_inputs | uint256[] | The computed public inputs for the proof verification. | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| success | bool | Returns true if successfully verified. | - diff --git a/contracts/docs/api/lib/Mimc.md b/contracts/docs/api/libraries/Mimc.md similarity index 100% rename from contracts/docs/api/lib/Mimc.md rename to contracts/docs/api/libraries/Mimc.md diff --git a/contracts/docs/api/lib/SparseMerkleProof.md b/contracts/docs/api/libraries/SparseMerkleProof.md similarity index 100% rename from contracts/docs/api/lib/SparseMerkleProof.md rename to contracts/docs/api/libraries/SparseMerkleProof.md diff --git a/contracts/docs/api/messageService/lib/TransientStorageHelpers.md b/contracts/docs/api/libraries/TransientStorageHelpers.md similarity index 100% rename from contracts/docs/api/messageService/lib/TransientStorageHelpers.md rename to contracts/docs/api/libraries/TransientStorageHelpers.md diff --git a/contracts/docs/api/lib/Utils.md b/contracts/docs/api/libraries/Utils.md similarity index 100% rename from contracts/docs/api/lib/Utils.md rename to contracts/docs/api/libraries/Utils.md diff --git a/contracts/docs/api/messageService/MessageServiceBase.md b/contracts/docs/api/messaging/MessageServiceBase.md similarity index 100% rename from contracts/docs/api/messageService/MessageServiceBase.md rename to contracts/docs/api/messaging/MessageServiceBase.md diff --git a/contracts/docs/api/interfaces/IMessageService.md b/contracts/docs/api/messaging/interfaces/IMessageService.md similarity index 100% rename from contracts/docs/api/interfaces/IMessageService.md rename to contracts/docs/api/messaging/interfaces/IMessageService.md diff --git a/contracts/docs/api/messageService/l1/L1MessageManager.md b/contracts/docs/api/messaging/l1/L1MessageManager.md similarity index 100% rename from contracts/docs/api/messageService/l1/L1MessageManager.md rename to contracts/docs/api/messaging/l1/L1MessageManager.md diff --git a/contracts/docs/api/messageService/l1/L1MessageService.md b/contracts/docs/api/messaging/l1/L1MessageService.md similarity index 100% rename from contracts/docs/api/messageService/l1/L1MessageService.md rename to contracts/docs/api/messaging/l1/L1MessageService.md diff --git a/contracts/docs/api/interfaces/l1/IL1MessageManager.md b/contracts/docs/api/messaging/l1/interfaces/IL1MessageManager.md similarity index 100% rename from contracts/docs/api/interfaces/l1/IL1MessageManager.md rename to contracts/docs/api/messaging/l1/interfaces/IL1MessageManager.md diff --git a/contracts/docs/api/interfaces/l1/IL1MessageService.md b/contracts/docs/api/messaging/l1/interfaces/IL1MessageService.md similarity index 100% rename from contracts/docs/api/interfaces/l1/IL1MessageService.md rename to contracts/docs/api/messaging/l1/interfaces/IL1MessageService.md diff --git a/contracts/docs/api/messageService/l1/v1/L1MessageManagerV1.md b/contracts/docs/api/messaging/l1/v1/L1MessageManagerV1.md similarity index 100% rename from contracts/docs/api/messageService/l1/v1/L1MessageManagerV1.md rename to contracts/docs/api/messaging/l1/v1/L1MessageManagerV1.md diff --git a/contracts/docs/api/messageService/l1/v1/L1MessageServiceV1.md b/contracts/docs/api/messaging/l1/v1/L1MessageServiceV1.md similarity index 100% rename from contracts/docs/api/messageService/l1/v1/L1MessageServiceV1.md rename to contracts/docs/api/messaging/l1/v1/L1MessageServiceV1.md diff --git a/contracts/docs/api/interfaces/l1/IL1MessageManagerV1.md b/contracts/docs/api/messaging/l1/v1/interfaces/IL1MessageManagerV1.md similarity index 100% rename from contracts/docs/api/interfaces/l1/IL1MessageManagerV1.md rename to contracts/docs/api/messaging/l1/v1/interfaces/IL1MessageManagerV1.md diff --git a/contracts/docs/api/messageService/l2/L2MessageManager.md b/contracts/docs/api/messaging/l2/L2MessageManager.md similarity index 100% rename from contracts/docs/api/messageService/l2/L2MessageManager.md rename to contracts/docs/api/messaging/l2/L2MessageManager.md diff --git a/contracts/docs/api/messageService/l2/L2MessageService.md b/contracts/docs/api/messaging/l2/L2MessageService.md similarity index 100% rename from contracts/docs/api/messageService/l2/L2MessageService.md rename to contracts/docs/api/messaging/l2/L2MessageService.md diff --git a/contracts/docs/api/interfaces/l2/IL2MessageManager.md b/contracts/docs/api/messaging/l2/interfaces/IL2MessageManager.md similarity index 100% rename from contracts/docs/api/interfaces/l2/IL2MessageManager.md rename to contracts/docs/api/messaging/l2/interfaces/IL2MessageManager.md diff --git a/contracts/docs/api/messageService/l2/v1/L2MessageManagerV1.md b/contracts/docs/api/messaging/l2/v1/L2MessageManagerV1.md similarity index 100% rename from contracts/docs/api/messageService/l2/v1/L2MessageManagerV1.md rename to contracts/docs/api/messaging/l2/v1/L2MessageManagerV1.md diff --git a/contracts/docs/api/messageService/l2/v1/L2MessageServiceV1.md b/contracts/docs/api/messaging/l2/v1/L2MessageServiceV1.md similarity index 100% rename from contracts/docs/api/messageService/l2/v1/L2MessageServiceV1.md rename to contracts/docs/api/messaging/l2/v1/L2MessageServiceV1.md diff --git a/contracts/docs/api/interfaces/l2/IL2MessageManagerV1.md b/contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageManagerV1.md similarity index 100% rename from contracts/docs/api/interfaces/l2/IL2MessageManagerV1.md rename to contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageManagerV1.md diff --git a/contracts/docs/api/interfaces/l2/IL2MessageServiceV1.md b/contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageServiceV1.md similarity index 100% rename from contracts/docs/api/interfaces/l2/IL2MessageServiceV1.md rename to contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageServiceV1.md diff --git a/contracts/docs/api/messageService/lib/MessageHashing.md b/contracts/docs/api/messaging/libraries/MessageHashing.md similarity index 100% rename from contracts/docs/api/messageService/lib/MessageHashing.md rename to contracts/docs/api/messaging/libraries/MessageHashing.md diff --git a/contracts/docs/api/messageService/lib/SparseMerkleTreeVerifier.md b/contracts/docs/api/messaging/libraries/SparseMerkleTreeVerifier.md similarity index 100% rename from contracts/docs/api/messageService/lib/SparseMerkleTreeVerifier.md rename to contracts/docs/api/messaging/libraries/SparseMerkleTreeVerifier.md diff --git a/contracts/docs/api/LineaRollup.md b/contracts/docs/api/rollup/LineaRollup.md similarity index 100% rename from contracts/docs/api/LineaRollup.md rename to contracts/docs/api/rollup/LineaRollup.md diff --git a/contracts/docs/api/ZkEvmV2.md b/contracts/docs/api/rollup/ZkEvmV2.md similarity index 100% rename from contracts/docs/api/ZkEvmV2.md rename to contracts/docs/api/rollup/ZkEvmV2.md diff --git a/contracts/docs/api/interfaces/l1/ILineaRollup.md b/contracts/docs/api/rollup/interfaces/ILineaRollup.md similarity index 100% rename from contracts/docs/api/interfaces/l1/ILineaRollup.md rename to contracts/docs/api/rollup/interfaces/ILineaRollup.md diff --git a/contracts/docs/api/interfaces/l1/IZkEvmV2.md b/contracts/docs/api/rollup/interfaces/IZkEvmV2.md similarity index 100% rename from contracts/docs/api/interfaces/l1/IZkEvmV2.md rename to contracts/docs/api/rollup/interfaces/IZkEvmV2.md diff --git a/contracts/docs/api/lib/PermissionsManager.md b/contracts/docs/api/security/access/PermissionsManager.md similarity index 100% rename from contracts/docs/api/lib/PermissionsManager.md rename to contracts/docs/api/security/access/PermissionsManager.md diff --git a/contracts/docs/api/interfaces/IPermissionsManager.md b/contracts/docs/api/security/access/interfaces/IPermissionsManager.md similarity index 100% rename from contracts/docs/api/interfaces/IPermissionsManager.md rename to contracts/docs/api/security/access/interfaces/IPermissionsManager.md diff --git a/contracts/docs/api/messageService/lib/RateLimiter.md b/contracts/docs/api/security/limiting/RateLimiter.md similarity index 100% rename from contracts/docs/api/messageService/lib/RateLimiter.md rename to contracts/docs/api/security/limiting/RateLimiter.md diff --git a/contracts/docs/api/interfaces/IRateLimiter.md b/contracts/docs/api/security/limiting/interfaces/IRateLimiter.md similarity index 100% rename from contracts/docs/api/interfaces/IRateLimiter.md rename to contracts/docs/api/security/limiting/interfaces/IRateLimiter.md diff --git a/contracts/docs/api/lib/L2MessageServicePauseManager.md b/contracts/docs/api/security/pausing/L2MessageServicePauseManager.md similarity index 100% rename from contracts/docs/api/lib/L2MessageServicePauseManager.md rename to contracts/docs/api/security/pausing/L2MessageServicePauseManager.md diff --git a/contracts/docs/api/lib/LineaRollupPauseManager.md b/contracts/docs/api/security/pausing/LineaRollupPauseManager.md similarity index 100% rename from contracts/docs/api/lib/LineaRollupPauseManager.md rename to contracts/docs/api/security/pausing/LineaRollupPauseManager.md diff --git a/contracts/docs/api/lib/PauseManager.md b/contracts/docs/api/security/pausing/PauseManager.md similarity index 100% rename from contracts/docs/api/lib/PauseManager.md rename to contracts/docs/api/security/pausing/PauseManager.md diff --git a/contracts/docs/api/lib/TokenBridgePauseManager.md b/contracts/docs/api/security/pausing/TokenBridgePauseManager.md similarity index 100% rename from contracts/docs/api/lib/TokenBridgePauseManager.md rename to contracts/docs/api/security/pausing/TokenBridgePauseManager.md diff --git a/contracts/docs/api/interfaces/IPauseManager.md b/contracts/docs/api/security/pausing/interfaces/IPauseManager.md similarity index 100% rename from contracts/docs/api/interfaces/IPauseManager.md rename to contracts/docs/api/security/pausing/interfaces/IPauseManager.md diff --git a/contracts/docs/api/messageService/l1/TransientStorageReentrancyGuardUpgradeable.md b/contracts/docs/api/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.md similarity index 100% rename from contracts/docs/api/messageService/l1/TransientStorageReentrancyGuardUpgradeable.md rename to contracts/docs/api/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.md diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 71ac5017f..73245795c 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -155,7 +155,7 @@ const config: HardhatUserConfig = { ], }, docgen: { - exclude: ["token", "test-contracts", "proxies", "tools", "interfaces/tools", "tokenBridge/mocks", "verifiers"], + exclude: ["tokens", "_testing", "proxies", "recovery", "verifiers"], pages: "files", outputDir: "docs/api/", }, From 94ba20196de51be1148199b786f696b16d6cf2a8 Mon Sep 17 00:00:00 2001 From: VGau Date: Fri, 20 Dec 2024 13:23:28 +0100 Subject: [PATCH 03/14] fix: regenerate docs --- .../docs/api/bridging/token/BridgedToken.md | 89 --- .../api/bridging/token/CustomBridgedToken.md | 10 - .../docs/api/bridging/token/TokenBridge.md | 523 ------------------ .../bridging/token/interfaces/ITokenBridge.md | 486 ---------------- contracts/docs/api/governance/TimeLock.md | 10 - .../libraries => governance}/TimeLock.mdx | 0 contracts/docs/api/libraries/Mimc.md | 46 -- .../{security/pausing => libraries}/Mimc.mdx | 0 .../docs/api/libraries/SparseMerkleProof.md | 212 ------- .../SparseMerkleProof.mdx | 0 .../api/libraries/TransientStorageHelpers.md | 72 --- .../libraries/TransientStorageHelpers.mdx | 0 contracts/docs/api/libraries/Utils.md | 32 -- .../{security/pausing => libraries}/Utils.mdx | 0 .../docs/api/messaging/MessageServiceBase.md | 105 ---- .../messaging/interfaces/IMessageService.md | 126 ----- .../interfaces/IMessageService.mdx | 0 .../docs/api/messaging/l1/L1MessageManager.md | 111 ---- .../docs/api/messaging/l1/L1MessageService.md | 77 --- .../l1/interfaces/IL1MessageManager.md | 95 ---- .../l1/interfaces}/IL1MessageManager.mdx | 0 .../l1/interfaces/IL1MessageService.md | 65 --- .../l1/interfaces}/IL1MessageService.mdx | 0 .../api/messaging/l1/v1/L1MessageManagerV1.md | 71 --- .../api/messaging/l1/v1/L1MessageServiceV1.md | 81 --- .../l1/v1/interfaces/IL1MessageManagerV1.md | 10 - .../l1/v1/interfaces}/IL1MessageManagerV1.mdx | 0 .../docs/api/messaging/l2/L2MessageManager.md | 48 -- .../docs/api/messaging/l2/L2MessageService.md | 53 -- .../l2/interfaces/IL2MessageManager.md | 89 --- .../{v1 => }/interfaces/IL2MessageManager.mdx | 0 .../api/messaging/l2/v1/L2MessageManagerV1.md | 45 -- .../api/messaging/l2/v1/L2MessageServiceV1.md | 138 ----- .../l2/v1/interfaces/IL2MessageManagerV1.md | 48 -- .../l2/v1/interfaces/IL2MessageServiceV1.md | 18 - .../api/messaging/libraries/MessageHashing.md | 24 - .../libraries/SparseMerkleTreeVerifier.md | 66 --- contracts/docs/api/rollup/LineaRollup.md | 466 ---------------- .../docs/api/{ => rollup}/LineaRollup.mdx | 0 contracts/docs/api/rollup/ZkEvmV2.md | 64 --- contracts/docs/api/{ => rollup}/ZkEvmV2.mdx | 0 .../api/rollup/interfaces/ILineaRollup.md | 505 ----------------- .../l1 => rollup/interfaces}/ILineaRollup.mdx | 0 .../docs/api/rollup/interfaces/IZkEvmV2.md | 42 -- .../l1 => rollup/interfaces}/IZkEvmV2.mdx | 0 .../api/security/access/PermissionsManager.md | 16 - .../PermissionsManager.mdx | 0 .../access/interfaces/IPermissionsManager.md | 11 - .../interfaces/IPermissionsManager.mdx | 0 .../docs/api/security/limiting/RateLimiter.md | 111 ---- .../limiting}/RateLimiter.mdx | 0 .../limiting/interfaces/IRateLimiter.md | 106 ---- .../limiting}/interfaces/IRateLimiter.mdx | 0 .../security/pausing/CallForwardingProxy.mdx | 24 - .../pausing/L2MessageServicePauseManager.md | 34 -- .../pausing/LineaRollupPauseManager.md | 66 --- .../docs/api/security/pausing/PauseManager.md | 151 ----- .../pausing/TokenBridgePauseManager.md | 26 - .../pausing/interfaces/IPauseManager.md | 155 ------ .../pausing}/interfaces/IPauseManager.mdx | 0 ...nsientStorageReentrancyGuardUpgradeable.md | 14 - ...sientStorageReentrancyGuardUpgradeable.mdx | 0 62 files changed, 4541 deletions(-) delete mode 100644 contracts/docs/api/bridging/token/BridgedToken.md delete mode 100644 contracts/docs/api/bridging/token/CustomBridgedToken.md delete mode 100644 contracts/docs/api/bridging/token/TokenBridge.md delete mode 100644 contracts/docs/api/bridging/token/interfaces/ITokenBridge.md delete mode 100644 contracts/docs/api/governance/TimeLock.md rename contracts/docs/api/{messaging/libraries => governance}/TimeLock.mdx (100%) delete mode 100644 contracts/docs/api/libraries/Mimc.md rename contracts/docs/api/{security/pausing => libraries}/Mimc.mdx (100%) delete mode 100644 contracts/docs/api/libraries/SparseMerkleProof.md rename contracts/docs/api/{security/pausing => libraries}/SparseMerkleProof.mdx (100%) delete mode 100644 contracts/docs/api/libraries/TransientStorageHelpers.md rename contracts/docs/api/{messaging => }/libraries/TransientStorageHelpers.mdx (100%) delete mode 100644 contracts/docs/api/libraries/Utils.md rename contracts/docs/api/{security/pausing => libraries}/Utils.mdx (100%) delete mode 100644 contracts/docs/api/messaging/MessageServiceBase.md delete mode 100644 contracts/docs/api/messaging/interfaces/IMessageService.md rename contracts/docs/api/{ => messaging}/interfaces/IMessageService.mdx (100%) delete mode 100644 contracts/docs/api/messaging/l1/L1MessageManager.md delete mode 100644 contracts/docs/api/messaging/l1/L1MessageService.md delete mode 100644 contracts/docs/api/messaging/l1/interfaces/IL1MessageManager.md rename contracts/docs/api/{interfaces/l1 => messaging/l1/interfaces}/IL1MessageManager.mdx (100%) delete mode 100644 contracts/docs/api/messaging/l1/interfaces/IL1MessageService.md rename contracts/docs/api/{interfaces/l1 => messaging/l1/interfaces}/IL1MessageService.mdx (100%) delete mode 100644 contracts/docs/api/messaging/l1/v1/L1MessageManagerV1.md delete mode 100644 contracts/docs/api/messaging/l1/v1/L1MessageServiceV1.md delete mode 100644 contracts/docs/api/messaging/l1/v1/interfaces/IL1MessageManagerV1.md rename contracts/docs/api/{interfaces/l1 => messaging/l1/v1/interfaces}/IL1MessageManagerV1.mdx (100%) delete mode 100644 contracts/docs/api/messaging/l2/L2MessageManager.md delete mode 100644 contracts/docs/api/messaging/l2/L2MessageService.md delete mode 100644 contracts/docs/api/messaging/l2/interfaces/IL2MessageManager.md rename contracts/docs/api/messaging/l2/{v1 => }/interfaces/IL2MessageManager.mdx (100%) delete mode 100644 contracts/docs/api/messaging/l2/v1/L2MessageManagerV1.md delete mode 100644 contracts/docs/api/messaging/l2/v1/L2MessageServiceV1.md delete mode 100644 contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageManagerV1.md delete mode 100644 contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageServiceV1.md delete mode 100644 contracts/docs/api/messaging/libraries/MessageHashing.md delete mode 100644 contracts/docs/api/messaging/libraries/SparseMerkleTreeVerifier.md delete mode 100644 contracts/docs/api/rollup/LineaRollup.md rename contracts/docs/api/{ => rollup}/LineaRollup.mdx (100%) delete mode 100644 contracts/docs/api/rollup/ZkEvmV2.md rename contracts/docs/api/{ => rollup}/ZkEvmV2.mdx (100%) delete mode 100644 contracts/docs/api/rollup/interfaces/ILineaRollup.md rename contracts/docs/api/{interfaces/l1 => rollup/interfaces}/ILineaRollup.mdx (100%) delete mode 100644 contracts/docs/api/rollup/interfaces/IZkEvmV2.md rename contracts/docs/api/{interfaces/l1 => rollup/interfaces}/IZkEvmV2.mdx (100%) delete mode 100644 contracts/docs/api/security/access/PermissionsManager.md rename contracts/docs/api/security/{pausing => access}/PermissionsManager.mdx (100%) delete mode 100644 contracts/docs/api/security/access/interfaces/IPermissionsManager.md rename contracts/docs/api/{ => security/access}/interfaces/IPermissionsManager.mdx (100%) delete mode 100644 contracts/docs/api/security/limiting/RateLimiter.md rename contracts/docs/api/{messaging/libraries => security/limiting}/RateLimiter.mdx (100%) delete mode 100644 contracts/docs/api/security/limiting/interfaces/IRateLimiter.md rename contracts/docs/api/{ => security/limiting}/interfaces/IRateLimiter.mdx (100%) delete mode 100644 contracts/docs/api/security/pausing/CallForwardingProxy.mdx delete mode 100644 contracts/docs/api/security/pausing/L2MessageServicePauseManager.md delete mode 100644 contracts/docs/api/security/pausing/LineaRollupPauseManager.md delete mode 100644 contracts/docs/api/security/pausing/PauseManager.md delete mode 100644 contracts/docs/api/security/pausing/TokenBridgePauseManager.md delete mode 100644 contracts/docs/api/security/pausing/interfaces/IPauseManager.md rename contracts/docs/api/{ => security/pausing}/interfaces/IPauseManager.mdx (100%) delete mode 100644 contracts/docs/api/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.md rename contracts/docs/api/{messaging/l1 => security/reentrancy}/TransientStorageReentrancyGuardUpgradeable.mdx (100%) diff --git a/contracts/docs/api/bridging/token/BridgedToken.md b/contracts/docs/api/bridging/token/BridgedToken.md deleted file mode 100644 index 8f7c4d585..000000000 --- a/contracts/docs/api/bridging/token/BridgedToken.md +++ /dev/null @@ -1,89 +0,0 @@ -# `BridgedToken` - -ERC20 token created when a native token is bridged to a target chain. - -### bridge - -```solidity -address bridge -``` - -### _decimals - -```solidity -uint8 _decimals -``` - -### OnlyBridge - -```solidity -error OnlyBridge(address bridgeAddress) -``` - -### constructor - -```solidity -constructor() public -``` - -_Disable constructor for safety_ - -### initialize - -```solidity -function initialize(string _tokenName, string _tokenSymbol, uint8 _tokenDecimals) external -``` - -### onlyBridge - -```solidity -modifier onlyBridge() -``` - -_Ensures call come from the bridge._ - -### mint - -```solidity -function mint(address _recipient, uint256 _amount) external -``` - -_Called by the bridge to mint tokens during a bridge transaction._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _recipient | address | The address to receive the minted tokens. | -| _amount | uint256 | The amount of tokens to mint. | - -### burn - -```solidity -function burn(address _account, uint256 _amount) external -``` - -_Called by the bridge to burn tokens during a bridge transaction. -User should first have allowed the bridge to spend tokens on their behalf._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _account | address | The account from which tokens will be burned. | -| _amount | uint256 | The amount of tokens to burn. | - -### decimals - -```solidity -function decimals() public view returns (uint8) -``` - -_Overrides ERC20 default function to support tokens with different decimals._ - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| [0] | uint8 | The number of decimal. | - diff --git a/contracts/docs/api/bridging/token/CustomBridgedToken.md b/contracts/docs/api/bridging/token/CustomBridgedToken.md deleted file mode 100644 index eef9c2b58..000000000 --- a/contracts/docs/api/bridging/token/CustomBridgedToken.md +++ /dev/null @@ -1,10 +0,0 @@ -# `CustomBridgedToken` - -Custom ERC20 token manually deployed for the Linea TokenBridge. - -### initializeV2 - -```solidity -function initializeV2(string _tokenName, string _tokenSymbol, uint8 _tokenDecimals, address _bridge) public -``` - diff --git a/contracts/docs/api/bridging/token/TokenBridge.md b/contracts/docs/api/bridging/token/TokenBridge.md deleted file mode 100644 index f333b32e7..000000000 --- a/contracts/docs/api/bridging/token/TokenBridge.md +++ /dev/null @@ -1,523 +0,0 @@ -# `TokenBridge` - -Contract to manage cross-chain ERC20 bridging. - -### CONTRACT_VERSION - -```solidity -string CONTRACT_VERSION -``` - -_This is the ABI version and not the reinitialize version._ - -### SET_MESSAGE_SERVICE_ROLE - -```solidity -bytes32 SET_MESSAGE_SERVICE_ROLE -``` - -Role used for setting the message service address. - -### SET_REMOTE_TOKENBRIDGE_ROLE - -```solidity -bytes32 SET_REMOTE_TOKENBRIDGE_ROLE -``` - -Role used for setting the remote token bridge address. - -### SET_RESERVED_TOKEN_ROLE - -```solidity -bytes32 SET_RESERVED_TOKEN_ROLE -``` - -Role used for setting a reserved token address. - -### REMOVE_RESERVED_TOKEN_ROLE - -```solidity -bytes32 REMOVE_RESERVED_TOKEN_ROLE -``` - -Role used for removing a reserved token address. - -### SET_CUSTOM_CONTRACT_ROLE - -```solidity -bytes32 SET_CUSTOM_CONTRACT_ROLE -``` - -Role used for setting a custom token contract address. - -### EMPTY - -```solidity -address EMPTY -``` - -EMPTY means a token is not present in the mapping. - -### RESERVED_STATUS - -```solidity -address RESERVED_STATUS -``` - -RESERVED means a token is reserved and cannot be bridged. - -### NATIVE_STATUS - -```solidity -address NATIVE_STATUS -``` - -NATIVE means a token is native to the current local chain. - -### DEPLOYED_STATUS - -```solidity -address DEPLOYED_STATUS -``` - -DEPLOYED means the bridged token contract has been deployed on the remote chain. - -### _PERMIT_SELECTOR - -```solidity -bytes4 _PERMIT_SELECTOR -``` - -_The permit selector to be used when decoding the permit._ - -### tokenBeacon - -```solidity -address tokenBeacon -``` - -The token beacon for deployed tokens. - -### nativeToBridgedToken - -```solidity -mapping(uint256 => mapping(address => address)) nativeToBridgedToken -``` - -The chainId mapped to a native token address which is then mapped to the bridged token address. - -### bridgedToNativeToken - -```solidity -mapping(address => address) bridgedToNativeToken -``` - -The bridged token address mapped to the native token address. - -### sourceChainId - -```solidity -uint256 sourceChainId -``` - -The current layer's chainId from where the bridging is triggered. - -### targetChainId - -```solidity -uint256 targetChainId -``` - -The targeted layer's chainId where the bridging is received. - -### isNewToken - -```solidity -modifier isNewToken(address _token) -``` - -_Ensures the token has not been bridged before._ - -### nonZeroAddress - -```solidity -modifier nonZeroAddress(address _addr) -``` - -_Ensures the address is not address(0)._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _addr | address | Address to check. | - -### nonZeroAmount - -```solidity -modifier nonZeroAmount(uint256 _amount) -``` - -_Ensures the amount is not 0._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _amount | uint256 | amount to check. | - -### constructor - -```solidity -constructor() public -``` - -_Disable constructor for safety_ - -### initialize - -```solidity -function initialize(struct ITokenBridge.InitializationData _initializationData) external -``` - -Initializes TokenBridge and underlying service dependencies - used for new networks only. - -_Contract will be used as proxy implementation._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _initializationData | struct ITokenBridge.InitializationData | The initial data used for initializing the TokenBridge contract. | - -### reinitializePauseTypesAndPermissions - -```solidity -function reinitializePauseTypesAndPermissions(address _defaultAdmin, struct IPermissionsManager.RoleAddress[] _roleAddresses, struct IPauseManager.PauseTypeRole[] _pauseTypeRoles, struct IPauseManager.PauseTypeRole[] _unpauseTypeRoles) external -``` - -Sets permissions for a list of addresses and their roles as well as initialises the PauseManager pauseType:role mappings. - -_This function is a reinitializer and can only be called once per version. Should be called using an upgradeAndCall transaction to the ProxyAdmin._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _defaultAdmin | address | The default admin account's address. | -| _roleAddresses | struct IPermissionsManager.RoleAddress[] | The list of addresses and roles to assign permissions to. | -| _pauseTypeRoles | struct IPauseManager.PauseTypeRole[] | The list of pause types to associate with roles. | -| _unpauseTypeRoles | struct IPauseManager.PauseTypeRole[] | The list of unpause types to associate with roles. | - -### bridgeToken - -```solidity -function bridgeToken(address _token, uint256 _amount, address _recipient) public payable -``` - -This function is the single entry point to bridge tokens to the - other chain, both for native and already bridged tokens. You can use it - to bridge any ERC20. If the token is bridged for the first time an ERC20 - (BridgedToken.sol) will be automatically deployed on the target chain. - -_User should first allow the bridge to transfer tokens on his behalf. - Alternatively, you can use BridgeTokenWithPermit to do so in a single - transaction. If you want the transfer to be automatically executed on the - destination chain. You should send enough ETH to pay the postman fees. - Note that Linea can reserve some tokens (which use a dedicated bridge). - In this case, the token cannot be bridged. Linea can only reserve tokens - that have not been bridged yet. - Linea can pause the bridge for security reason. In this case new bridge - transaction would revert. -Note: If, when bridging an unbridged token and decimals are unknown, -the call will revert to prevent mismatched decimals. Only those ERC20s, -with a decimals function are supported._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _token | address | The address of the token to be bridged. | -| _amount | uint256 | The amount of the token to be bridged. | -| _recipient | address | The address that will receive the tokens on the other chain. | - -### bridgeTokenWithPermit - -```solidity -function bridgeTokenWithPermit(address _token, uint256 _amount, address _recipient, bytes _permitData) external payable -``` - -Similar to `bridgeToken` function but allows to pass additional - permit data to do the ERC20 approval in a single transaction. -_permit can fail silently, don't rely on this function passing as a form - of authentication - -_There is no need for validation at this level as the validation on pausing, -and empty values exists on the "bridgeToken" call._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _token | address | The address of the token to be bridged. | -| _amount | uint256 | The amount of the token to be bridged. | -| _recipient | address | The address that will receive the tokens on the other chain. | -| _permitData | bytes | The permit data for the token, if applicable. | - -### completeBridging - -```solidity -function completeBridging(address _nativeToken, uint256 _amount, address _recipient, uint256 _chainId, bytes _tokenMetadata) external -``` - -_It can only be called from the Message Service. To finalize the bridging - process, a user or postman needs to use the `claimMessage` function of the - Message Service to trigger the transaction._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _nativeToken | address | The address of the token on its native chain. | -| _amount | uint256 | The amount of the token to be received. | -| _recipient | address | The address that will receive the tokens. | -| _chainId | uint256 | The token's origin layer chaindId | -| _tokenMetadata | bytes | Additional data used to deploy the bridged token if it doesn't exist already. | - -### setMessageService - -```solidity -function setMessageService(address _messageService) external -``` - -_Change the address of the Message Service. -SET_MESSAGE_SERVICE_ROLE is required to execute._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageService | address | The address of the new Message Service. | - -### confirmDeployment - -```solidity -function confirmDeployment(address[] _tokens) external payable -``` - -_Change the status to DEPLOYED to the tokens passed in parameter - Will call the method setDeployed on the other chain using the message Service_ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _tokens | address[] | Array of bridged tokens that have been deployed. | - -### setDeployed - -```solidity -function setDeployed(address[] _nativeTokens) external -``` - -_Change the status of tokens to DEPLOYED. New bridge transaction will not - contain token metadata, which save gas. - Can only be called from the Message Service. A user or postman needs to use - the `claimMessage` function of the Message Service to trigger the transaction._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _nativeTokens | address[] | Array of native tokens for which the DEPLOYED status must be set. | - -### setRemoteTokenBridge - -```solidity -function setRemoteTokenBridge(address _remoteTokenBridge) external -``` - -_Sets the address of the remote token bridge. Can only be called once. -SET_REMOTE_TOKENBRIDGE_ROLE is required to execute._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _remoteTokenBridge | address | The address of the remote token bridge to be set. | - -### deployBridgedToken - -```solidity -function deployBridgedToken(address _nativeToken, bytes _tokenMetadata, uint256 _chainId) internal returns (address bridgedTokenAddress) -``` - -_Deploy a new EC20 contract for bridged token using a beacon proxy pattern. - To adapt to future requirements, Linea can update the implementation of - all (existing and future) contracts by updating the beacon. This update is - subject to a delay by a time lock. - Contracts are deployed using CREATE2 so deployment address is deterministic._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _nativeToken | address | The address of the native token on the source chain. | -| _tokenMetadata | bytes | The encoded metadata for the token. | -| _chainId | uint256 | The chain id on which the token will be deployed, used to calculate the salt | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| bridgedTokenAddress | address | The address of the newly deployed BridgedToken contract. | - -### setReserved - -```solidity -function setReserved(address _token) external -``` - -Make sure that _token is native to the current chain - where you are calling this function from - -_Linea can reserve tokens. In this case, the token cannot be bridged. - Linea can only reserve tokens that have not been bridged before. -SET_RESERVED_TOKEN_ROLE is required to execute._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _token | address | The address of the token to be set as reserved. | - -### removeReserved - -```solidity -function removeReserved(address _token) external -``` - -_Removes a token from the reserved list. -REMOVE_RESERVED_TOKEN_ROLE is required to execute._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _token | address | The address of the token to be removed from the reserved list. | - -### setCustomContract - -```solidity -function setCustomContract(address _nativeToken, address _targetContract) external -``` - -_Linea can set a custom ERC20 contract for specific ERC20. - For security purpose, Linea can only call this function if the token has - not been bridged yet. -SET_CUSTOM_CONTRACT_ROLE is required to execute._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _nativeToken | address | The address of the token on the source chain. | -| _targetContract | address | The address of the custom contract. | - -### _safeName - -```solidity -function _safeName(address _token) internal view returns (string tokenName) -``` - -_Provides a safe ERC20.name version which returns 'NO_NAME' as fallback string._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _token | address | The address of the ERC-20 token contract | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| tokenName | string | Returns the string of the token name. | - -### _safeSymbol - -```solidity -function _safeSymbol(address _token) internal view returns (string symbol) -``` - -_Provides a safe ERC20.symbol version which returns 'NO_SYMBOL' as fallback string_ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _token | address | The address of the ERC-20 token contract | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| symbol | string | Returns the string of the symbol. | - -### _safeDecimals - -```solidity -function _safeDecimals(address _token) internal view returns (uint8) -``` - -Provides a safe ERC20.decimals version which reverts when decimals are unknown - Note Tokens with (decimals > 255) are not supported - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _token | address | The address of the ERC-20 token contract | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| [0] | uint8 | Returns the token's decimals value. | - -### _returnDataToString - -```solidity -function _returnDataToString(bytes _data) internal pure returns (string decodedString) -``` - -_Converts returned data to string. Returns 'NOT_VALID_ENCODING' as fallback value._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _data | bytes | returned data. | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| decodedString | string | The decoded string data. | - -### _permit - -```solidity -function _permit(address _token, bytes _permitData) internal -``` - -Call the token permit method of extended ERC20 -Only support tokens implementing ERC-2612 - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _token | address | ERC20 token address | -| _permitData | bytes | Raw data of the call `permit` of the token | - diff --git a/contracts/docs/api/bridging/token/interfaces/ITokenBridge.md b/contracts/docs/api/bridging/token/interfaces/ITokenBridge.md deleted file mode 100644 index 2225d9481..000000000 --- a/contracts/docs/api/bridging/token/interfaces/ITokenBridge.md +++ /dev/null @@ -1,486 +0,0 @@ -# `ITokenBridge` - -### InitializationData - -```solidity -struct InitializationData { - address defaultAdmin; - address messageService; - address tokenBeacon; - uint256 sourceChainId; - uint256 targetChainId; - address[] reservedTokens; - struct IPermissionsManager.RoleAddress[] roleAddresses; - struct IPauseManager.PauseTypeRole[] pauseTypeRoles; - struct IPauseManager.PauseTypeRole[] unpauseTypeRoles; -} -``` - -### TokenReserved - -```solidity -event TokenReserved(address token) -``` - -Emitted when the token address is reserved. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| token | address | The indexed token address. | - -### ReservationRemoved - -```solidity -event ReservationRemoved(address token) -``` - -Emitted when the token address reservation is removed. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| token | address | The indexed token address. | - -### CustomContractSet - -```solidity -event CustomContractSet(address nativeToken, address customContract, address setBy) -``` - -Emitted when the custom token address is set. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| nativeToken | address | The indexed nativeToken token address. | -| customContract | address | The indexed custom contract address. | -| setBy | address | The indexed address of who set the custom contract. | - -### BridgingInitiated - -```solidity -event BridgingInitiated(address sender, address recipient, address token, uint256 amount) -``` - -Emitted when token bridging is initiated. - -_DEPRECATED in favor of BridgingInitiatedV2._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| sender | address | The indexed sender address. | -| recipient | address | The recipient address. | -| token | address | The indexed token address. | -| amount | uint256 | The indexed token amount. | - -### BridgingInitiatedV2 - -```solidity -event BridgingInitiatedV2(address sender, address recipient, address token, uint256 amount) -``` - -Emitted when token bridging is initiated. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| sender | address | The indexed sender address. | -| recipient | address | The indexed recipient address. | -| token | address | The indexed token address. | -| amount | uint256 | The token amount. | - -### BridgingFinalized - -```solidity -event BridgingFinalized(address nativeToken, address bridgedToken, uint256 amount, address recipient) -``` - -Emitted when token bridging is finalized. - -_DEPRECATED in favor of BridgingFinalizedV2._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| nativeToken | address | The indexed native token address. | -| bridgedToken | address | The indexed bridged token address. | -| amount | uint256 | The indexed token amount. | -| recipient | address | The recipient address. | - -### BridgingFinalizedV2 - -```solidity -event BridgingFinalizedV2(address nativeToken, address bridgedToken, uint256 amount, address recipient) -``` - -Emitted when token bridging is finalized. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| nativeToken | address | The indexed native token address. | -| bridgedToken | address | The indexed bridged token address. | -| amount | uint256 | The token amount. | -| recipient | address | The indexed recipient address. | - -### NewToken - -```solidity -event NewToken(address token) -``` - -Emitted when a new token is seen being bridged on the origin chain for the first time. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| token | address | The indexed token address. | - -### NewTokenDeployed - -```solidity -event NewTokenDeployed(address bridgedToken, address nativeToken) -``` - -Emitted when a new token is deployed. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| bridgedToken | address | The indexed bridged token address. | -| nativeToken | address | The indexed native token address. | - -### RemoteTokenBridgeSet - -```solidity -event RemoteTokenBridgeSet(address remoteTokenBridge, address setBy) -``` - -Emitted when the remote token bridge is set. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| remoteTokenBridge | address | The indexed remote token bridge address. | -| setBy | address | The indexed address that set the remote token bridge. | - -### TokenDeployed - -```solidity -event TokenDeployed(address token) -``` - -Emitted when the token is set as deployed. - -_This can be triggered by anyone calling confirmDeployment on the alternate chain._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| token | address | The indexed token address. | - -### DeploymentConfirmed - -```solidity -event DeploymentConfirmed(address[] tokens, address confirmedBy) -``` - -Emitted when the token deployment is confirmed. - -_This can be triggered by anyone provided there is correctly mapped token data._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| tokens | address[] | The token address list. | -| confirmedBy | address | The indexed address confirming deployment. | - -### MessageServiceUpdated - -```solidity -event MessageServiceUpdated(address newMessageService, address oldMessageService, address setBy) -``` - -Emitted when the message service address is set. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| newMessageService | address | The indexed new message service address. | -| oldMessageService | address | The indexed old message service address. | -| setBy | address | The indexed address setting the new message service address. | - -### ReservedToken - -```solidity -error ReservedToken(address token) -``` - -_Thrown when attempting to bridge a reserved token._ - -### RemoteTokenBridgeAlreadySet - -```solidity -error RemoteTokenBridgeAlreadySet(address remoteTokenBridge) -``` - -_Thrown when the remote token bridge is already set._ - -### AlreadyBridgedToken - -```solidity -error AlreadyBridgedToken(address token) -``` - -_Thrown when attempting to reserve an already bridged token._ - -### InvalidPermitData - -```solidity -error InvalidPermitData(bytes4 permitData, bytes4 permitSelector) -``` - -_Thrown when the permit data is invalid._ - -### PermitNotFromSender - -```solidity -error PermitNotFromSender(address owner) -``` - -_Thrown when the permit is not from the sender._ - -### PermitNotAllowingBridge - -```solidity -error PermitNotAllowingBridge(address spender) -``` - -_Thrown when the permit does not grant spending to the bridge._ - -### ZeroAmountNotAllowed - -```solidity -error ZeroAmountNotAllowed(uint256 amount) -``` - -_Thrown when the amount being bridged is zero._ - -### NotReserved - -```solidity -error NotReserved(address token) -``` - -_Thrown when trying to unreserve a non-reserved token._ - -### TokenNotDeployed - -```solidity -error TokenNotDeployed(address token) -``` - -_Thrown when trying to confirm deployment of a non-deployed token._ - -### AlreadyBrigedToNativeTokenSet - -```solidity -error AlreadyBrigedToNativeTokenSet(address token) -``` - -_Thrown when trying to set a custom contract on a bridged token._ - -### NativeToBridgedTokenAlreadySet - -```solidity -error NativeToBridgedTokenAlreadySet(address token) -``` - -_Thrown when trying to set a custom contract on an already set token._ - -### StatusAddressNotAllowed - -```solidity -error StatusAddressNotAllowed(address token) -``` - -_Thrown when trying to set a token that is already either native, deployed or reserved._ - -### DecimalsAreUnknown - -```solidity -error DecimalsAreUnknown(address token) -``` - -_Thrown when the decimals for a token cannot be determined._ - -### TokenListEmpty - -```solidity -error TokenListEmpty() -``` - -_Thrown when the token list is empty._ - -### bridgeTokenWithPermit - -```solidity -function bridgeTokenWithPermit(address _token, uint256 _amount, address _recipient, bytes _permitData) external payable -``` - -Similar to `bridgeToken` function but allows to pass additional - permit data to do the ERC20 approval in a single transaction. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _token | address | The address of the token to be bridged. | -| _amount | uint256 | The amount of the token to be bridged. | -| _recipient | address | The address that will receive the tokens on the other chain. | -| _permitData | bytes | The permit data for the token, if applicable. | - -### completeBridging - -```solidity -function completeBridging(address _nativeToken, uint256 _amount, address _recipient, uint256 _chainId, bytes _tokenMetadata) external -``` - -_It can only be called from the Message Service. To finalize the bridging - process, a user or postmen needs to use the `claimMessage` function of the - Message Service to trigger the transaction._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _nativeToken | address | The address of the token on its native chain. | -| _amount | uint256 | The amount of the token to be received. | -| _recipient | address | The address that will receive the tokens. | -| _chainId | uint256 | The source chainId or target chaindId for this token | -| _tokenMetadata | bytes | Additional data used to deploy the bridged token if it doesn't exist already. | - -### confirmDeployment - -```solidity -function confirmDeployment(address[] _tokens) external payable -``` - -_Change the status to DEPLOYED to the tokens passed in parameter - Will call the method setDeployed on the other chain using the message Service_ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _tokens | address[] | Array of bridged tokens that have been deployed. | - -### setMessageService - -```solidity -function setMessageService(address _messageService) external -``` - -_Change the address of the Message Service._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageService | address | The address of the new Message Service. | - -### setDeployed - -```solidity -function setDeployed(address[] _nativeTokens) external -``` - -_It can only be called from the Message Service. To change the status of - the native tokens to DEPLOYED meaning they have been deployed on the other chain - a user or postman needs to use the `claimMessage` function of the - Message Service to trigger the transaction._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _nativeTokens | address[] | The addresses of the native tokens. | - -### setReserved - -```solidity -function setReserved(address _token) external -``` - -Make sure that _token is native to the current chain - where you are calling this function from - -_Linea can reserve tokens. In this case, the token cannot be bridged. - Linea can only reserve tokens that have not been bridged before._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _token | address | The address of the token to be set as reserved. | - -### setRemoteTokenBridge - -```solidity -function setRemoteTokenBridge(address _remoteTokenBridge) external -``` - -_Sets the address of the remote token bridge. Can only be called once._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _remoteTokenBridge | address | The address of the remote token bridge to be set. | - -### removeReserved - -```solidity -function removeReserved(address _token) external -``` - -_Removes a token from the reserved list._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _token | address | The address of the token to be removed from the reserved list. | - -### setCustomContract - -```solidity -function setCustomContract(address _nativeToken, address _targetContract) external -``` - -_Linea can set a custom ERC20 contract for specific ERC20. - For security purpose, Linea can only call this function if the token has - not been bridged yet._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _nativeToken | address | address of the token on the source chain. | -| _targetContract | address | address of the custom contract. | - diff --git a/contracts/docs/api/governance/TimeLock.md b/contracts/docs/api/governance/TimeLock.md deleted file mode 100644 index 203043933..000000000 --- a/contracts/docs/api/governance/TimeLock.md +++ /dev/null @@ -1,10 +0,0 @@ -# `TimeLock` - -This timelock contract will be the owner of all upgrades that gives users confidence and an ability to exit should they want to before an upgrade takes place - -### constructor - -```solidity -constructor(uint256 minDelay, address[] proposers, address[] executors, address admin) public -``` - diff --git a/contracts/docs/api/messaging/libraries/TimeLock.mdx b/contracts/docs/api/governance/TimeLock.mdx similarity index 100% rename from contracts/docs/api/messaging/libraries/TimeLock.mdx rename to contracts/docs/api/governance/TimeLock.mdx diff --git a/contracts/docs/api/libraries/Mimc.md b/contracts/docs/api/libraries/Mimc.md deleted file mode 100644 index b8dbed1d8..000000000 --- a/contracts/docs/api/libraries/Mimc.md +++ /dev/null @@ -1,46 +0,0 @@ -# `Mimc` - -### DataMissing - -```solidity -error DataMissing() -``` - -Thrown when the data is not provided - -### DataIsNotMod32 - -```solidity -error DataIsNotMod32() -``` - -Thrown when the data is not purely in 32 byte chunks - -### FR_FIELD - -```solidity -uint256 FR_FIELD -``` - -### hash - -```solidity -function hash(bytes _msg) external pure returns (bytes32 mimcHash) -``` - -Performs a MiMC hash on the data provided - -_Only data that has length modulus 32 is hashed, reverts otherwise_ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _msg | bytes | The data to be hashed | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| mimcHash | bytes32 | The computed MiMC hash | - diff --git a/contracts/docs/api/security/pausing/Mimc.mdx b/contracts/docs/api/libraries/Mimc.mdx similarity index 100% rename from contracts/docs/api/security/pausing/Mimc.mdx rename to contracts/docs/api/libraries/Mimc.mdx diff --git a/contracts/docs/api/libraries/SparseMerkleProof.md b/contracts/docs/api/libraries/SparseMerkleProof.md deleted file mode 100644 index 153e344fe..000000000 --- a/contracts/docs/api/libraries/SparseMerkleProof.md +++ /dev/null @@ -1,212 +0,0 @@ -# `SparseMerkleProof` - -### Account - -The Account struct represents the state of the account including the storage root, nonce, balance and codesize - -_This is mapped directly to the output of the storage proof_ - -```solidity -struct Account { - uint64 nonce; - uint256 balance; - bytes32 storageRoot; - bytes32 mimcCodeHash; - bytes32 keccakCodeHash; - uint64 codeSize; -} -``` - -### Leaf - -Represents the leaf structure in both account and storage tries - -_This is mapped directly to the output of the storage proof_ - -```solidity -struct Leaf { - uint256 prev; - uint256 next; - bytes32 hKey; - bytes32 hValue; -} -``` - -### WrongBytesLength - -```solidity -error WrongBytesLength(uint256 expectedLength, uint256 bytesLength) -``` - -Thrown when expected bytes length is incorrect - -### LengthNotMod32 - -```solidity -error LengthNotMod32() -``` - -Thrown when the length of bytes is not in exactly 32 byte chunks - -### MaxTreeLeafIndexExceed - -```solidity -error MaxTreeLeafIndexExceed() -``` - -Thrown when the leaf index is higher than the tree depth - -### WrongProofLength - -```solidity -error WrongProofLength(uint256 expectedLength, uint256 actualLength) -``` - -Thrown when the length of the unformatted proof is not provided exactly as expected (UNFORMATTED_PROOF_LENGTH) - -### TREE_DEPTH - -```solidity -uint256 TREE_DEPTH -``` - -### UNFORMATTED_PROOF_LENGTH - -```solidity -uint256 UNFORMATTED_PROOF_LENGTH -``` - -### ZERO_HASH - -```solidity -bytes32 ZERO_HASH -``` - -### MAX_TREE_LEAF_INDEX - -```solidity -uint256 MAX_TREE_LEAF_INDEX -``` - -### verifyProof - -```solidity -function verifyProof(bytes[] _rawProof, uint256 _leafIndex, bytes32 _root) external pure returns (bool) -``` - -Formats input, computes root and returns true if it matches the provided merkle root - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _rawProof | bytes[] | Raw sparse merkle tree proof | -| _leafIndex | uint256 | Index of the leaf | -| _root | bytes32 | Sparse merkle root | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| [0] | bool | If the computed merkle root matches the provided one | - -### mimcHash - -```solidity -function mimcHash(bytes _input) external pure returns (bytes32) -``` - -Hash a value using MIMC hash - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _input | bytes | Value to hash | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| [0] | bytes32 | bytes32 Mimc hash | - -### getLeaf - -```solidity -function getLeaf(bytes _encodedLeaf) external pure returns (struct SparseMerkleProof.Leaf) -``` - -Get leaf - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _encodedLeaf | bytes | Encoded leaf bytes (prev, next, hKey, hValue) | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| [0] | struct SparseMerkleProof.Leaf | Leaf Formatted leaf struct | - -### getAccount - -```solidity -function getAccount(bytes _encodedAccountValue) external pure returns (struct SparseMerkleProof.Account) -``` - -Get account - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _encodedAccountValue | bytes | Encoded account value bytes (nonce, balance, storageRoot, mimcCodeHash, keccakCodeHash, codeSize) | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| [0] | struct SparseMerkleProof.Account | Account Formatted account struct | - -### hashAccountValue - -```solidity -function hashAccountValue(bytes _value) external pure returns (bytes32) -``` - -Hash account value - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _value | bytes | Encoded account value bytes (nonce, balance, storageRoot, mimcCodeHash, keccakCodeHash, codeSize) | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| [0] | bytes32 | bytes32 Account value hash | - -### hashStorageValue - -```solidity -function hashStorageValue(bytes32 _value) external pure returns (bytes32) -``` - -Hash storage value - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _value | bytes32 | Encoded storage value bytes | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| [0] | bytes32 | bytes32 Storage value hash | - diff --git a/contracts/docs/api/security/pausing/SparseMerkleProof.mdx b/contracts/docs/api/libraries/SparseMerkleProof.mdx similarity index 100% rename from contracts/docs/api/security/pausing/SparseMerkleProof.mdx rename to contracts/docs/api/libraries/SparseMerkleProof.mdx diff --git a/contracts/docs/api/libraries/TransientStorageHelpers.md b/contracts/docs/api/libraries/TransientStorageHelpers.md deleted file mode 100644 index 68f4f4c9c..000000000 --- a/contracts/docs/api/libraries/TransientStorageHelpers.md +++ /dev/null @@ -1,72 +0,0 @@ -# `TransientStorageHelpers` - -### tstoreUint256 - -```solidity -function tstoreUint256(bytes32 _key, uint256 _value) internal -``` - -Internal function that stores a uint256 value at a given key in the EVM's transient storage using the `tstore` opcode. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _key | bytes32 | The key in the EVM transient storage where the value should be stored. | -| _value | uint256 | The uint256 value to be stored at the specified key in the EVM transient storage. | - -### tloadUint256 - -```solidity -function tloadUint256(bytes32 _key) internal view returns (uint256 value) -``` - -Internal function that retrieves a uint256 value from the EVM's transient storage using the `tload` opcode. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _key | bytes32 | The key in the EVM transient storage from which the value should be retrieved. | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| value | uint256 | The uint256 value retrieved from the specified key in the EVM transient storage. | - -### tstoreAddress - -```solidity -function tstoreAddress(bytes32 _key, address _addr) internal -``` - -Internal function that stores an address at a given key in the EVM's transient storage using the `tstore` opcode. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _key | bytes32 | The key in the EVM transient storage where the value should be stored. | -| _addr | address | The address to be stored at the specified key in the EVM transient storage. | - -### tloadAddress - -```solidity -function tloadAddress(bytes32 _key) internal view returns (address addr) -``` - -Internal function that retrieves an address from the EVM's transient storage using the `tload` opcode. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _key | bytes32 | The key in the EVM transient storage from which the value should be retrieved. | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| addr | address | The address retrieved from the specified key in the EVM transient storage. | - diff --git a/contracts/docs/api/messaging/libraries/TransientStorageHelpers.mdx b/contracts/docs/api/libraries/TransientStorageHelpers.mdx similarity index 100% rename from contracts/docs/api/messaging/libraries/TransientStorageHelpers.mdx rename to contracts/docs/api/libraries/TransientStorageHelpers.mdx diff --git a/contracts/docs/api/libraries/Utils.md b/contracts/docs/api/libraries/Utils.md deleted file mode 100644 index 029dd3dab..000000000 --- a/contracts/docs/api/libraries/Utils.md +++ /dev/null @@ -1,32 +0,0 @@ -# `Utils` - -### _efficientKeccak - -```solidity -function _efficientKeccak(bytes32 _left, bytes32 _right) internal pure returns (bytes32 value) -``` - -Performs a gas optimized keccak hash for two bytes32 values. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _left | bytes32 | Left value. | -| _right | bytes32 | Right value. | - -### _efficientKeccak - -```solidity -function _efficientKeccak(uint256 _left, address _right) internal pure returns (bytes32 value) -``` - -Performs a gas optimized keccak hash for uint256 and address. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _left | uint256 | Left value. | -| _right | address | Right value. | - diff --git a/contracts/docs/api/security/pausing/Utils.mdx b/contracts/docs/api/libraries/Utils.mdx similarity index 100% rename from contracts/docs/api/security/pausing/Utils.mdx rename to contracts/docs/api/libraries/Utils.mdx diff --git a/contracts/docs/api/messaging/MessageServiceBase.md b/contracts/docs/api/messaging/MessageServiceBase.md deleted file mode 100644 index 54ba690d8..000000000 --- a/contracts/docs/api/messaging/MessageServiceBase.md +++ /dev/null @@ -1,105 +0,0 @@ -# `MessageServiceBase` - -### messageService - -```solidity -contract IMessageService messageService -``` - -The message service address on the current chain. - -### remoteSender - -```solidity -address remoteSender -``` - -The token bridge on the alternate/remote chain. - -### RemoteSenderSet - -```solidity -event RemoteSenderSet(address remoteSender, address setter) -``` - -_Event emitted when the remote sender is set._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| remoteSender | address | The address of the new remote sender. | -| setter | address | The address of the account that set the remote sender. | - -### CallerIsNotMessageService - -```solidity -error CallerIsNotMessageService() -``` - -_Thrown when the caller address is not the message service address_ - -### SenderNotAuthorized - -```solidity -error SenderNotAuthorized() -``` - -_Thrown when remote sender address is not authorized._ - -### onlyMessagingService - -```solidity -modifier onlyMessagingService() -``` - -_Modifier to make sure the caller is the known message service. - -Requirements: - -- The msg.sender must be the message service._ - -### onlyAuthorizedRemoteSender - -```solidity -modifier onlyAuthorizedRemoteSender() -``` - -_Modifier to make sure the original sender is allowed. - -Requirements: - -- The original message sender via the message service must be a known sender._ - -### __MessageServiceBase_init - -```solidity -function __MessageServiceBase_init(address _messageService) internal -``` - -Initializes the message service - -_Must be initialized in the initialize function of the main contract or constructor._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageService | address | The message service address, cannot be empty. | - -### _setRemoteSender - -```solidity -function _setRemoteSender(address _remoteSender) internal -``` - -Sets the remote sender - -_This function sets the remote sender address and emits the RemoteSenderSet event._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _remoteSender | address | The authorized remote sender address, cannot be empty. | - diff --git a/contracts/docs/api/messaging/interfaces/IMessageService.md b/contracts/docs/api/messaging/interfaces/IMessageService.md deleted file mode 100644 index 02a03fde7..000000000 --- a/contracts/docs/api/messaging/interfaces/IMessageService.md +++ /dev/null @@ -1,126 +0,0 @@ -# `IMessageService` - -### MessageSent - -```solidity -event MessageSent(address _from, address _to, uint256 _fee, uint256 _value, uint256 _nonce, bytes _calldata, bytes32 _messageHash) -``` - -Emitted when a message is sent. - -__calldata has the _ because calldata is a reserved word. -We include the message hash to save hashing costs on the rollup. -This event is used on both L1 and L2._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _from | address | The indexed sender address of the message (msg.sender). | -| _to | address | The indexed intended recipient address of the message on the other layer. | -| _fee | uint256 | The fee being being paid to deliver the message to the recipient in Wei. | -| _value | uint256 | The value being sent to the recipient in Wei. | -| _nonce | uint256 | The unique message number. | -| _calldata | bytes | The calldata being passed to the intended recipient when being called on claiming. | -| _messageHash | bytes32 | The indexed hash of the message parameters. | - -### MessageClaimed - -```solidity -event MessageClaimed(bytes32 _messageHash) -``` - -Emitted when a message is claimed. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageHash | bytes32 | The indexed hash of the message that was claimed. | - -### FeeTooLow - -```solidity -error FeeTooLow() -``` - -_Thrown when fees are lower than the minimum fee._ - -### ValueSentTooLow - -```solidity -error ValueSentTooLow() -``` - -_Thrown when the value sent is less than the fee. -Value to forward on is msg.value - _fee._ - -### MessageSendingFailed - -```solidity -error MessageSendingFailed(address destination) -``` - -_Thrown when the destination address reverts._ - -### FeePaymentFailed - -```solidity -error FeePaymentFailed(address recipient) -``` - -_Thrown when the recipient address reverts._ - -### sendMessage - -```solidity -function sendMessage(address _to, uint256 _fee, bytes _calldata) external payable -``` - -Sends a message for transporting from the given chain. - -_This function should be called with a msg.value = _value + _fee. The fee will be paid on the destination chain._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _to | address | The destination address on the destination chain. | -| _fee | uint256 | The message service fee on the origin chain. | -| _calldata | bytes | The calldata used by the destination message service to call the destination contract. | - -### claimMessage - -```solidity -function claimMessage(address _from, address _to, uint256 _fee, uint256 _value, address payable _feeRecipient, bytes _calldata, uint256 _nonce) external -``` - -Deliver a message to the destination chain. -Is called by the Postman, dApp or end user. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _from | address | The msg.sender calling the origin message service. | -| _to | address | The destination address on the destination chain. | -| _fee | uint256 | The message service fee on the origin chain. | -| _value | uint256 | The value to be transferred to the destination address. | -| _feeRecipient | address payable | Address that will receive the fees. | -| _calldata | bytes | The calldata used by the destination message service to call/forward to the destination contract. | -| _nonce | uint256 | Unique message number. | - -### sender - -```solidity -function sender() external view returns (address originalSender) -``` - -Returns the original sender of the message on the origin layer. - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| originalSender | address | The original sender of the message on the origin layer. | - diff --git a/contracts/docs/api/interfaces/IMessageService.mdx b/contracts/docs/api/messaging/interfaces/IMessageService.mdx similarity index 100% rename from contracts/docs/api/interfaces/IMessageService.mdx rename to contracts/docs/api/messaging/interfaces/IMessageService.mdx diff --git a/contracts/docs/api/messaging/l1/L1MessageManager.md b/contracts/docs/api/messaging/l1/L1MessageManager.md deleted file mode 100644 index fb5f87c8b..000000000 --- a/contracts/docs/api/messaging/l1/L1MessageManager.md +++ /dev/null @@ -1,111 +0,0 @@ -# `L1MessageManager` - -### rollingHashes - -```solidity -mapping(uint256 => bytes32) rollingHashes -``` - -Contains the L1 to L2 messaging rolling hashes mapped to message number computed on L1. - -### _messageClaimedBitMap - -```solidity -struct BitMaps.BitMap _messageClaimedBitMap -``` - -This maps which message numbers have been claimed to prevent duplicate claiming. - -### l2MerkleRootsDepths - -```solidity -mapping(bytes32 => uint256) l2MerkleRootsDepths -``` - -Contains the L2 messages Merkle roots mapped to their tree depth. - -### _addRollingHash - -```solidity -function _addRollingHash(uint256 _messageNumber, bytes32 _messageHash) internal -``` - -Take an existing message hash, calculates the rolling hash and stores at the message number. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageNumber | uint256 | The current message number being sent. | -| _messageHash | bytes32 | The hash of the message being sent. | - -### _setL2L1MessageToClaimed - -```solidity -function _setL2L1MessageToClaimed(uint256 _messageNumber) internal -``` - -Set the L2->L1 message as claimed when a user claims a message on L1. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageNumber | uint256 | The message number on L2. | - -### _addL2MerkleRoots - -```solidity -function _addL2MerkleRoots(bytes32[] _newRoots, uint256 _treeDepth) internal -``` - -Add the L2 Merkle roots to the storage. - -_This function is called during block finalization. -The _treeDepth does not need to be checked to be non-zero as it is, -already enforced to be non-zero in the circuit, and used in the proof's public input._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _newRoots | bytes32[] | New L2 Merkle roots. | -| _treeDepth | uint256 | | - -### _anchorL2MessagingBlocks - -```solidity -function _anchorL2MessagingBlocks(bytes _l2MessagingBlocksOffsets, uint256 _currentL2BlockNumber) internal -``` - -Emit an event for each L2 block containing L2->L1 messages. - -_This function is called during block finalization._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _l2MessagingBlocksOffsets | bytes | Is a sequence of uint16 values, where each value plus the last finalized L2 block number. indicates which L2 blocks have L2->L1 messages. | -| _currentL2BlockNumber | uint256 | Last L2 block number finalized on L1. | - -### isMessageClaimed - -```solidity -function isMessageClaimed(uint256 _messageNumber) external view returns (bool isClaimed) -``` - -Checks if the L2->L1 message is claimed or not. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageNumber | uint256 | The message number on L2. | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| isClaimed | bool | Returns whether or not the message with _messageNumber has been claimed. | - diff --git a/contracts/docs/api/messaging/l1/L1MessageService.md b/contracts/docs/api/messaging/l1/L1MessageService.md deleted file mode 100644 index ddc8fdca6..000000000 --- a/contracts/docs/api/messaging/l1/L1MessageService.md +++ /dev/null @@ -1,77 +0,0 @@ -# `L1MessageService` - -### systemMigrationBlock - -```solidity -uint256 systemMigrationBlock -``` - -_This is currently not in use, but is reserved for future upgrades._ - -### __MessageService_init - -```solidity -function __MessageService_init(uint256 _rateLimitPeriod, uint256 _rateLimitAmount) internal -``` - -Initialises underlying message service dependencies. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _rateLimitPeriod | uint256 | The period to rate limit against. | -| _rateLimitAmount | uint256 | The limit allowed for withdrawing the period. | - -### sendMessage - -```solidity -function sendMessage(address _to, uint256 _fee, bytes _calldata) external payable -``` - -Adds a message for sending cross-chain and emits MessageSent. - -_The message number is preset (nextMessageNumber) and only incremented at the end if successful for the next caller. -This function should be called with a msg.value = _value + _fee. The fee will be paid on the destination chain._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _to | address | The address the message is intended for. | -| _fee | uint256 | The fee being paid for the message delivery. | -| _calldata | bytes | The calldata to pass to the recipient. | - -### claimMessageWithProof - -```solidity -function claimMessageWithProof(struct IL1MessageService.ClaimMessageWithProofParams _params) external -``` - -Claims and delivers a cross-chain message using a Merkle proof. - -_if tree depth is empty, it will revert with L2MerkleRootDoesNotExist. -if tree depth is different than proof size, it will revert with ProofLengthDifferentThanMerkleDepth._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _params | struct IL1MessageService.ClaimMessageWithProofParams | Collection of claim data with proof and supporting data. | - -### sender - -```solidity -function sender() external view returns (address originalSender) -``` - -Claims and delivers a cross-chain message. - -_The message sender address is set temporarily in the transient storage when claiming._ - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| originalSender | address | The message sender address that is stored temporarily in the transient storage when claiming. | - diff --git a/contracts/docs/api/messaging/l1/interfaces/IL1MessageManager.md b/contracts/docs/api/messaging/l1/interfaces/IL1MessageManager.md deleted file mode 100644 index 04fc8935d..000000000 --- a/contracts/docs/api/messaging/l1/interfaces/IL1MessageManager.md +++ /dev/null @@ -1,95 +0,0 @@ -# `IL1MessageManager` - -### RollingHashUpdated - -```solidity -event RollingHashUpdated(uint256 messageNumber, bytes32 rollingHash, bytes32 messageHash) -``` - -Emitted when a new message is sent and the rolling hash updated. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| messageNumber | uint256 | The unique indexed message number for the message. | -| rollingHash | bytes32 | The indexed rolling hash computed for the current message number. | -| messageHash | bytes32 | The indexed hash of the message parameters. | - -### L2MerkleRootAdded - -```solidity -event L2MerkleRootAdded(bytes32 l2MerkleRoot, uint256 treeDepth) -``` - -Emitted when the L2 Merkle root has been anchored on L1. - -_There may be more than one of these in a finalization depending on the amount of L2->L1 messages in the finalization._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| l2MerkleRoot | bytes32 | The indexed L2 Merkle root that has been anchored on L1 Ethereum. | -| treeDepth | uint256 | The indexed tree depth of the Merkle root. | - -### L2MessagingBlockAnchored - -```solidity -event L2MessagingBlockAnchored(uint256 l2Block) -``` - -Emitted when the L2 block contains L2 messages during finalization. - -_This is used externally in the logic for determining which messages belong to which Merkle root when claiming._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| l2Block | uint256 | The indexed L2 block containing L2 to L1 messages. | - -### MessageAlreadyClaimed - -```solidity -error MessageAlreadyClaimed(uint256 messageIndex) -``` - -_Thrown when the message has already been claimed._ - -### L2MerkleRootAlreadyAnchored - -```solidity -error L2MerkleRootAlreadyAnchored(bytes32 merkleRoot) -``` - -_Thrown when the L2 Merkle root has already been anchored on L1._ - -### BytesLengthNotMultipleOfTwo - -```solidity -error BytesLengthNotMultipleOfTwo(uint256 bytesLength) -``` - -_Thrown when the L2 messaging blocks offsets bytes length is not a multiple of 2._ - -### isMessageClaimed - -```solidity -function isMessageClaimed(uint256 _messageNumber) external view returns (bool isClaimed) -``` - -Checks if the L2->L1 message is claimed or not. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageNumber | uint256 | The message number on L2. | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| isClaimed | bool | Returns whether or not the message with _messageNumber has been claimed. | - diff --git a/contracts/docs/api/interfaces/l1/IL1MessageManager.mdx b/contracts/docs/api/messaging/l1/interfaces/IL1MessageManager.mdx similarity index 100% rename from contracts/docs/api/interfaces/l1/IL1MessageManager.mdx rename to contracts/docs/api/messaging/l1/interfaces/IL1MessageManager.mdx diff --git a/contracts/docs/api/messaging/l1/interfaces/IL1MessageService.md b/contracts/docs/api/messaging/l1/interfaces/IL1MessageService.md deleted file mode 100644 index 7fad8aed2..000000000 --- a/contracts/docs/api/messaging/l1/interfaces/IL1MessageService.md +++ /dev/null @@ -1,65 +0,0 @@ -# `IL1MessageService` - -### ClaimMessageWithProofParams - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | - -```solidity -struct ClaimMessageWithProofParams { - bytes32[] proof; - uint256 messageNumber; - uint32 leafIndex; - address from; - address to; - uint256 fee; - uint256 value; - address payable feeRecipient; - bytes32 merkleRoot; - bytes data; -} -``` - -### L2MerkleRootDoesNotExist - -```solidity -error L2MerkleRootDoesNotExist() -``` - -_Thrown when L2 Merkle root does not exist._ - -### InvalidMerkleProof - -```solidity -error InvalidMerkleProof() -``` - -_Thrown when the Merkle proof is invalid._ - -### ProofLengthDifferentThanMerkleDepth - -```solidity -error ProofLengthDifferentThanMerkleDepth(uint256 actual, uint256 expected) -``` - -_Thrown when Merkle depth doesn't match proof length._ - -### claimMessageWithProof - -```solidity -function claimMessageWithProof(struct IL1MessageService.ClaimMessageWithProofParams _params) external -``` - -Claims and delivers a cross-chain message using a Merkle proof. - -_if tree depth is empty, it will revert with L2MerkleRootDoesNotExist. -if tree depth is different than proof size, it will revert with ProofLengthDifferentThanMerkleDepth._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _params | struct IL1MessageService.ClaimMessageWithProofParams | Collection of claim data with proof and supporting data. | - diff --git a/contracts/docs/api/interfaces/l1/IL1MessageService.mdx b/contracts/docs/api/messaging/l1/interfaces/IL1MessageService.mdx similarity index 100% rename from contracts/docs/api/interfaces/l1/IL1MessageService.mdx rename to contracts/docs/api/messaging/l1/interfaces/IL1MessageService.mdx diff --git a/contracts/docs/api/messaging/l1/v1/L1MessageManagerV1.md b/contracts/docs/api/messaging/l1/v1/L1MessageManagerV1.md deleted file mode 100644 index 38aa292d1..000000000 --- a/contracts/docs/api/messaging/l1/v1/L1MessageManagerV1.md +++ /dev/null @@ -1,71 +0,0 @@ -# `L1MessageManagerV1` - -### INBOX_STATUS_UNKNOWN - -```solidity -uint8 INBOX_STATUS_UNKNOWN -``` - -The 2 legacy status constants for message statuses. - -### INBOX_STATUS_RECEIVED - -```solidity -uint8 INBOX_STATUS_RECEIVED -``` - -### OUTBOX_STATUS_UNKNOWN - -```solidity -uint8 OUTBOX_STATUS_UNKNOWN -``` - -The 3 legacy status constants for message statuses. - -### OUTBOX_STATUS_SENT - -```solidity -uint8 OUTBOX_STATUS_SENT -``` - -### OUTBOX_STATUS_RECEIVED - -```solidity -uint8 OUTBOX_STATUS_RECEIVED -``` - -### outboxL1L2MessageStatus - -```solidity -mapping(bytes32 => uint256) outboxL1L2MessageStatus -``` - -_DEPRECATED in favor of the rollingHashes mapping on the L1MessageManager for L1 to L2 messaging._ - -### inboxL2L1MessageStatus - -```solidity -mapping(bytes32 => uint256) inboxL2L1MessageStatus -``` - -_Mapping to store L2->L1 message hashes status. -messageHash => messageStatus (0: unknown, 1: received). -For the most part this has been deprecated. This is only used for messages received pre-AlphaV2._ - -### _updateL2L1MessageStatusToClaimed - -```solidity -function _updateL2L1MessageStatusToClaimed(bytes32 _messageHash) internal -``` - -Update the status of L2->L1 message when a user claims a message on L1. - -_The L2->L1 message is removed from storage. -Due to the nature of the rollup, we should not get a second entry of this._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageHash | bytes32 | Hash of the message. | - diff --git a/contracts/docs/api/messaging/l1/v1/L1MessageServiceV1.md b/contracts/docs/api/messaging/l1/v1/L1MessageServiceV1.md deleted file mode 100644 index f8e985305..000000000 --- a/contracts/docs/api/messaging/l1/v1/L1MessageServiceV1.md +++ /dev/null @@ -1,81 +0,0 @@ -# `L1MessageServiceV1` - -### nextMessageNumber - -```solidity -uint256 nextMessageNumber -``` - -### _messageSender - -```solidity -address _messageSender -``` - -_DEPRECATED in favor of new transient storage with `MESSAGE_SENDER_TRANSIENT_KEY` key._ - -### REFUND_OVERHEAD_IN_GAS - -```solidity -uint256 REFUND_OVERHEAD_IN_GAS -``` - -_adding these should not affect storage as they are constants and are stored in bytecode._ - -### MESSAGE_SENDER_TRANSIENT_KEY - -```solidity -bytes32 MESSAGE_SENDER_TRANSIENT_KEY -``` - -_The transient storage key to set the message sender against while claiming._ - -### DEFAULT_MESSAGE_SENDER_TRANSIENT_VALUE - -```solidity -address DEFAULT_MESSAGE_SENDER_TRANSIENT_VALUE -``` - -The default value for the message sender reset to post claiming using the MESSAGE_SENDER_TRANSIENT_KEY. - -### distributeFees - -```solidity -modifier distributeFees(uint256 _feeInWei, address _to, bytes _calldata, address _feeRecipient) -``` - -The unspent fee is refunded if applicable. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _feeInWei | uint256 | The fee paid for delivery in Wei. | -| _to | address | The recipient of the message and gas refund. | -| _calldata | bytes | The calldata of the message. | -| _feeRecipient | address | | - -### claimMessage - -```solidity -function claimMessage(address _from, address _to, uint256 _fee, uint256 _value, address payable _feeRecipient, bytes _calldata, uint256 _nonce) external -``` - -Claims and delivers a cross-chain message. - -__feeRecipient can be set to address(0) to receive as msg.sender. -The original message sender address is temporarily set in transient storage, -while claiming. This address is used in sender()._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _from | address | The address of the original sender. | -| _to | address | The address the message is intended for. | -| _fee | uint256 | The fee being paid for the message delivery. | -| _value | uint256 | The value to be transferred to the destination address. | -| _feeRecipient | address payable | The recipient for the fee. | -| _calldata | bytes | The calldata to pass to the recipient. | -| _nonce | uint256 | The unique auto generated nonce used when sending the message. | - diff --git a/contracts/docs/api/messaging/l1/v1/interfaces/IL1MessageManagerV1.md b/contracts/docs/api/messaging/l1/v1/interfaces/IL1MessageManagerV1.md deleted file mode 100644 index b9b0495be..000000000 --- a/contracts/docs/api/messaging/l1/v1/interfaces/IL1MessageManagerV1.md +++ /dev/null @@ -1,10 +0,0 @@ -# `IL1MessageManagerV1` - -### MessageDoesNotExistOrHasAlreadyBeenClaimed - -```solidity -error MessageDoesNotExistOrHasAlreadyBeenClaimed(bytes32 messageHash) -``` - -_Thrown when the message has already been claimed._ - diff --git a/contracts/docs/api/interfaces/l1/IL1MessageManagerV1.mdx b/contracts/docs/api/messaging/l1/v1/interfaces/IL1MessageManagerV1.mdx similarity index 100% rename from contracts/docs/api/interfaces/l1/IL1MessageManagerV1.mdx rename to contracts/docs/api/messaging/l1/v1/interfaces/IL1MessageManagerV1.mdx diff --git a/contracts/docs/api/messaging/l2/L2MessageManager.md b/contracts/docs/api/messaging/l2/L2MessageManager.md deleted file mode 100644 index d364fbd45..000000000 --- a/contracts/docs/api/messaging/l2/L2MessageManager.md +++ /dev/null @@ -1,48 +0,0 @@ -# `L2MessageManager` - -### L1_L2_MESSAGE_SETTER_ROLE - -```solidity -bytes32 L1_L2_MESSAGE_SETTER_ROLE -``` - -The role required to anchor L1 to L2 message hashes. - -### lastAnchoredL1MessageNumber - -```solidity -uint256 lastAnchoredL1MessageNumber -``` - -Contains the last L1 message number anchored on L2. - -### l1RollingHashes - -```solidity -mapping(uint256 => bytes32) l1RollingHashes -``` - -Contains the L1 to L2 messaging rolling hashes mapped to message number computed on L2. - -### anchorL1L2MessageHashes - -```solidity -function anchorL1L2MessageHashes(bytes32[] _messageHashes, uint256 _startingMessageNumber, uint256 _finalMessageNumber, bytes32 _finalRollingHash) external -``` - -Add cross-chain L1->L2 message hashes in storage. - -_Only address that has the role 'L1_L2_MESSAGE_SETTER_ROLE' are allowed to call this function. -NB: In the unlikely event of a duplicate anchoring, the lastAnchoredL1MessageNumber MUST NOT be incremented. -and the rolling hash not calculated, else synchronisation will break. -If starting number is zero, an underflow error is expected._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageHashes | bytes32[] | New message hashes to anchor on L2. | -| _startingMessageNumber | uint256 | The expected L1 message number to start when anchoring. | -| _finalMessageNumber | uint256 | The expected L1 message number to end on when anchoring. | -| _finalRollingHash | bytes32 | The expected L1 rolling hash to end on when anchoring. | - diff --git a/contracts/docs/api/messaging/l2/L2MessageService.md b/contracts/docs/api/messaging/l2/L2MessageService.md deleted file mode 100644 index d83edaf55..000000000 --- a/contracts/docs/api/messaging/l2/L2MessageService.md +++ /dev/null @@ -1,53 +0,0 @@ -# `L2MessageService` - -### CONTRACT_VERSION - -```solidity -string CONTRACT_VERSION -``` - -_This is the ABI version and not the reinitialize version._ - -### constructor - -```solidity -constructor() public -``` - -### initialize - -```solidity -function initialize(uint256 _rateLimitPeriod, uint256 _rateLimitAmount, address _defaultAdmin, struct IPermissionsManager.RoleAddress[] _roleAddresses, struct IPauseManager.PauseTypeRole[] _pauseTypeRoles, struct IPauseManager.PauseTypeRole[] _unpauseTypeRoles) external -``` - -Initializes underlying message service dependencies. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _rateLimitPeriod | uint256 | The period to rate limit against. | -| _rateLimitAmount | uint256 | The limit allowed for withdrawing the period. | -| _defaultAdmin | address | The account to be given DEFAULT_ADMIN_ROLE on initialization. | -| _roleAddresses | struct IPermissionsManager.RoleAddress[] | The list of addresses to grant roles to. | -| _pauseTypeRoles | struct IPauseManager.PauseTypeRole[] | The list of pause type roles. | -| _unpauseTypeRoles | struct IPauseManager.PauseTypeRole[] | The list of unpause type roles. | - -### reinitializePauseTypesAndPermissions - -```solidity -function reinitializePauseTypesAndPermissions(struct IPermissionsManager.RoleAddress[] _roleAddresses, struct IPauseManager.PauseTypeRole[] _pauseTypeRoles, struct IPauseManager.PauseTypeRole[] _unpauseTypeRoles) external -``` - -Sets permissions for a list of addresses and their roles as well as initialises the PauseManager pauseType:role mappings. - -_This function is a reinitializer and can only be called once per version. Should be called using an upgradeAndCall transaction to the ProxyAdmin._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _roleAddresses | struct IPermissionsManager.RoleAddress[] | The list of addresses and roles to assign permissions to. | -| _pauseTypeRoles | struct IPauseManager.PauseTypeRole[] | The list of pause types to associate with roles. | -| _unpauseTypeRoles | struct IPauseManager.PauseTypeRole[] | The list of unpause types to associate with roles. | - diff --git a/contracts/docs/api/messaging/l2/interfaces/IL2MessageManager.md b/contracts/docs/api/messaging/l2/interfaces/IL2MessageManager.md deleted file mode 100644 index 341cf725d..000000000 --- a/contracts/docs/api/messaging/l2/interfaces/IL2MessageManager.md +++ /dev/null @@ -1,89 +0,0 @@ -# `IL2MessageManager` - -### RollingHashUpdated - -```solidity -event RollingHashUpdated(uint256 messageNumber, bytes32 rollingHash) -``` - -Emitted after all messages are anchored on L2 and the latest message index and rolling hash stored. - -_NB: This event is used to provide data to the rollup. The last messageNumber and rollingHash, -emitted in a rollup will be used in the public input for validating the L1->L2 messaging state transition._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| messageNumber | uint256 | The indexed unique L1 computed indexed message number for the message. | -| rollingHash | bytes32 | The indexed L1 rolling hash computed for the current message number. | - -### ServiceVersionMigrated - -```solidity -event ServiceVersionMigrated(uint256 version) -``` - -_Emitted when the service switches over to a new version. -This is currently not in use, but left for existing consumers._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| version | uint256 | The indexed version. | - -### MessageHashesListLengthIsZero - -```solidity -error MessageHashesListLengthIsZero() -``` - -_Reverts when the message hashes array length is zero._ - -### L1MessageNumberSynchronizationWrong - -```solidity -error L1MessageNumberSynchronizationWrong(uint256 expected, uint256 found) -``` - -_Reverts when message number synchronization is mismatched._ - -### L1RollingHashSynchronizationWrong - -```solidity -error L1RollingHashSynchronizationWrong(bytes32 expected, bytes32 found) -``` - -_Reverts when rolling hash synchronization is mismatched._ - -### FinalRollingHashIsZero - -```solidity -error FinalRollingHashIsZero() -``` - -_Reverts when final rolling hash is zero hash._ - -### anchorL1L2MessageHashes - -```solidity -function anchorL1L2MessageHashes(bytes32[] _messageHashes, uint256 _startingMessageNumber, uint256 _finalMessageNumber, bytes32 _finalRollingHash) external -``` - -Add cross-chain L1->L2 message hashes in storage. - -_Only address that has the role 'L1_L2_MESSAGE_SETTER_ROLE' are allowed to call this function. -NB: In the unlikely event of a duplicate anchoring, the lastAnchoredL1MessageNumber MUST NOT be incremented. -and the rolling hash not calculated, else synchronisation will break. -If starting number is zero, an underflow error is expected._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageHashes | bytes32[] | New message hashes to anchor on L2. | -| _startingMessageNumber | uint256 | The expected L1 message number to start when anchoring. | -| _finalMessageNumber | uint256 | The expected L1 message number to end on when anchoring. | -| _finalRollingHash | bytes32 | The expected L1 rolling hash to end on when anchoring. | - diff --git a/contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageManager.mdx b/contracts/docs/api/messaging/l2/interfaces/IL2MessageManager.mdx similarity index 100% rename from contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageManager.mdx rename to contracts/docs/api/messaging/l2/interfaces/IL2MessageManager.mdx diff --git a/contracts/docs/api/messaging/l2/v1/L2MessageManagerV1.md b/contracts/docs/api/messaging/l2/v1/L2MessageManagerV1.md deleted file mode 100644 index cd9b595ad..000000000 --- a/contracts/docs/api/messaging/l2/v1/L2MessageManagerV1.md +++ /dev/null @@ -1,45 +0,0 @@ -# `L2MessageManagerV1` - -### INBOX_STATUS_UNKNOWN - -```solidity -uint8 INBOX_STATUS_UNKNOWN -``` - -The 3 status constants for L1 to L2 message statuses. - -### INBOX_STATUS_RECEIVED - -```solidity -uint8 INBOX_STATUS_RECEIVED -``` - -### INBOX_STATUS_CLAIMED - -```solidity -uint8 INBOX_STATUS_CLAIMED -``` - -### inboxL1L2MessageStatus - -```solidity -mapping(bytes32 => uint256) inboxL1L2MessageStatus -``` - -_Mapping to store L1->L2 message hashes status. -messageHash => messageStatus (0: unknown, 1: received, 2: claimed)._ - -### _updateL1L2MessageStatusToClaimed - -```solidity -function _updateL1L2MessageStatusToClaimed(bytes32 _messageHash) internal -``` - -Update the status of L1->L2 message when a user claims a message on L2. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageHash | bytes32 | Hash of the message. | - diff --git a/contracts/docs/api/messaging/l2/v1/L2MessageServiceV1.md b/contracts/docs/api/messaging/l2/v1/L2MessageServiceV1.md deleted file mode 100644 index bda39c206..000000000 --- a/contracts/docs/api/messaging/l2/v1/L2MessageServiceV1.md +++ /dev/null @@ -1,138 +0,0 @@ -# `L2MessageServiceV1` - -### MINIMUM_FEE_SETTER_ROLE - -```solidity -bytes32 MINIMUM_FEE_SETTER_ROLE -``` - -The role required to set the minimum DDOS fee. - -### _messageSender - -```solidity -address _messageSender -``` - -_The temporary message sender set when claiming a message._ - -### nextMessageNumber - -```solidity -uint256 nextMessageNumber -``` - -### minimumFeeInWei - -```solidity -uint256 minimumFeeInWei -``` - -### REFUND_OVERHEAD_IN_GAS - -```solidity -uint256 REFUND_OVERHEAD_IN_GAS -``` - -### DEFAULT_SENDER_ADDRESS - -```solidity -address DEFAULT_SENDER_ADDRESS -``` - -_The default message sender address reset after claiming a message._ - -### constructor - -```solidity -constructor() internal -``` - -### sendMessage - -```solidity -function sendMessage(address _to, uint256 _fee, bytes _calldata) external payable -``` - -Adds a message for sending cross-chain and emits a relevant event. - -_The message number is preset and only incremented at the end if successful for the next caller._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _to | address | The address the message is intended for. | -| _fee | uint256 | The fee being paid for the message delivery. | -| _calldata | bytes | The calldata to pass to the recipient. | - -### claimMessage - -```solidity -function claimMessage(address _from, address _to, uint256 _fee, uint256 _value, address payable _feeRecipient, bytes _calldata, uint256 _nonce) external -``` - -Claims and delivers a cross-chain message. - -__feeRecipient Can be set to address(0) to receive as msg.sender. -messageSender Is set temporarily when claiming and reset post._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _from | address | The address of the original sender. | -| _to | address | The address the message is intended for. | -| _fee | uint256 | The fee being paid for the message delivery. | -| _value | uint256 | The value to be transferred to the destination address. | -| _feeRecipient | address payable | The recipient for the fee. | -| _calldata | bytes | The calldata to pass to the recipient. | -| _nonce | uint256 | The unique auto generated message number used when sending the message. | - -### setMinimumFee - -```solidity -function setMinimumFee(uint256 _feeInWei) external -``` - -The Fee Manager sets a minimum fee to address DOS protection. - -_MINIMUM_FEE_SETTER_ROLE is required to set the minimum fee._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _feeInWei | uint256 | New minimum fee in Wei. | - -### sender - -```solidity -function sender() external view returns (address originalSender) -``` - -_The _messageSender address is set temporarily when claiming._ - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| originalSender | address | The original sender stored temporarily at the _messageSender address in storage. | - -### distributeFees - -```solidity -modifier distributeFees(uint256 _feeInWei, address _to, bytes _calldata, address _feeRecipient) -``` - -The unspent fee is refunded if applicable. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _feeInWei | uint256 | The fee paid for delivery in Wei. | -| _to | address | The recipient of the message and gas refund. | -| _calldata | bytes | The calldata of the message. | -| _feeRecipient | address | | - diff --git a/contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageManagerV1.md b/contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageManagerV1.md deleted file mode 100644 index 0f795e031..000000000 --- a/contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageManagerV1.md +++ /dev/null @@ -1,48 +0,0 @@ -# `IL2MessageManagerV1` - -### MinimumFeeChanged - -```solidity -event MinimumFeeChanged(uint256 previousMinimumFee, uint256 newMinimumFee, address calledBy) -``` - -Emitted when L2 minimum fee is changed. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| previousMinimumFee | uint256 | The previous minimum fee in Wei. | -| newMinimumFee | uint256 | The new minimum fee in Wei. | -| calledBy | address | The indexed address who changed the minimum fee. | - -### L1L2MessageHashesAddedToInbox - -```solidity -event L1L2MessageHashesAddedToInbox(bytes32[] messageHashes) -``` - -Emitted when L1->L2 message hashes have been added to L2 storage. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| messageHashes | bytes32[] | The message hashes that were added to L2 for claiming. | - -### MessageHashesListLengthHigherThanOneHundred - -```solidity -error MessageHashesListLengthHigherThanOneHundred(uint256 length) -``` - -_Thrown when the message hashes list length is higher than one hundred._ - -### MessageDoesNotExistOrHasAlreadyBeenClaimed - -```solidity -error MessageDoesNotExistOrHasAlreadyBeenClaimed(bytes32 messageHash) -``` - -_Thrown when the message does not exist or has already been claimed._ - diff --git a/contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageServiceV1.md b/contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageServiceV1.md deleted file mode 100644 index 8108c9df5..000000000 --- a/contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageServiceV1.md +++ /dev/null @@ -1,18 +0,0 @@ -# `IL2MessageServiceV1` - -### setMinimumFee - -```solidity -function setMinimumFee(uint256 _feeInWei) external -``` - -The Fee Manager sets a minimum fee to address DOS protection. - -_MINIMUM_FEE_SETTER_ROLE is required to set the minimum fee._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _feeInWei | uint256 | New minimum fee in Wei. | - diff --git a/contracts/docs/api/messaging/libraries/MessageHashing.md b/contracts/docs/api/messaging/libraries/MessageHashing.md deleted file mode 100644 index 47fe17ffd..000000000 --- a/contracts/docs/api/messaging/libraries/MessageHashing.md +++ /dev/null @@ -1,24 +0,0 @@ -# `MessageHashing` - -### _hashMessage - -```solidity -function _hashMessage(address _from, address _to, uint256 _fee, uint256 _valueSent, uint256 _messageNumber, bytes _calldata) internal pure returns (bytes32 messageHash) -``` - -Hashes messages using assembly for efficiency. - -_Adding 0xc0 is to indicate the calldata offset relative to the memory being added to. -If the calldata is not modulus 32, the extra bit needs to be added on at the end else the hash is wrong._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _from | address | The from address. | -| _to | address | The to address. | -| _fee | uint256 | The fee paid for delivery. | -| _valueSent | uint256 | The value to be sent when delivering. | -| _messageNumber | uint256 | The unique message number. | -| _calldata | bytes | The calldata to be passed to the destination address. | - diff --git a/contracts/docs/api/messaging/libraries/SparseMerkleTreeVerifier.md b/contracts/docs/api/messaging/libraries/SparseMerkleTreeVerifier.md deleted file mode 100644 index 3c1cf650a..000000000 --- a/contracts/docs/api/messaging/libraries/SparseMerkleTreeVerifier.md +++ /dev/null @@ -1,66 +0,0 @@ -# `SparseMerkleTreeVerifier` - -### SafeCastOverflowedUintDowncast - -```solidity -error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value) -``` - -_Value doesn't fit in a uint of `bits` size. -This is based on OpenZeppelin's SafeCast library._ - -### LeafIndexOutOfBounds - -```solidity -error LeafIndexOutOfBounds(uint32 leafIndex, uint32 maxAllowedIndex) -``` - -_Custom error for when the leaf index is out of bounds._ - -### _verifyMerkleProof - -```solidity -function _verifyMerkleProof(bytes32 _leafHash, bytes32[] _proof, uint32 _leafIndex, bytes32 _root) internal pure returns (bool proofIsValid) -``` - -Verify merkle proof - -_The depth of the tree is expected to be validated elsewhere beforehand._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _leafHash | bytes32 | Leaf hash. | -| _proof | bytes32[] | Sparse merkle tree proof. | -| _leafIndex | uint32 | Index of the leaf. | -| _root | bytes32 | Merkle root. | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| proofIsValid | bool | Returns if the proof is valid or not. | - -### safeCastToUint32 - -```solidity -function safeCastToUint32(uint256 _value) internal pure returns (uint32 castUint32) -``` - -Tries to safely cast to uint32. - -_This is based on OpenZeppelin's SafeCast library._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _value | uint256 | The value being cast to uint32. | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| castUint32 | uint32 | Returns a uint32 safely cast. | - diff --git a/contracts/docs/api/rollup/LineaRollup.md b/contracts/docs/api/rollup/LineaRollup.md deleted file mode 100644 index 96990127c..000000000 --- a/contracts/docs/api/rollup/LineaRollup.md +++ /dev/null @@ -1,466 +0,0 @@ -# `LineaRollup` - -### CONTRACT_VERSION - -```solidity -string CONTRACT_VERSION -``` - -This is the ABI version and not the reinitialize version. - -### VERIFIER_SETTER_ROLE - -```solidity -bytes32 VERIFIER_SETTER_ROLE -``` - -The role required to set/add proof verifiers by type. - -### VERIFIER_UNSETTER_ROLE - -```solidity -bytes32 VERIFIER_UNSETTER_ROLE -``` - -The role required to set/remove proof verifiers by type. - -### GENESIS_SHNARF - -```solidity -bytes32 GENESIS_SHNARF -``` - -The default genesis shnarf using empty/default hashes and a default state. - -### SHNARF_EXISTS_DEFAULT_VALUE - -```solidity -uint256 SHNARF_EXISTS_DEFAULT_VALUE -``` - -_Value indicating a shnarf exists._ - -### EMPTY_HASH - -```solidity -bytes32 EMPTY_HASH -``` - -_The default hash value._ - -### BLS_CURVE_MODULUS - -```solidity -uint256 BLS_CURVE_MODULUS -``` - -_The BLS Curve modulus value used._ - -### POINT_EVALUATION_PRECOMPILE_ADDRESS - -```solidity -address POINT_EVALUATION_PRECOMPILE_ADDRESS -``` - -_The well-known precompile address for point evaluation._ - -### POINT_EVALUATION_RETURN_DATA_LENGTH - -```solidity -uint256 POINT_EVALUATION_RETURN_DATA_LENGTH -``` - -_The expected point evaluation return data length._ - -### POINT_EVALUATION_FIELD_ELEMENTS_LENGTH - -```solidity -uint256 POINT_EVALUATION_FIELD_ELEMENTS_LENGTH -``` - -_The expected point evaluation field element length returned._ - -### SIX_MONTHS_IN_SECONDS - -```solidity -uint256 SIX_MONTHS_IN_SECONDS -``` - -_In practice, when used, this is expected to be a close approximation to 6 months, and is intentional._ - -### dataFinalStateRootHashes - -```solidity -mapping(bytes32 => bytes32) dataFinalStateRootHashes -``` - -_DEPRECATED in favor of the single blobShnarfExists mapping._ - -### dataParents - -```solidity -mapping(bytes32 => bytes32) dataParents -``` - -_DEPRECATED in favor of the single blobShnarfExists mapping._ - -### dataShnarfHashes - -```solidity -mapping(bytes32 => bytes32) dataShnarfHashes -``` - -_DEPRECATED in favor of the single blobShnarfExists mapping._ - -### dataStartingBlock - -```solidity -mapping(bytes32 => uint256) dataStartingBlock -``` - -_DEPRECATED in favor of the single blobShnarfExists mapping._ - -### dataEndingBlock - -```solidity -mapping(bytes32 => uint256) dataEndingBlock -``` - -_DEPRECATED in favor of the single blobShnarfExists mapping._ - -### currentL2StoredL1MessageNumber - -```solidity -uint256 currentL2StoredL1MessageNumber -``` - -_DEPRECATED in favor of currentFinalizedState hash._ - -### currentL2StoredL1RollingHash - -```solidity -bytes32 currentL2StoredL1RollingHash -``` - -_DEPRECATED in favor of currentFinalizedState hash._ - -### currentFinalizedShnarf - -```solidity -bytes32 currentFinalizedShnarf -``` - -Contains the most recent finalized shnarf. - -### blobShnarfExists - -```solidity -mapping(bytes32 => uint256) blobShnarfExists -``` - -_NB: THIS IS THE ONLY MAPPING BEING USED FOR DATA SUBMISSION TRACKING. -NB: This was shnarfFinalBlockNumbers and is replaced to indicate only that a shnarf exists with a value of 1._ - -### currentFinalizedState - -```solidity -bytes32 currentFinalizedState -``` - -Hash of the L2 computed L1 message number, rolling hash and finalized timestamp. - -### fallbackOperator - -```solidity -address fallbackOperator -``` - -The address of the fallback operator. - -_This address is granted the OPERATOR_ROLE after six months of finalization inactivity by the current operators._ - -### constructor - -```solidity -constructor() public -``` - -### initialize - -```solidity -function initialize(struct ILineaRollup.InitializationData _initializationData) external -``` - -Initializes LineaRollup and underlying service dependencies - used for new networks only. - -_DEFAULT_ADMIN_ROLE is set for the security council. -OPERATOR_ROLE is set for operators. -Note: This is used for new testnets and local/CI testing, and will not replace existing proxy based contracts._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _initializationData | struct ILineaRollup.InitializationData | The initial data used for proof verification. | - -### reinitializeLineaRollupV6 - -```solidity -function reinitializeLineaRollupV6(struct IPermissionsManager.RoleAddress[] _roleAddresses, struct IPauseManager.PauseTypeRole[] _pauseTypeRoles, struct IPauseManager.PauseTypeRole[] _unpauseTypeRoles, address _fallbackOperator) external -``` - -Sets permissions for a list of addresses and their roles as well as initialises the PauseManager pauseType:role mappings and fallback operator. - -_This function is a reinitializer and can only be called once per version. Should be called using an upgradeAndCall transaction to the ProxyAdmin._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _roleAddresses | struct IPermissionsManager.RoleAddress[] | The list of addresses and roles to assign permissions to. | -| _pauseTypeRoles | struct IPauseManager.PauseTypeRole[] | The list of pause types to associate with roles. | -| _unpauseTypeRoles | struct IPauseManager.PauseTypeRole[] | The list of unpause types to associate with roles. | -| _fallbackOperator | address | The address of the fallback operator. | - -### renounceRole - -```solidity -function renounceRole(bytes32 _role, address _account) public -``` - -Revokes `role` from the calling account. - -_Fallback operator cannot renounce role. Reverts with OnlyNonFallbackOperator._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _role | bytes32 | The role to renounce. | -| _account | address | The account to renounce - can only be the _msgSender(). | - -### setVerifierAddress - -```solidity -function setVerifierAddress(address _newVerifierAddress, uint256 _proofType) external -``` - -Adds or updates the verifier contract address for a proof type. - -_VERIFIER_SETTER_ROLE is required to execute._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _newVerifierAddress | address | The address for the verifier contract. | -| _proofType | uint256 | The proof type being set/updated. | - -### setFallbackOperator - -```solidity -function setFallbackOperator(uint256 _messageNumber, bytes32 _rollingHash, uint256 _lastFinalizedTimestamp) external -``` - -Sets the fallback operator role to the specified address if six months have passed since the last finalization. - -_Reverts if six months have not passed since the last finalization._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageNumber | uint256 | Last finalized L1 message number as part of the feedback loop. | -| _rollingHash | bytes32 | Last finalized L1 rolling hash as part of the feedback loop. | -| _lastFinalizedTimestamp | uint256 | Last finalized L2 block timestamp. | - -### unsetVerifierAddress - -```solidity -function unsetVerifierAddress(uint256 _proofType) external -``` - -Unset the verifier contract address for a proof type. - -_VERIFIER_UNSETTER_ROLE is required to execute._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _proofType | uint256 | The proof type being set/updated. | - -### submitBlobs - -```solidity -function submitBlobs(struct ILineaRollup.BlobSubmission[] _blobSubmissions, bytes32 _parentShnarf, bytes32 _finalBlobShnarf) external -``` - -Submit one or more EIP-4844 blobs. - -_OPERATOR_ROLE is required to execute. -This should be a blob carrying transaction._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _blobSubmissions | struct ILineaRollup.BlobSubmission[] | The data for blob submission including proofs and required polynomials. | -| _parentShnarf | bytes32 | The parent shnarf used in continuity checks as it includes the parentStateRootHash in its computation. | -| _finalBlobShnarf | bytes32 | The expected final shnarf post computation of all the blob shnarfs. | - -### submitDataAsCalldata - -```solidity -function submitDataAsCalldata(struct ILineaRollup.CompressedCalldataSubmission _submission, bytes32 _parentShnarf, bytes32 _expectedShnarf) external -``` - -Submit blobs using compressed data via calldata. - -_OPERATOR_ROLE is required to execute._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _submission | struct ILineaRollup.CompressedCalldataSubmission | The supporting data for compressed data submission including compressed data. | -| _parentShnarf | bytes32 | The parent shnarf used in continuity checks as it includes the parentStateRootHash in its computation. | -| _expectedShnarf | bytes32 | The expected shnarf post computation of all the submission. | - -### _computeLastFinalizedState - -```solidity -function _computeLastFinalizedState(uint256 _messageNumber, bytes32 _rollingHash, uint256 _timestamp) internal pure returns (bytes32 hashedFinalizationState) -``` - -Internal function to compute and save the finalization state. - -_Using assembly this way is cheaper gas wise._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageNumber | uint256 | Is the last L2 computed L1 message number in the finalization. | -| _rollingHash | bytes32 | Is the last L2 computed L1 rolling hash in the finalization. | -| _timestamp | uint256 | The final timestamp in the finalization. | - -### _computeShnarf - -```solidity -function _computeShnarf(bytes32 _parentShnarf, bytes32 _snarkHash, bytes32 _finalStateRootHash, bytes32 _dataEvaluationPoint, bytes32 _dataEvaluationClaim) internal pure returns (bytes32 shnarf) -``` - -Internal function to compute the shnarf more efficiently. - -_Using assembly this way is cheaper gas wise._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _parentShnarf | bytes32 | The shnarf of the parent data item. | -| _snarkHash | bytes32 | Is the computed hash for compressed data (using a SNARK-friendly hash function) that aggregates per data submission to be used in public input. | -| _finalStateRootHash | bytes32 | The final state root hash of the data being submitted. | -| _dataEvaluationPoint | bytes32 | The data evaluation point. | -| _dataEvaluationClaim | bytes32 | The data evaluation claim. | - -### _verifyPointEvaluation - -```solidity -function _verifyPointEvaluation(bytes32 _currentDataHash, uint256 _dataEvaluationPoint, uint256 _dataEvaluationClaim, bytes _kzgCommitment, bytes _kzgProof) internal view -``` - -Performs point evaluation for the compressed blob. - -__dataEvaluationPoint is modular reduced to be lower than the BLS_CURVE_MODULUS for precompile checks._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _currentDataHash | bytes32 | The current blob versioned hash. | -| _dataEvaluationPoint | uint256 | The data evaluation point. | -| _dataEvaluationClaim | uint256 | The data evaluation claim. | -| _kzgCommitment | bytes | The blob KZG commitment. | -| _kzgProof | bytes | The blob KZG point proof. | - -### finalizeBlocks - -```solidity -function finalizeBlocks(bytes _aggregatedProof, uint256 _proofType, struct ILineaRollup.FinalizationDataV3 _finalizationData) external -``` - -Finalize compressed blocks with proof. - -_OPERATOR_ROLE is required to execute._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _aggregatedProof | bytes | The aggregated proof. | -| _proofType | uint256 | The proof type. | -| _finalizationData | struct ILineaRollup.FinalizationDataV3 | The full finalization data. | - -### _finalizeBlocks - -```solidity -function _finalizeBlocks(struct ILineaRollup.FinalizationDataV3 _finalizationData, uint256 _lastFinalizedBlock) internal returns (bytes32 finalShnarf) -``` - -Internal function to finalize compressed blocks. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _finalizationData | struct ILineaRollup.FinalizationDataV3 | The full finalization data. | -| _lastFinalizedBlock | uint256 | The last finalized block. | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| finalShnarf | bytes32 | The final computed shnarf in finalizing. | - -### _validateL2ComputedRollingHash - -```solidity -function _validateL2ComputedRollingHash(uint256 _rollingHashMessageNumber, bytes32 _rollingHash) internal view -``` - -Internal function to validate l1 rolling hash. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _rollingHashMessageNumber | uint256 | Message number associated with the rolling hash as computed on L2. | -| _rollingHash | bytes32 | L1 rolling hash as computed on L2. | - -### _calculateY - -```solidity -function _calculateY(bytes _data, bytes32 _dataEvaluationPoint) internal pure returns (bytes32 compressedDataComputedY) -``` - -Internal function to calculate Y for public input generation. - -_Each chunk of 32 bytes must start with a 0 byte. -The dataEvaluationPoint value is modulo-ed down during the computation and scalar field checking is not needed. -There is a hard constraint in the circuit to enforce the polynomial degree limit (4096), which will also be enforced with EIP-4844._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _data | bytes | Compressed data from submission data. | -| _dataEvaluationPoint | bytes32 | The data evaluation point. | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| compressedDataComputedY | bytes32 | The Y calculated value using the Horner method. | - diff --git a/contracts/docs/api/LineaRollup.mdx b/contracts/docs/api/rollup/LineaRollup.mdx similarity index 100% rename from contracts/docs/api/LineaRollup.mdx rename to contracts/docs/api/rollup/LineaRollup.mdx diff --git a/contracts/docs/api/rollup/ZkEvmV2.md b/contracts/docs/api/rollup/ZkEvmV2.md deleted file mode 100644 index c74fc6891..000000000 --- a/contracts/docs/api/rollup/ZkEvmV2.md +++ /dev/null @@ -1,64 +0,0 @@ -# `ZkEvmV2` - -### MODULO_R - -```solidity -uint256 MODULO_R -``` - -### OPERATOR_ROLE - -```solidity -bytes32 OPERATOR_ROLE -``` - -### currentTimestamp - -```solidity -uint256 currentTimestamp -``` - -_DEPRECATED in favor of currentFinalizedState hash._ - -### currentL2BlockNumber - -```solidity -uint256 currentL2BlockNumber -``` - -The most recent finalized L2 block number. - -### stateRootHashes - -```solidity -mapping(uint256 => bytes32) stateRootHashes -``` - -The most recent L2 state root hash mapped by block number. - -### verifiers - -```solidity -mapping(uint256 => address) verifiers -``` - -The verifier address to use for a proof type when proving. - -### _verifyProof - -```solidity -function _verifyProof(uint256 _publicInput, uint256 _proofType, bytes _proof) internal -``` - -Verifies the proof with locally computed public inputs. - -_If the verifier based on proof type is not found, it reverts with InvalidProofType._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _publicInput | uint256 | The computed public input hash cast as uint256. | -| _proofType | uint256 | The proof type to determine which verifier contract to use. | -| _proof | bytes | The proof to be verified with the proof type verifier contract. | - diff --git a/contracts/docs/api/ZkEvmV2.mdx b/contracts/docs/api/rollup/ZkEvmV2.mdx similarity index 100% rename from contracts/docs/api/ZkEvmV2.mdx rename to contracts/docs/api/rollup/ZkEvmV2.mdx diff --git a/contracts/docs/api/rollup/interfaces/ILineaRollup.md b/contracts/docs/api/rollup/interfaces/ILineaRollup.md deleted file mode 100644 index 62e8e3944..000000000 --- a/contracts/docs/api/rollup/interfaces/ILineaRollup.md +++ /dev/null @@ -1,505 +0,0 @@ -# `ILineaRollup` - -### InitializationData - -Initialization data structure for the LineaRollup contract. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | - -```solidity -struct InitializationData { - bytes32 initialStateRootHash; - uint256 initialL2BlockNumber; - uint256 genesisTimestamp; - address defaultVerifier; - uint256 rateLimitPeriodInSeconds; - uint256 rateLimitAmountInWei; - struct IPermissionsManager.RoleAddress[] roleAddresses; - struct IPauseManager.PauseTypeRole[] pauseTypeRoles; - struct IPauseManager.PauseTypeRole[] unpauseTypeRoles; - address fallbackOperator; - address defaultAdmin; -} -``` - -### CompressedCalldataSubmission - -Supporting data for compressed calldata submission including compressed data. - -_finalStateRootHash is used to set state root at the end of the data. -snarkHash is the computed hash for compressed data (using a SNARK-friendly hash function) that aggregates per data submission to be used in public input. -compressedData is the compressed transaction data. It contains ordered data for each L2 block - l2Timestamps, the encoded transaction data._ - -```solidity -struct CompressedCalldataSubmission { - bytes32 finalStateRootHash; - bytes32 snarkHash; - bytes compressedData; -} -``` - -### ShnarfData - -Shnarf data for validating a shnarf. - -_parentShnarf is the parent computed shnarf. -snarkHash is the computed hash for compressed data (using a SNARK-friendly hash function) that aggregates per data submission to be used in public input. -finalStateRootHash is the final state root hash. -dataEvaluationPoint is the data evaluation point. -dataEvaluationClaim is the data evaluation claim._ - -```solidity -struct ShnarfData { - bytes32 parentShnarf; - bytes32 snarkHash; - bytes32 finalStateRootHash; - bytes32 dataEvaluationPoint; - bytes32 dataEvaluationClaim; -} -``` - -### BlobSubmission - -Data stucture for compressed blob data submission. - -_submissionData The supporting data for blob data submission excluding the compressed data. -dataEvaluationClaim The data evaluation claim. -kzgCommitment The blob KZG commitment. -kzgProof The blob KZG point proof._ - -```solidity -struct BlobSubmission { - uint256 dataEvaluationClaim; - bytes kzgCommitment; - bytes kzgProof; - bytes32 finalStateRootHash; - bytes32 snarkHash; -} -``` - -### FinalizationDataV3 - -Supporting data for finalization with proof. - -_NB: the dynamic sized fields are placed last on purpose for efficient keccaking on public input. -parentStateRootHash is the expected last state root hash finalized. -endBlockNumber is the end block finalizing until. -shnarfData contains data about the last data submission's shnarf used in finalization. -lastFinalizedTimestamp is the expected last finalized block's timestamp. -finalTimestamp is the timestamp of the last block being finalized. -lastFinalizedL1RollingHash is the last stored L2 computed rolling hash used in finalization. -l1RollingHash is the calculated rolling hash on L2 that is expected to match L1 at l1RollingHashMessageNumber. -This value will be used along with the stored last finalized L2 calculated rolling hash in the public input. -lastFinalizedL1RollingHashMessageNumber is the last stored L2 computed message number used in finalization. -l1RollingHashMessageNumber is the calculated message number on L2 that is expected to match the existing L1 rolling hash. -This value will be used along with the stored last finalized L2 calculated message number in the public input. -l2MerkleTreesDepth is the depth of all l2MerkleRoots. -l2MerkleRoots is an array of L2 message Merkle roots of depth l2MerkleTreesDepth between last finalized block and finalSubmissionData.finalBlockNumber. -l2MessagingBlocksOffsets indicates by offset from currentL2BlockNumber which L2 blocks contain MessageSent events._ - -```solidity -struct FinalizationDataV3 { - bytes32 parentStateRootHash; - uint256 endBlockNumber; - struct ILineaRollup.ShnarfData shnarfData; - uint256 lastFinalizedTimestamp; - uint256 finalTimestamp; - bytes32 lastFinalizedL1RollingHash; - bytes32 l1RollingHash; - uint256 lastFinalizedL1RollingHashMessageNumber; - uint256 l1RollingHashMessageNumber; - uint256 l2MerkleTreesDepth; - bytes32[] l2MerkleRoots; - bytes l2MessagingBlocksOffsets; -} -``` - -### LineaRollupVersionChanged - -```solidity -event LineaRollupVersionChanged(bytes8 previousVersion, bytes8 newVersion) -``` - -Emitted when the LineaRollup contract version has changed. - -_All bytes8 values are string based SemVer in the format M.m - e.g. "6.0"._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| previousVersion | bytes8 | The previous version. | -| newVersion | bytes8 | The new version. | - -### FallbackOperatorRoleGranted - -```solidity -event FallbackOperatorRoleGranted(address caller, address fallbackOperator) -``` - -Emitted when the fallback operator role is granted. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| caller | address | The address that called the function granting the role. | -| fallbackOperator | address | The fallback operator address that received the operator role. | - -### FallbackOperatorAddressSet - -```solidity -event FallbackOperatorAddressSet(address caller, address fallbackOperator) -``` - -Emitted when the fallback operator role is set on the contract. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| caller | address | The address that set the fallback operator address. | -| fallbackOperator | address | The fallback operator address. | - -### VerifierAddressChanged - -```solidity -event VerifierAddressChanged(address verifierAddress, uint256 proofType, address verifierSetBy, address oldVerifierAddress) -``` - -Emitted when a verifier is set for a particular proof type. - -_The verifier will be set by an account with the VERIFIER_SETTER_ROLE. Typically the Safe. -The oldVerifierAddress can be the zero address._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| verifierAddress | address | The indexed new verifier address being set. | -| proofType | uint256 | The indexed proof type/index that the verifier is mapped to. | -| verifierSetBy | address | The index address who set the verifier at the mapping. | -| oldVerifierAddress | address | Indicates the previous address mapped to the proof type. | - -### DataSubmittedV3 - -```solidity -event DataSubmittedV3(bytes32 parentShnarf, bytes32 shnarf, bytes32 finalStateRootHash) -``` - -Emitted when compressed data is being submitted and verified succesfully on L1. - -_The block range is indexed and parent shnarf included for state reconstruction simplicity._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| parentShnarf | bytes32 | The parent shnarf for the data being submitted. | -| shnarf | bytes32 | The indexed shnarf for the data being submitted. | -| finalStateRootHash | bytes32 | The L2 state root hash that the current blob submission ends on. NB: The last blob in the collection. | - -### DataFinalizedV3 - -```solidity -event DataFinalizedV3(uint256 startBlockNumber, uint256 endBlockNumber, bytes32 shnarf, bytes32 parentStateRootHash, bytes32 finalStateRootHash) -``` - -Emitted when L2 blocks have been finalized on L1. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| startBlockNumber | uint256 | The indexed L2 block number indicating which block the finalization the data starts from. | -| endBlockNumber | uint256 | The indexed L2 block number indicating which block the finalization the data ends on. | -| shnarf | bytes32 | The indexed shnarf being set as currentFinalizedShnarf in the current finalization. | -| parentStateRootHash | bytes32 | The parent L2 state root hash that the current finalization starts from. | -| finalStateRootHash | bytes32 | The L2 state root hash that the current finalization ends on. | - -### LastFinalizationTimeNotLapsed - -```solidity -error LastFinalizationTimeNotLapsed() -``` - -_Thrown when the last finalization time has not lapsed when trying to grant the OPERATOR_ROLE to the fallback operator address._ - -### PointEvaluationResponseInvalid - -```solidity -error PointEvaluationResponseInvalid(uint256 fieldElements, uint256 blsCurveModulus) -``` - -_Thrown when the point evaluation precompile's call return data field(s) are wrong._ - -### PrecompileReturnDataLengthWrong - -```solidity -error PrecompileReturnDataLengthWrong(uint256 expected, uint256 actual) -``` - -_Thrown when the point evaluation precompile's call return data length is wrong._ - -### PointEvaluationFailed - -```solidity -error PointEvaluationFailed() -``` - -_Thrown when the point evaluation precompile call returns false._ - -### EmptyBlobDataAtIndex - -```solidity -error EmptyBlobDataAtIndex(uint256 index) -``` - -_Thrown when the blobhash at an index equals to the zero hash._ - -### BlobSubmissionDataIsMissing - -```solidity -error BlobSubmissionDataIsMissing() -``` - -_Thrown when the data for multiple blobs submission has length zero._ - -### BlobSubmissionDataEmpty - -```solidity -error BlobSubmissionDataEmpty(uint256 emptyBlobIndex) -``` - -_Thrown when a blob has been submitted but there is no data for it._ - -### DataAlreadySubmitted - -```solidity -error DataAlreadySubmitted(bytes32 currentDataHash) -``` - -_Thrown when the current data was already submitted._ - -### EmptySubmissionData - -```solidity -error EmptySubmissionData() -``` - -_Thrown when submissionData is empty._ - -### L1RollingHashDoesNotExistOnL1 - -```solidity -error L1RollingHashDoesNotExistOnL1(uint256 messageNumber, bytes32 rollingHash) -``` - -_Thrown when finalizationData.l1RollingHash does not exist on L1 (Feedback loop)._ - -### FinalizationStateIncorrect - -```solidity -error FinalizationStateIncorrect(bytes32 expected, bytes32 value) -``` - -_Thrown when finalization state does not match._ - -### FinalBlockNumberLessThanOrEqualToLastFinalizedBlock - -```solidity -error FinalBlockNumberLessThanOrEqualToLastFinalizedBlock(uint256 finalBlockNumber, uint256 lastFinalizedBlock) -``` - -_Thrown when the final block number in finalization data is less than or equal to the last finalized block during finalization._ - -### FinalBlockStateEqualsZeroHash - -```solidity -error FinalBlockStateEqualsZeroHash() -``` - -_Thrown when the final block state equals the zero hash during finalization._ - -### FinalizationInTheFuture - -```solidity -error FinalizationInTheFuture(uint256 l2BlockTimestamp, uint256 currentBlockTimestamp) -``` - -_Thrown when final l2 block timestamp higher than current block.timestamp during finalization._ - -### MissingMessageNumberForRollingHash - -```solidity -error MissingMessageNumberForRollingHash(bytes32 rollingHash) -``` - -_Thrown when a rolling hash is provided without a corresponding message number._ - -### MissingRollingHashForMessageNumber - -```solidity -error MissingRollingHashForMessageNumber(uint256 messageNumber) -``` - -_Thrown when a message number is provided without a corresponding rolling hash._ - -### FirstByteIsNotZero - -```solidity -error FirstByteIsNotZero() -``` - -_Thrown when the first byte is not zero. -This is used explicitly with the four bytes in assembly 0x729eebce._ - -### BytesLengthNotMultipleOf32 - -```solidity -error BytesLengthNotMultipleOf32() -``` - -_Thrown when bytes length is not a multiple of 32._ - -### FinalShnarfWrong - -```solidity -error FinalShnarfWrong(bytes32 expected, bytes32 value) -``` - -_Thrown when the computed shnarf does not match what is expected._ - -### ParentBlobNotSubmitted - -```solidity -error ParentBlobNotSubmitted(bytes32 shnarf) -``` - -_Thrown when a shnarf does not exist for a parent blob._ - -### FinalBlobNotSubmitted - -```solidity -error FinalBlobNotSubmitted(bytes32 shnarf) -``` - -_Thrown when a shnarf does not exist for the final blob being finalized._ - -### OnlyNonFallbackOperator - -```solidity -error OnlyNonFallbackOperator() -``` - -_Thrown when the fallback operator tries to renounce their operator role._ - -### setVerifierAddress - -```solidity -function setVerifierAddress(address _newVerifierAddress, uint256 _proofType) external -``` - -Adds or updates the verifier contract address for a proof type. - -_VERIFIER_SETTER_ROLE is required to execute._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _newVerifierAddress | address | The address for the verifier contract. | -| _proofType | uint256 | The proof type being set/updated. | - -### setFallbackOperator - -```solidity -function setFallbackOperator(uint256 _messageNumber, bytes32 _rollingHash, uint256 _lastFinalizedTimestamp) external -``` - -Sets the fallback operator role to the specified address if six months have passed since the last finalization. - -_Reverts if six months have not passed since the last finalization._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _messageNumber | uint256 | Last finalized L1 message number as part of the feedback loop. | -| _rollingHash | bytes32 | Last finalized L1 rolling hash as part of the feedback loop. | -| _lastFinalizedTimestamp | uint256 | Last finalized L2 block timestamp. | - -### unsetVerifierAddress - -```solidity -function unsetVerifierAddress(uint256 _proofType) external -``` - -Unsets the verifier contract address for a proof type. - -_VERIFIER_UNSETTER_ROLE is required to execute._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _proofType | uint256 | The proof type being set/updated. | - -### submitBlobs - -```solidity -function submitBlobs(struct ILineaRollup.BlobSubmission[] _blobSubmissions, bytes32 _parentShnarf, bytes32 _finalBlobShnarf) external -``` - -Submit one or more EIP-4844 blobs. - -_OPERATOR_ROLE is required to execute. -This should be a blob carrying transaction._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _blobSubmissions | struct ILineaRollup.BlobSubmission[] | The data for blob submission including proofs and required polynomials. | -| _parentShnarf | bytes32 | The parent shnarf used in continuity checks as it includes the parentStateRootHash in its computation. | -| _finalBlobShnarf | bytes32 | The expected final shnarf post computation of all the blob shnarfs. | - -### submitDataAsCalldata - -```solidity -function submitDataAsCalldata(struct ILineaRollup.CompressedCalldataSubmission _submission, bytes32 _parentShnarf, bytes32 _expectedShnarf) external -``` - -Submit blobs using compressed data via calldata. - -_OPERATOR_ROLE is required to execute._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _submission | struct ILineaRollup.CompressedCalldataSubmission | The supporting data for compressed data submission including compressed data. | -| _parentShnarf | bytes32 | The parent shnarf used in continuity checks as it includes the parentStateRootHash in its computation. | -| _expectedShnarf | bytes32 | The expected shnarf post computation of all the submission. | - -### finalizeBlocks - -```solidity -function finalizeBlocks(bytes _aggregatedProof, uint256 _proofType, struct ILineaRollup.FinalizationDataV3 _finalizationData) external -``` - -Finalize compressed blocks with proof. - -_OPERATOR_ROLE is required to execute._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _aggregatedProof | bytes | The aggregated proof. | -| _proofType | uint256 | The proof type. | -| _finalizationData | struct ILineaRollup.FinalizationDataV3 | The full finalization data. | - diff --git a/contracts/docs/api/interfaces/l1/ILineaRollup.mdx b/contracts/docs/api/rollup/interfaces/ILineaRollup.mdx similarity index 100% rename from contracts/docs/api/interfaces/l1/ILineaRollup.mdx rename to contracts/docs/api/rollup/interfaces/ILineaRollup.mdx diff --git a/contracts/docs/api/rollup/interfaces/IZkEvmV2.md b/contracts/docs/api/rollup/interfaces/IZkEvmV2.md deleted file mode 100644 index 1e9d3bd42..000000000 --- a/contracts/docs/api/rollup/interfaces/IZkEvmV2.md +++ /dev/null @@ -1,42 +0,0 @@ -# `IZkEvmV2` - -### StartingRootHashDoesNotMatch - -```solidity -error StartingRootHashDoesNotMatch() -``` - -_Thrown when the starting rootHash does not match the existing state._ - -### ProofIsEmpty - -```solidity -error ProofIsEmpty() -``` - -_Thrown when zk proof is empty bytes._ - -### InvalidProofType - -```solidity -error InvalidProofType() -``` - -_Thrown when zk proof type is invalid._ - -### InvalidProof - -```solidity -error InvalidProof() -``` - -_Thrown when zk proof is invalid._ - -### InvalidProofOrProofVerificationRanOutOfGas - -```solidity -error InvalidProofOrProofVerificationRanOutOfGas(string errorReason) -``` - -_Thrown when the call to the verifier runs out of gas or reverts internally._ - diff --git a/contracts/docs/api/interfaces/l1/IZkEvmV2.mdx b/contracts/docs/api/rollup/interfaces/IZkEvmV2.mdx similarity index 100% rename from contracts/docs/api/interfaces/l1/IZkEvmV2.mdx rename to contracts/docs/api/rollup/interfaces/IZkEvmV2.mdx diff --git a/contracts/docs/api/security/access/PermissionsManager.md b/contracts/docs/api/security/access/PermissionsManager.md deleted file mode 100644 index 23f9a7432..000000000 --- a/contracts/docs/api/security/access/PermissionsManager.md +++ /dev/null @@ -1,16 +0,0 @@ -# `PermissionsManager` - -### __Permissions_init - -```solidity -function __Permissions_init(struct IPermissionsManager.RoleAddress[] _roleAddresses) internal -``` - -Sets permissions for a list of addresses and their roles. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _roleAddresses | struct IPermissionsManager.RoleAddress[] | The list of addresses and roles to assign permissions to. | - diff --git a/contracts/docs/api/security/pausing/PermissionsManager.mdx b/contracts/docs/api/security/access/PermissionsManager.mdx similarity index 100% rename from contracts/docs/api/security/pausing/PermissionsManager.mdx rename to contracts/docs/api/security/access/PermissionsManager.mdx diff --git a/contracts/docs/api/security/access/interfaces/IPermissionsManager.md b/contracts/docs/api/security/access/interfaces/IPermissionsManager.md deleted file mode 100644 index c7b189b79..000000000 --- a/contracts/docs/api/security/access/interfaces/IPermissionsManager.md +++ /dev/null @@ -1,11 +0,0 @@ -# `IPermissionsManager` - -### RoleAddress - -```solidity -struct RoleAddress { - address addressWithRole; - bytes32 role; -} -``` - diff --git a/contracts/docs/api/interfaces/IPermissionsManager.mdx b/contracts/docs/api/security/access/interfaces/IPermissionsManager.mdx similarity index 100% rename from contracts/docs/api/interfaces/IPermissionsManager.mdx rename to contracts/docs/api/security/access/interfaces/IPermissionsManager.mdx diff --git a/contracts/docs/api/security/limiting/RateLimiter.md b/contracts/docs/api/security/limiting/RateLimiter.md deleted file mode 100644 index d5f9f44ef..000000000 --- a/contracts/docs/api/security/limiting/RateLimiter.md +++ /dev/null @@ -1,111 +0,0 @@ -# `RateLimiter` - -You can use this control numeric limits over a period using timestamp. - -### RATE_LIMIT_SETTER_ROLE - -```solidity -bytes32 RATE_LIMIT_SETTER_ROLE -``` - -### USED_RATE_LIMIT_RESETTER_ROLE - -```solidity -bytes32 USED_RATE_LIMIT_RESETTER_ROLE -``` - -### periodInSeconds - -```solidity -uint256 periodInSeconds -``` - -### limitInWei - -```solidity -uint256 limitInWei -``` - -### currentPeriodEnd - -```solidity -uint256 currentPeriodEnd -``` - -The time at which the current period ends at. - -_Public for ease of consumption._ - -### currentPeriodAmountInWei - -```solidity -uint256 currentPeriodAmountInWei -``` - -Amounts already withdrawn this period. - -_Public for ease of consumption._ - -### __RateLimiter_init - -```solidity -function __RateLimiter_init(uint256 _periodInSeconds, uint256 _limitInWei) internal -``` - -Initialises the limits and period for the rate limiter. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _periodInSeconds | uint256 | The length of the period in seconds. | -| _limitInWei | uint256 | The limit allowed in the period in Wei. | - -### _addUsedAmount - -```solidity -function _addUsedAmount(uint256 _usedAmount) internal -``` - -Increments the amount used in the period. - -_The amount determining logic is external to this (e.g. fees are included when calling here). -Ignores the calculation if _usedAmount is zero. -Reverts if the limit is breached._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _usedAmount | uint256 | The amount used to be added. | - -### resetRateLimitAmount - -```solidity -function resetRateLimitAmount(uint256 _amount) external -``` - -Resets the rate limit amount. - -_If the used amount is higher, it is set to the limit to avoid confusion/issues. -Only the RATE_LIMIT_SETTER_ROLE is allowed to execute this function. -Emits the LimitAmountChanged event. -usedLimitAmountToSet will use the default value of zero if period has expired._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _amount | uint256 | The amount to reset the limit to. | - -### resetAmountUsedInPeriod - -```solidity -function resetAmountUsedInPeriod() external -``` - -Resets the amount used to zero. - -_Only the USED_RATE_LIMIT_RESETTER_ROLE is allowed to execute this function. -Emits the AmountUsedInPeriodReset event._ - diff --git a/contracts/docs/api/messaging/libraries/RateLimiter.mdx b/contracts/docs/api/security/limiting/RateLimiter.mdx similarity index 100% rename from contracts/docs/api/messaging/libraries/RateLimiter.mdx rename to contracts/docs/api/security/limiting/RateLimiter.mdx diff --git a/contracts/docs/api/security/limiting/interfaces/IRateLimiter.md b/contracts/docs/api/security/limiting/interfaces/IRateLimiter.md deleted file mode 100644 index 17db2b885..000000000 --- a/contracts/docs/api/security/limiting/interfaces/IRateLimiter.md +++ /dev/null @@ -1,106 +0,0 @@ -# `IRateLimiter` - -### RateLimitInitialized - -```solidity -event RateLimitInitialized(uint256 periodInSeconds, uint256 limitInWei, uint256 currentPeriodEnd) -``` - -Emitted when the Rate Limit is initialized. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| periodInSeconds | uint256 | The time period in seconds the rate limiter has been initialized to. | -| limitInWei | uint256 | The limit in Wei the rate limiter has been initialized to. | -| currentPeriodEnd | uint256 | The time the current rate limit period will end. | - -### AmountUsedInPeriodReset - -```solidity -event AmountUsedInPeriodReset(address resettingAddress) -``` - -Emitted when the amount in the period is reset to zero. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| resettingAddress | address | The indexed address of who reset the used amount back to zero. | - -### LimitAmountChanged - -```solidity -event LimitAmountChanged(address amountChangeBy, uint256 amount, bool amountUsedLoweredToLimit, bool usedAmountResetToZero) -``` - -Emitted when the limit is changed. - -_If the current used amount is higher than the new limit, the used amount is lowered to the limit. -amountUsedLoweredToLimit and usedAmountResetToZero cannot be true at the same time._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| amountChangeBy | address | The indexed address of who changed the rate limit. | -| amount | uint256 | The rate limited amount in Wei that was set. | -| amountUsedLoweredToLimit | bool | Indicates if the amount used was lowered to the limit to avoid confusion. | -| usedAmountResetToZero | bool | Indicates if the amount used was set to zero because of the current period expiring. | - -### RateLimitExceeded - -```solidity -error RateLimitExceeded() -``` - -_Thrown when an amount breaches the limit in the period._ - -### PeriodIsZero - -```solidity -error PeriodIsZero() -``` - -_Thrown when the period is initialised to zero._ - -### LimitIsZero - -```solidity -error LimitIsZero() -``` - -_Thrown when the limit is initialised to zero._ - -### resetRateLimitAmount - -```solidity -function resetRateLimitAmount(uint256 _amount) external -``` - -Resets the rate limit amount. - -_If the used amount is higher, it is set to the limit to avoid confusion/issues. -Only the RATE_LIMIT_SETTER_ROLE is allowed to execute this function. -Emits the LimitAmountChanged event. -usedLimitAmountToSet will use the default value of zero if period has expired._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _amount | uint256 | The amount to reset the limit to. | - -### resetAmountUsedInPeriod - -```solidity -function resetAmountUsedInPeriod() external -``` - -Resets the amount used to zero. - -_Only the USED_RATE_LIMIT_RESETTER_ROLE is allowed to execute this function. -Emits the AmountUsedInPeriodReset event._ - diff --git a/contracts/docs/api/interfaces/IRateLimiter.mdx b/contracts/docs/api/security/limiting/interfaces/IRateLimiter.mdx similarity index 100% rename from contracts/docs/api/interfaces/IRateLimiter.mdx rename to contracts/docs/api/security/limiting/interfaces/IRateLimiter.mdx diff --git a/contracts/docs/api/security/pausing/CallForwardingProxy.mdx b/contracts/docs/api/security/pausing/CallForwardingProxy.mdx deleted file mode 100644 index 0464089fd..000000000 --- a/contracts/docs/api/security/pausing/CallForwardingProxy.mdx +++ /dev/null @@ -1,24 +0,0 @@ -# `CallForwardingProxy` - -### target - -```solidity -address target -``` - -The underlying target address that is called. - -### constructor - -```solidity -constructor(address _target) public -``` - -### fallback - -```solidity -fallback() external payable -``` - -Defaults to, and forwards all calls to the target address. - diff --git a/contracts/docs/api/security/pausing/L2MessageServicePauseManager.md b/contracts/docs/api/security/pausing/L2MessageServicePauseManager.md deleted file mode 100644 index ff78dbccf..000000000 --- a/contracts/docs/api/security/pausing/L2MessageServicePauseManager.md +++ /dev/null @@ -1,34 +0,0 @@ -# `L2MessageServicePauseManager` - -### PAUSE_L1_L2_ROLE - -```solidity -bytes32 PAUSE_L1_L2_ROLE -``` - -This is used to pause L1 to L2 communication. - -### UNPAUSE_L1_L2_ROLE - -```solidity -bytes32 UNPAUSE_L1_L2_ROLE -``` - -This is used to unpause L1 to L2 communication. - -### PAUSE_L2_L1_ROLE - -```solidity -bytes32 PAUSE_L2_L1_ROLE -``` - -This is used to pause L2 to L1 communication. - -### UNPAUSE_L2_L1_ROLE - -```solidity -bytes32 UNPAUSE_L2_L1_ROLE -``` - -This is used to unpause L2 to L1 communication. - diff --git a/contracts/docs/api/security/pausing/LineaRollupPauseManager.md b/contracts/docs/api/security/pausing/LineaRollupPauseManager.md deleted file mode 100644 index 3b308c7a3..000000000 --- a/contracts/docs/api/security/pausing/LineaRollupPauseManager.md +++ /dev/null @@ -1,66 +0,0 @@ -# `LineaRollupPauseManager` - -### PAUSE_L1_L2_ROLE - -```solidity -bytes32 PAUSE_L1_L2_ROLE -``` - -This is used to pause L1 to L2 communication. - -### UNPAUSE_L1_L2_ROLE - -```solidity -bytes32 UNPAUSE_L1_L2_ROLE -``` - -This is used to unpause L1 to L2 communication. - -### PAUSE_L2_L1_ROLE - -```solidity -bytes32 PAUSE_L2_L1_ROLE -``` - -This is used to pause L2 to L1 communication. - -### UNPAUSE_L2_L1_ROLE - -```solidity -bytes32 UNPAUSE_L2_L1_ROLE -``` - -This is used to unpause L2 to L1 communication. - -### PAUSE_BLOB_SUBMISSION_ROLE - -```solidity -bytes32 PAUSE_BLOB_SUBMISSION_ROLE -``` - -This is used to pause blob submission. - -### UNPAUSE_BLOB_SUBMISSION_ROLE - -```solidity -bytes32 UNPAUSE_BLOB_SUBMISSION_ROLE -``` - -This is used to unpause blob submission. - -### PAUSE_FINALIZATION_ROLE - -```solidity -bytes32 PAUSE_FINALIZATION_ROLE -``` - -This is used to pause finalization submission. - -### UNPAUSE_FINALIZATION_ROLE - -```solidity -bytes32 UNPAUSE_FINALIZATION_ROLE -``` - -This is used to unpause finalization submission. - diff --git a/contracts/docs/api/security/pausing/PauseManager.md b/contracts/docs/api/security/pausing/PauseManager.md deleted file mode 100644 index 8b85b7d9b..000000000 --- a/contracts/docs/api/security/pausing/PauseManager.md +++ /dev/null @@ -1,151 +0,0 @@ -# `PauseManager` - -### PAUSE_ALL_ROLE - -```solidity -bytes32 PAUSE_ALL_ROLE -``` - -This is used to pause all pausable functions. - -### UNPAUSE_ALL_ROLE - -```solidity -bytes32 UNPAUSE_ALL_ROLE -``` - -This is used to unpause all unpausable functions. - -### pauseTypeStatuses - -```solidity -mapping(bytes32 => bool) pauseTypeStatuses -``` - -### whenTypeAndGeneralNotPaused - -```solidity -modifier whenTypeAndGeneralNotPaused(enum IPauseManager.PauseType _pauseType) -``` - -_Modifier to make a function callable only when the specific and general types are not paused._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _pauseType | enum IPauseManager.PauseType | The pause type value being checked. Requirements: - The type must not be paused. | - -### whenTypeNotPaused - -```solidity -modifier whenTypeNotPaused(enum IPauseManager.PauseType _pauseType) -``` - -_Modifier to make a function callable only when the type is not paused._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _pauseType | enum IPauseManager.PauseType | The pause type value being checked. Requirements: - The type must not be paused. | - -### __PauseManager_init - -```solidity -function __PauseManager_init(struct IPauseManager.PauseTypeRole[] _pauseTypeRoleAssignments, struct IPauseManager.PauseTypeRole[] _unpauseTypeRoleAssignments) internal -``` - -Initializes the pause manager with the given pause and unpause roles. - -_This function is called during contract initialization to set up the pause and unpause roles._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _pauseTypeRoleAssignments | struct IPauseManager.PauseTypeRole[] | An array of PauseTypeRole structs defining the pause types and their associated roles. | -| _unpauseTypeRoleAssignments | struct IPauseManager.PauseTypeRole[] | An array of PauseTypeRole structs defining the unpause types and their associated roles. | - -### _requireTypeAndGeneralNotPaused - -```solidity -function _requireTypeAndGeneralNotPaused(enum IPauseManager.PauseType _pauseType) internal view virtual -``` - -_Throws if the specific or general types are paused. -Checks the specific and general pause types._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _pauseType | enum IPauseManager.PauseType | The pause type value being checked. | - -### _requireTypeNotPaused - -```solidity -function _requireTypeNotPaused(enum IPauseManager.PauseType _pauseType) internal view virtual -``` - -_Throws if the type is paused. -Checks the specific pause type._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _pauseType | enum IPauseManager.PauseType | The pause type value being checked. | - -### pauseByType - -```solidity -function pauseByType(enum IPauseManager.PauseType _pauseType) external -``` - -Pauses functionality by specific type. - -_Requires the role mapped in `_pauseTypeRoles` for the pauseType._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _pauseType | enum IPauseManager.PauseType | The pause type value. | - -### unPauseByType - -```solidity -function unPauseByType(enum IPauseManager.PauseType _pauseType) external -``` - -Unpauses functionality by specific type. - -_Requires the role mapped in `_unPauseTypeRoles` for the pauseType._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _pauseType | enum IPauseManager.PauseType | The pause type value. | - -### isPaused - -```solidity -function isPaused(enum IPauseManager.PauseType _pauseType) public view returns (bool pauseTypeIsPaused) -``` - -Check if a pause type is enabled. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _pauseType | enum IPauseManager.PauseType | The pause type value. | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| pauseTypeIsPaused | bool | Returns true if the pause type if paused, false otherwise. | - diff --git a/contracts/docs/api/security/pausing/TokenBridgePauseManager.md b/contracts/docs/api/security/pausing/TokenBridgePauseManager.md deleted file mode 100644 index b0047aa76..000000000 --- a/contracts/docs/api/security/pausing/TokenBridgePauseManager.md +++ /dev/null @@ -1,26 +0,0 @@ -# `TokenBridgePauseManager` - -### PAUSE_INITIATE_TOKEN_BRIDGING_ROLE - -```solidity -bytes32 PAUSE_INITIATE_TOKEN_BRIDGING_ROLE -``` - -### UNPAUSE_INITIATE_TOKEN_BRIDGING_ROLE - -```solidity -bytes32 UNPAUSE_INITIATE_TOKEN_BRIDGING_ROLE -``` - -### PAUSE_COMPLETE_TOKEN_BRIDGING_ROLE - -```solidity -bytes32 PAUSE_COMPLETE_TOKEN_BRIDGING_ROLE -``` - -### UNPAUSE_COMPLETE_TOKEN_BRIDGING_ROLE - -```solidity -bytes32 UNPAUSE_COMPLETE_TOKEN_BRIDGING_ROLE -``` - diff --git a/contracts/docs/api/security/pausing/interfaces/IPauseManager.md b/contracts/docs/api/security/pausing/interfaces/IPauseManager.md deleted file mode 100644 index d09f221c0..000000000 --- a/contracts/docs/api/security/pausing/interfaces/IPauseManager.md +++ /dev/null @@ -1,155 +0,0 @@ -# `IPauseManager` - -### PauseTypeRole - -```solidity -struct PauseTypeRole { - enum IPauseManager.PauseType pauseType; - bytes32 role; -} -``` - -### PauseType - -```solidity -enum PauseType { - UNUSED, - GENERAL, - L1_L2, - L2_L1, - BLOB_SUBMISSION, - CALLDATA_SUBMISSION, - FINALIZATION, - INITIATE_TOKEN_BRIDGING, - COMPLETE_TOKEN_BRIDGING -} -``` - -### Paused - -```solidity -event Paused(address messageSender, enum IPauseManager.PauseType pauseType) -``` - -Emitted when a pause type is paused. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| messageSender | address | The address performing the pause. | -| pauseType | enum IPauseManager.PauseType | The indexed pause type that was paused. | - -### UnPaused - -```solidity -event UnPaused(address messageSender, enum IPauseManager.PauseType pauseType) -``` - -Emitted when a pause type is unpaused. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| messageSender | address | The address performing the unpause. | -| pauseType | enum IPauseManager.PauseType | The indexed pause type that was unpaused. | - -### PauseTypeRoleSet - -```solidity -event PauseTypeRoleSet(enum IPauseManager.PauseType pauseType, bytes32 role) -``` - -Emitted when a pause type and its associated role are set in the `_pauseTypeRoles` mapping. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| pauseType | enum IPauseManager.PauseType | The indexed type of pause. | -| role | bytes32 | The indexed role associated with the pause type. | - -### UnPauseTypeRoleSet - -```solidity -event UnPauseTypeRoleSet(enum IPauseManager.PauseType unPauseType, bytes32 role) -``` - -Emitted when an unpause type and its associated role are set in the `_unPauseTypeRoles` mapping. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| unPauseType | enum IPauseManager.PauseType | The indexed type of unpause. | -| role | bytes32 | The indexed role associated with the unpause type. | - -### IsPaused - -```solidity -error IsPaused(enum IPauseManager.PauseType pauseType) -``` - -_Thrown when a specific pause type is paused._ - -### IsNotPaused - -```solidity -error IsNotPaused(enum IPauseManager.PauseType pauseType) -``` - -_Thrown when a specific pause type is not paused and expected to be._ - -### pauseByType - -```solidity -function pauseByType(enum IPauseManager.PauseType _pauseType) external -``` - -Pauses functionality by specific type. - -_Requires the role mapped in pauseTypeRoles for the pauseType._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _pauseType | enum IPauseManager.PauseType | The pause type value. | - -### unPauseByType - -```solidity -function unPauseByType(enum IPauseManager.PauseType _pauseType) external -``` - -Unpauses functionality by specific type. - -_Requires the role mapped in unPauseTypeRoles for the pauseType._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _pauseType | enum IPauseManager.PauseType | The pause type value. | - -### isPaused - -```solidity -function isPaused(enum IPauseManager.PauseType _pauseType) external view returns (bool pauseTypeIsPaused) -``` - -Check if a pause type is enabled. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _pauseType | enum IPauseManager.PauseType | The pause type value. | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| pauseTypeIsPaused | bool | Returns true if the pause type if paused, false otherwise. | - diff --git a/contracts/docs/api/interfaces/IPauseManager.mdx b/contracts/docs/api/security/pausing/interfaces/IPauseManager.mdx similarity index 100% rename from contracts/docs/api/interfaces/IPauseManager.mdx rename to contracts/docs/api/security/pausing/interfaces/IPauseManager.mdx diff --git a/contracts/docs/api/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.md b/contracts/docs/api/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.md deleted file mode 100644 index 3d9fe9a6b..000000000 --- a/contracts/docs/api/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.md +++ /dev/null @@ -1,14 +0,0 @@ -# `TransientStorageReentrancyGuardUpgradeable` - -### ReentrantCall - -```solidity -error ReentrantCall() -``` - -### nonReentrant - -```solidity -modifier nonReentrant() -``` - diff --git a/contracts/docs/api/messaging/l1/TransientStorageReentrancyGuardUpgradeable.mdx b/contracts/docs/api/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.mdx similarity index 100% rename from contracts/docs/api/messaging/l1/TransientStorageReentrancyGuardUpgradeable.mdx rename to contracts/docs/api/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.mdx From 480d050c368968f38444987255e06d3c293465d5 Mon Sep 17 00:00:00 2001 From: VGau Date: Mon, 6 Jan 2025 15:22:21 +0100 Subject: [PATCH 04/14] fix: remove .md file in solidity docs folder --- .../security/pausing/CallForwardingProxy.md | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 contracts/docs/api/security/pausing/CallForwardingProxy.md diff --git a/contracts/docs/api/security/pausing/CallForwardingProxy.md b/contracts/docs/api/security/pausing/CallForwardingProxy.md deleted file mode 100644 index 57483a27d..000000000 --- a/contracts/docs/api/security/pausing/CallForwardingProxy.md +++ /dev/null @@ -1,26 +0,0 @@ -# Solidity API - -## CallForwardingProxy - -### target - -```solidity -address target -``` - -The underlying target address that is called. - -### constructor - -```solidity -constructor(address _target) public -``` - -### fallback - -```solidity -fallback() external payable -``` - -Defaults to, and forwards all calls to the target address. - From c75dac9685168e5685d682549972871a574ff7a8 Mon Sep 17 00:00:00 2001 From: VGau Date: Mon, 6 Jan 2025 16:08:13 +0100 Subject: [PATCH 05/14] fix: rename Utils contract + update autoupdate script --- .../unit/TestSparseMerkleTreeVerifier.sol | 6 +- contracts/src/_testing/unit/TestUtils.sol | 4 +- contracts/src/bridging/token/TokenBridge.sol | 6 +- ...Utils.sol => EfficientLeftRightKeccak.sol} | 2 +- .../src/messaging/l1/L1MessageManager.sol | 6 +- .../src/messaging/l2/L2MessageManager.sol | 6 +- .../libraries/SparseMerkleTreeVerifier.sol | 8 +- contracts/src/rollup/LineaRollup.sol | 8 +- contracts/src/verifiers/Utils.sol | 158 ------------------ .../compression-aggregation/autoupdate.sh | 12 +- 10 files changed, 29 insertions(+), 187 deletions(-) rename contracts/src/libraries/{Utils.sol => EfficientLeftRightKeccak.sol} (96%) delete mode 100644 contracts/src/verifiers/Utils.sol diff --git a/contracts/src/_testing/unit/TestSparseMerkleTreeVerifier.sol b/contracts/src/_testing/unit/TestSparseMerkleTreeVerifier.sol index 37ff6f548..e7068999f 100644 --- a/contracts/src/_testing/unit/TestSparseMerkleTreeVerifier.sol +++ b/contracts/src/_testing/unit/TestSparseMerkleTreeVerifier.sol @@ -2,11 +2,11 @@ pragma solidity 0.8.26; import { SparseMerkleTreeVerifier } from "../../messaging/libraries/SparseMerkleTreeVerifier.sol"; -import { Utils } from "../../libraries/Utils.sol"; +import { EfficientLeftRightKeccak } from "../../libraries/EfficientLeftRightKeccak.sol"; contract TestSparseMerkleTreeVerifier { using SparseMerkleTreeVerifier for *; - using Utils for *; + using EfficientLeftRightKeccak for *; function verifyMerkleProof( bytes32 _leafHash, @@ -18,7 +18,7 @@ contract TestSparseMerkleTreeVerifier { } function efficientKeccak(bytes32 _left, bytes32 _right) external pure returns (bytes32 value) { - return Utils._efficientKeccak(_left, _right); + return EfficientLeftRightKeccak._efficientKeccak(_left, _right); } function testSafeCastToUint32(uint256 _value) external pure returns (uint32) { diff --git a/contracts/src/_testing/unit/TestUtils.sol b/contracts/src/_testing/unit/TestUtils.sol index e6b8124d4..43132fd07 100644 --- a/contracts/src/_testing/unit/TestUtils.sol +++ b/contracts/src/_testing/unit/TestUtils.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { Utils } from "../../libraries/Utils.sol"; +import { EfficientLeftRightKeccak } from "../../libraries/EfficientLeftRightKeccak.sol"; contract TestUtils { function efficientKeccak(bytes32 _left, bytes32 _right) external pure returns (bytes32 value) { - return Utils._efficientKeccak(_left, _right); + return EfficientLeftRightKeccak._efficientKeccak(_left, _right); } } diff --git a/contracts/src/bridging/token/TokenBridge.sol b/contracts/src/bridging/token/TokenBridge.sol index bc7b39a3a..175443740 100644 --- a/contracts/src/bridging/token/TokenBridge.sol +++ b/contracts/src/bridging/token/TokenBridge.sol @@ -19,7 +19,7 @@ import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/ac import { StorageFiller39 } from "./utils/StorageFiller39.sol"; import { PermissionsManager } from "../../security/access/PermissionsManager.sol"; -import { Utils } from "../../libraries/Utils.sol"; +import { EfficientLeftRightKeccak } from "../../libraries/EfficientLeftRightKeccak.sol"; /** * @title Linea Canonical Token Bridge * @notice Contract to manage cross-chain ERC20 bridging. @@ -35,7 +35,7 @@ contract TokenBridge is PermissionsManager, StorageFiller39 { - using Utils for *; + using EfficientLeftRightKeccak for *; using SafeERC20Upgradeable for IERC20Upgradeable; /// @dev This is the ABI version and not the reinitialize version. @@ -444,7 +444,7 @@ contract TokenBridge is uint256 _chainId ) internal returns (address bridgedTokenAddress) { bridgedTokenAddress = address( - new BeaconProxy{ salt: Utils._efficientKeccak(_chainId, _nativeToken) }(tokenBeacon, "") + new BeaconProxy{ salt: EfficientLeftRightKeccak._efficientKeccak(_chainId, _nativeToken) }(tokenBeacon, "") ); (string memory name, string memory symbol, uint8 decimals) = abi.decode(_tokenMetadata, (string, string, uint8)); diff --git a/contracts/src/libraries/Utils.sol b/contracts/src/libraries/EfficientLeftRightKeccak.sol similarity index 96% rename from contracts/src/libraries/Utils.sol rename to contracts/src/libraries/EfficientLeftRightKeccak.sol index 4174a1073..1bbdbaa8c 100644 --- a/contracts/src/libraries/Utils.sol +++ b/contracts/src/libraries/EfficientLeftRightKeccak.sol @@ -6,7 +6,7 @@ pragma solidity >=0.8.19 <=0.8.26; * @author ConsenSys Software Inc. * @custom:security-contact security-report@linea.build */ -library Utils { +library EfficientLeftRightKeccak { /** * @notice Performs a gas optimized keccak hash for two bytes32 values. * @param _left Left value. diff --git a/contracts/src/messaging/l1/L1MessageManager.sol b/contracts/src/messaging/l1/L1MessageManager.sol index 58e549226..3256beacf 100644 --- a/contracts/src/messaging/l1/L1MessageManager.sol +++ b/contracts/src/messaging/l1/L1MessageManager.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.26; import { BitMaps } from "@openzeppelin/contracts/utils/structs/BitMaps.sol"; import { L1MessageManagerV1 } from "./v1/L1MessageManagerV1.sol"; import { IL1MessageManager } from "./interfaces/IL1MessageManager.sol"; -import { Utils } from "../../libraries/Utils.sol"; +import { EfficientLeftRightKeccak } from "../../libraries/EfficientLeftRightKeccak.sol"; /** * @title Contract to manage cross-chain message rolling hash computation and storage on L1. @@ -13,7 +13,7 @@ import { Utils } from "../../libraries/Utils.sol"; */ abstract contract L1MessageManager is L1MessageManagerV1, IL1MessageManager { using BitMaps for BitMaps.BitMap; - using Utils for *; + using EfficientLeftRightKeccak for *; /// @notice Contains the L1 to L2 messaging rolling hashes mapped to message number computed on L1. mapping(uint256 messageNumber => bytes32 rollingHash) public rollingHashes; @@ -35,7 +35,7 @@ abstract contract L1MessageManager is L1MessageManagerV1, IL1MessageManager { */ function _addRollingHash(uint256 _messageNumber, bytes32 _messageHash) internal { unchecked { - bytes32 newRollingHash = Utils._efficientKeccak(rollingHashes[_messageNumber - 1], _messageHash); + bytes32 newRollingHash = EfficientLeftRightKeccak._efficientKeccak(rollingHashes[_messageNumber - 1], _messageHash); rollingHashes[_messageNumber] = newRollingHash; emit RollingHashUpdated(_messageNumber, newRollingHash, _messageHash); diff --git a/contracts/src/messaging/l2/L2MessageManager.sol b/contracts/src/messaging/l2/L2MessageManager.sol index a679cf00e..f63ec46a5 100644 --- a/contracts/src/messaging/l2/L2MessageManager.sol +++ b/contracts/src/messaging/l2/L2MessageManager.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.19; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import { L2MessageManagerV1 } from "./v1/L2MessageManagerV1.sol"; import { IL2MessageManager } from "./interfaces/IL2MessageManager.sol"; -import { Utils } from "../../libraries/Utils.sol"; +import { EfficientLeftRightKeccak } from "../../libraries/EfficientLeftRightKeccak.sol"; /** * @title Contract to manage cross-chain message hashes storage and statuses on L2. @@ -12,7 +12,7 @@ import { Utils } from "../../libraries/Utils.sol"; * @custom:security-contact security-report@linea.build */ abstract contract L2MessageManager is AccessControlUpgradeable, IL2MessageManager, L2MessageManagerV1 { - using Utils for *; + using EfficientLeftRightKeccak for *; /// @notice The role required to anchor L1 to L2 message hashes. bytes32 public constant L1_L2_MESSAGE_SETTER_ROLE = keccak256("L1_L2_MESSAGE_SETTER_ROLE"); @@ -70,7 +70,7 @@ abstract contract L2MessageManager is AccessControlUpgradeable, IL2MessageManage if (inboxL1L2MessageStatus[messageHash] == INBOX_STATUS_UNKNOWN) { inboxL1L2MessageStatus[messageHash] = INBOX_STATUS_RECEIVED; - rollingHash = Utils._efficientKeccak(rollingHash, messageHash); + rollingHash = EfficientLeftRightKeccak._efficientKeccak(rollingHash, messageHash); ++currentL1MessageNumber; } diff --git a/contracts/src/messaging/libraries/SparseMerkleTreeVerifier.sol b/contracts/src/messaging/libraries/SparseMerkleTreeVerifier.sol index 6b188b9d8..9b769e919 100644 --- a/contracts/src/messaging/libraries/SparseMerkleTreeVerifier.sol +++ b/contracts/src/messaging/libraries/SparseMerkleTreeVerifier.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { Utils } from "../../libraries/Utils.sol"; +import { EfficientLeftRightKeccak } from "../../libraries/EfficientLeftRightKeccak.sol"; /** * @title Library to verify sparse merkle proofs and to get the leaf hash value @@ -9,7 +9,7 @@ import { Utils } from "../../libraries/Utils.sol"; * @custom:security-contact security-report@linea.build */ library SparseMerkleTreeVerifier { - using Utils for *; + using EfficientLeftRightKeccak for *; /** * @dev Value doesn't fit in a uint of `bits` size. @@ -47,9 +47,9 @@ library SparseMerkleTreeVerifier { for (uint256 height; height < _proof.length; ++height) { if (((_leafIndex >> height) & 1) == 1) { - node = Utils._efficientKeccak(_proof[height], node); + node = EfficientLeftRightKeccak._efficientKeccak(_proof[height], node); } else { - node = Utils._efficientKeccak(node, _proof[height]); + node = EfficientLeftRightKeccak._efficientKeccak(node, _proof[height]); } } proofIsValid = node == _root; diff --git a/contracts/src/rollup/LineaRollup.sol b/contracts/src/rollup/LineaRollup.sol index e4e434c50..e95f00084 100644 --- a/contracts/src/rollup/LineaRollup.sol +++ b/contracts/src/rollup/LineaRollup.sol @@ -7,14 +7,14 @@ import { ZkEvmV2 } from "./ZkEvmV2.sol"; import { ILineaRollup } from "./interfaces/ILineaRollup.sol"; import { PermissionsManager } from "../security/access/PermissionsManager.sol"; -import { Utils } from "../libraries/Utils.sol"; +import { EfficientLeftRightKeccak } from "../libraries/EfficientLeftRightKeccak.sol"; /** * @title Contract to manage cross-chain messaging on L1, L2 data submission, and rollup proof verification. * @author ConsenSys Software Inc. * @custom:security-contact security-report@linea.build */ contract LineaRollup is AccessControlUpgradeable, ZkEvmV2, L1MessageService, PermissionsManager, ILineaRollup { - using Utils for *; + using EfficientLeftRightKeccak for *; /// @notice This is the ABI version and not the reinitialize version. string public constant CONTRACT_VERSION = "6.0"; @@ -286,7 +286,7 @@ contract LineaRollup is AccessControlUpgradeable, ZkEvmV2, L1MessageService, Per bytes32 snarkHash = blobSubmission.snarkHash; - currentDataEvaluationPoint = Utils._efficientKeccak(snarkHash, currentDataHash); + currentDataEvaluationPoint = EfficientLeftRightKeccak._efficientKeccak(snarkHash, currentDataHash); _verifyPointEvaluation( currentDataHash, @@ -341,7 +341,7 @@ contract LineaRollup is AccessControlUpgradeable, ZkEvmV2, L1MessageService, Per bytes32 currentDataHash = keccak256(_submission.compressedData); - bytes32 dataEvaluationPoint = Utils._efficientKeccak(_submission.snarkHash, currentDataHash); + bytes32 dataEvaluationPoint = EfficientLeftRightKeccak._efficientKeccak(_submission.snarkHash, currentDataHash); bytes32 computedShnarf = _computeShnarf( _parentShnarf, diff --git a/contracts/src/verifiers/Utils.sol b/contracts/src/verifiers/Utils.sol deleted file mode 100644 index 40f28ed16..000000000 --- a/contracts/src/verifiers/Utils.sol +++ /dev/null @@ -1,158 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -// Copyright 2023 Consensys Software Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by gnark DO NOT EDIT - -pragma solidity 0.8.19; - -/// @custom:security-contact security-report@linea.build -library Utils { - uint256 private constant r_mod = 21888242871839275222246405745257275088548364400416034343698204186575808495617; - uint256 private constant bb = 340282366920938463463374607431768211456; // 2**128 - uint256 private constant error_string_id = 0x08c379a000000000000000000000000000000000000000000000000000000000; // selector for function Error(string) - uint256 private constant zero_uint256 = 0; - - uint8 private constant lenInBytes = 48; - uint8 private constant sizeDomain = 11; - uint8 private constant one = 1; - uint8 private constant two = 2; - - /** - * @dev xmsg expands msg to a slice of lenInBytes bytes. - * https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06#section-5 - * https://tools.ietf.org/html/rfc8017#section-4.1 (I2OSP/O2ISP) - * @dev cf https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06#section-5.2 - * corresponds to https://github.com/ConsenSys/gnark-crypto/blob/develop/ecc/bn254/fr/element.go - */ - function hash_fr(uint256 x, uint256 y) internal view returns (uint256 res) { - assembly { - function error_sha2_256() { - let ptError := mload(0x40) - mstore(ptError, error_string_id) // selector for function Error(string) - mstore(add(ptError, 0x4), 0x20) - mstore(add(ptError, 0x24), 0x19) - mstore(add(ptError, 0x44), "error staticcall sha2-256") - revert(ptError, 0x64) - } - - // [0x00, .. , 0x00 || x, y, || 0, 48, 0, dst, sizeDomain] - // <- 64 bytes -> <-64b -> <- 1 bytes each -> - let mPtr := mload(0x40) - - // [0x00, .., 0x00] 64 bytes of zero - mstore(mPtr, zero_uint256) - mstore(add(mPtr, 0x20), zero_uint256) - - // msg = x || y , both on 32 bytes - mstore(add(mPtr, 0x40), x) - mstore(add(mPtr, 0x60), y) - - // 0 || 48 || 0 all on 1 byte - mstore8(add(mPtr, 0x80), 0) - mstore8(add(mPtr, 0x81), lenInBytes) - mstore8(add(mPtr, 0x82), 0) - - // "BSB22-Plonk" = [42, 53, 42, 32, 32, 2d, 50, 6c, 6f, 6e, 6b,] - mstore8(add(mPtr, 0x83), 0x42) - mstore8(add(mPtr, 0x84), 0x53) - mstore8(add(mPtr, 0x85), 0x42) - mstore8(add(mPtr, 0x86), 0x32) - mstore8(add(mPtr, 0x87), 0x32) - mstore8(add(mPtr, 0x88), 0x2d) - mstore8(add(mPtr, 0x89), 0x50) - mstore8(add(mPtr, 0x8a), 0x6c) - mstore8(add(mPtr, 0x8b), 0x6f) - mstore8(add(mPtr, 0x8c), 0x6e) - mstore8(add(mPtr, 0x8d), 0x6b) - - // size domain - mstore8(add(mPtr, 0x8e), sizeDomain) - - let success := staticcall(gas(), 0x2, mPtr, 0x8f, mPtr, 0x20) - if iszero(success) { - error_sha2_256() - } - - let b0 := mload(mPtr) - - // [b0 || one || dst || sizeDomain] - // <-64bytes -> <- 1 byte each -> - mstore8(add(mPtr, 0x20), one) // 1 - - mstore8(add(mPtr, 0x21), 0x42) // dst - mstore8(add(mPtr, 0x22), 0x53) - mstore8(add(mPtr, 0x23), 0x42) - mstore8(add(mPtr, 0x24), 0x32) - mstore8(add(mPtr, 0x25), 0x32) - mstore8(add(mPtr, 0x26), 0x2d) - mstore8(add(mPtr, 0x27), 0x50) - mstore8(add(mPtr, 0x28), 0x6c) - mstore8(add(mPtr, 0x29), 0x6f) - mstore8(add(mPtr, 0x2a), 0x6e) - mstore8(add(mPtr, 0x2b), 0x6b) - - mstore8(add(mPtr, 0x2c), sizeDomain) // size domain - success := staticcall(gas(), 0x2, mPtr, 0x2d, mPtr, 0x20) - if iszero(success) { - error_sha2_256() - } - - // b1 is located at mPtr. We store b2 at add(mPtr, 0x20) - - // [b0^b1 || two || dst || sizeDomain] - // <-64bytes -> <- 1 byte each -> - mstore(add(mPtr, 0x20), xor(mload(mPtr), b0)) - mstore8(add(mPtr, 0x40), two) - - mstore8(add(mPtr, 0x41), 0x42) // dst - mstore8(add(mPtr, 0x42), 0x53) - mstore8(add(mPtr, 0x43), 0x42) - mstore8(add(mPtr, 0x44), 0x32) - mstore8(add(mPtr, 0x45), 0x32) - mstore8(add(mPtr, 0x46), 0x2d) - mstore8(add(mPtr, 0x47), 0x50) - mstore8(add(mPtr, 0x48), 0x6c) - mstore8(add(mPtr, 0x49), 0x6f) - mstore8(add(mPtr, 0x4a), 0x6e) - mstore8(add(mPtr, 0x4b), 0x6b) - - mstore8(add(mPtr, 0x4c), sizeDomain) // size domain - - let offset := add(mPtr, 0x20) - success := staticcall(gas(), 0x2, offset, 0x2d, offset, 0x20) - if iszero(success) { - error_sha2_256() - } - - // at this point we have mPtr = [ b1 || b2] where b1 is on 32byes and b2 in 16bytes. - // we interpret it as a big integer mod r in big endian (similar to regular decimal notation) - // the result is then 2**(8*16)*mPtr[:32] + mPtr[32:48] - res := mulmod(mload(mPtr), bb, r_mod) // <- res = 2**128 * mPtr[:32] - offset := add(mPtr, 0x10) - for { - let i := 0 - } lt(i, 0x10) { - i := add(i, 1) - } { - // mPtr <- [xx, xx, .., | 0, 0, .. 0 || b2 ] - mstore8(offset, 0x00) - offset := add(offset, 0x1) - } - let b1 := mload(add(mPtr, 0x10)) // b1 <- [0, 0, .., 0 || b2[:16] ] - res := addmod(res, b1, r_mod) - } - } -} diff --git a/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh b/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh index 94279f70f..f15ad9659 100755 --- a/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh +++ b/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh @@ -39,14 +39,14 @@ rm -rf .samples-simple-eip4844 .samples-multiproof-eip4844 .samples-test-eip4844 sed -i.bak 's/pragma solidity \0.8.24;/pragma solidity 0.8.26;/g' ../contracts/test/testData/compressedData/Verifier1.sol -cp ../contracts/test/testData/compressedData/Verifier1.sol ../contracts/contracts/verifiers/PlonkVerifierForDataAggregation.sol -sed -i.bak 's/contract PlonkVerifier /contract PlonkVerifierForDataAggregation /g' ../contracts/contracts/verifiers/PlonkVerifierForDataAggregation.sol +cp ../contracts/test/testData/compressedData/Verifier1.sol ../contracts/src/verifiers/PlonkVerifierForDataAggregation.sol +sed -i.bak 's/contract PlonkVerifier /contract PlonkVerifierForDataAggregation /g' ../contracts/src/verifiers/PlonkVerifierForDataAggregation.sol -cp ../contracts/test/testData/compressedData/Verifier1.sol ../contracts/contracts/verifiers/test/TestPlonkVerifierForDataAggregation.sol -sed -i.bak 's/contract PlonkVerifier /contract TestPlonkVerifierForDataAggregation /g' ../contracts/contracts/verifiers/test/TestPlonkVerifierForDataAggregation.sol +cp ../contracts/test/testData/compressedData/Verifier1.sol ../contracts/src/_testing/unit/TestPlonkVerifierForDataAggregation.sol +sed -i.bak 's/contract PlonkVerifier /contract TestPlonkVerifierForDataAggregation /g' ../contracts/src/_testing/unit/TestPlonkVerifierForDataAggregation.sol -rm ../contracts/contracts/verifiers/test/TestPlonkVerifierForDataAggregation.sol.bak -rm ../contracts/contracts/verifiers/PlonkVerifierForDataAggregation.sol.bak +rm ../contracts/src/_testing/unit/TestPlonkVerifierForDataAggregation.sol.bak +rm ../contracts/src/verifiers/PlonkVerifierForDataAggregation.sol.bak # Remove this artefact from the code. This litters the contracts tests rm ../contracts/test/testData/**/Verifier1.* From a1135748d48c380e13e17ccbb16968b6ac88eb6b Mon Sep 17 00:00:00 2001 From: VGau Date: Mon, 6 Jan 2025 16:39:14 +0100 Subject: [PATCH 06/14] fix: update solidity doc --- .../libraries/EfficientLeftRightKeccak.mdx | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 contracts/docs/api/libraries/EfficientLeftRightKeccak.mdx diff --git a/contracts/docs/api/libraries/EfficientLeftRightKeccak.mdx b/contracts/docs/api/libraries/EfficientLeftRightKeccak.mdx new file mode 100644 index 000000000..2bbd23f47 --- /dev/null +++ b/contracts/docs/api/libraries/EfficientLeftRightKeccak.mdx @@ -0,0 +1,32 @@ +# `EfficientLeftRightKeccak` + +### _efficientKeccak + +```solidity +function _efficientKeccak(bytes32 _left, bytes32 _right) internal pure returns (bytes32 value) +``` + +Performs a gas optimized keccak hash for two bytes32 values. + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| _left | bytes32 | Left value. | +| _right | bytes32 | Right value. | + +### _efficientKeccak + +```solidity +function _efficientKeccak(uint256 _left, address _right) internal pure returns (bytes32 value) +``` + +Performs a gas optimized keccak hash for uint256 and address. + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| _left | uint256 | Left value. | +| _right | address | Right value. | + From 30a50444754341599d48ffbb88a7dbfdc507b4cf Mon Sep 17 00:00:00 2001 From: VGau Date: Tue, 7 Jan 2025 10:51:41 +0100 Subject: [PATCH 07/14] fix: clean test contracts folder structure --- contracts/deploy/09_deploy_TestEIP4844.ts | 16 ------------ contracts/src/_testing/unit/TestEIP4844.sol | 26 ------------------- .../_testing/unit/TestPublicInputVerifier.sol | 17 ------------ .../TestEfficientLeftRightKeccak.sol} | 2 +- .../{ => messaging}/TestL1MessageManager.sol | 0 .../{ => messaging}/TestL1MessageService.sol | 0 .../TestL1MessageServiceMerkleProof.sol | 0 .../{ => messaging}/TestL2MessageManager.sol | 0 .../{ => messaging}/TestL2MessageService.sol | 0 .../TestMessageServiceBase.sol | 0 .../TestSparseMerkleTreeVerifier.sol | 0 .../ErrorAndDestructionTesting.sol | 0 .../unit/{ => opcodes}/LondonEvmCodes.yul | 0 .../unit/{ => opcodes}/OpcodeTestContract.sol | 0 .../unit/{ => opcodes}/OpcodeTester.sol | 0 .../unit/{ => rollup}/TestLineaRollup.sol | 0 .../unit/{ => rollup}/TestLineaRollupV5.sol | 0 .../unit/{ => security}/TestPauseManager.sol | 0 .../unit/{ => security}/TestRateLimiter.sol | 0 .../{ => security}/TestSetPauseTypeRoles.sol | 0 .../unit/{ => tokens}/TestLineaSurgeXP.sol | 0 .../TestPlonkVerifierForDataAggregation.sol | 0 .../{Utils.ts => EfficientLeftRightKeccak.ts} | 12 ++++----- 23 files changed, 7 insertions(+), 66 deletions(-) delete mode 100644 contracts/deploy/09_deploy_TestEIP4844.ts delete mode 100644 contracts/src/_testing/unit/TestEIP4844.sol delete mode 100644 contracts/src/_testing/unit/TestPublicInputVerifier.sol rename contracts/src/_testing/unit/{TestUtils.sol => libraries/TestEfficientLeftRightKeccak.sol} (89%) rename contracts/src/_testing/unit/{ => messaging}/TestL1MessageManager.sol (100%) rename contracts/src/_testing/unit/{ => messaging}/TestL1MessageService.sol (100%) rename contracts/src/_testing/unit/{ => messaging}/TestL1MessageServiceMerkleProof.sol (100%) rename contracts/src/_testing/unit/{ => messaging}/TestL2MessageManager.sol (100%) rename contracts/src/_testing/unit/{ => messaging}/TestL2MessageService.sol (100%) rename contracts/src/_testing/unit/{ => messaging}/TestMessageServiceBase.sol (100%) rename contracts/src/_testing/unit/{ => messaging}/TestSparseMerkleTreeVerifier.sol (100%) rename contracts/src/_testing/unit/{ => opcodes}/ErrorAndDestructionTesting.sol (100%) rename contracts/src/_testing/unit/{ => opcodes}/LondonEvmCodes.yul (100%) rename contracts/src/_testing/unit/{ => opcodes}/OpcodeTestContract.sol (100%) rename contracts/src/_testing/unit/{ => opcodes}/OpcodeTester.sol (100%) rename contracts/src/_testing/unit/{ => rollup}/TestLineaRollup.sol (100%) rename contracts/src/_testing/unit/{ => rollup}/TestLineaRollupV5.sol (100%) rename contracts/src/_testing/unit/{ => security}/TestPauseManager.sol (100%) rename contracts/src/_testing/unit/{ => security}/TestRateLimiter.sol (100%) rename contracts/src/_testing/unit/{ => security}/TestSetPauseTypeRoles.sol (100%) rename contracts/src/_testing/unit/{ => tokens}/TestLineaSurgeXP.sol (100%) rename contracts/src/_testing/unit/{ => verifiers}/TestPlonkVerifierForDataAggregation.sol (100%) rename contracts/test/lib/{Utils.ts => EfficientLeftRightKeccak.ts} (63%) diff --git a/contracts/deploy/09_deploy_TestEIP4844.ts b/contracts/deploy/09_deploy_TestEIP4844.ts deleted file mode 100644 index f8c53cf34..000000000 --- a/contracts/deploy/09_deploy_TestEIP4844.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { ethers } from "hardhat"; -import { DeployFunction } from "hardhat-deploy/types"; -import { deployFromFactory } from "../scripts/hardhat/utils"; -import { get1559Fees } from "../scripts/utils"; -import { LogContractDeployment } from "contracts/common/helpers"; - -const func: DeployFunction = async function () { - const contractName = "TestEIP4844"; - - const provider = ethers.provider; - - const contract = await deployFromFactory(contractName, provider, await get1559Fees(provider)); - await LogContractDeployment(contractName, contract); -}; -export default func; -func.tags = ["TestEIP4844"]; diff --git a/contracts/src/_testing/unit/TestEIP4844.sol b/contracts/src/_testing/unit/TestEIP4844.sol deleted file mode 100644 index db3397cc6..000000000 --- a/contracts/src/_testing/unit/TestEIP4844.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.8.26; - -contract TestEIP4844 { - event BlobHashEvent(bytes32 blobHash); - - function submitData( - bytes32 _snarkHash, - uint256 _y, - bytes1[48] memory _kzgCommitment, - bytes1[48] memory _kzgProof - ) external { - bytes32 h = blobhash(0); - - bytes32 compressedDataComputedX = keccak256(abi.encode(_snarkHash, h)); - - (bool success, ) = address(0x0a).staticcall( - abi.encodePacked(h, compressedDataComputedX, _y, _kzgCommitment, _kzgProof) - ); - if (!success) { - revert("PointEvaluationFailed"); - } - - emit BlobHashEvent(h); - } -} diff --git a/contracts/src/_testing/unit/TestPublicInputVerifier.sol b/contracts/src/_testing/unit/TestPublicInputVerifier.sol deleted file mode 100644 index 63d95660e..000000000 --- a/contracts/src/_testing/unit/TestPublicInputVerifier.sol +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.8.26; - -import { IPlonkVerifier } from "../../verifiers/interfaces/IPlonkVerifier.sol"; - -/// @dev Test verifier contract that returns true. -contract TestPublicInputVerifier is IPlonkVerifier { - uint256 public expectedPublicInput; - - constructor(uint256 _expectedPublicInput) { - expectedPublicInput = _expectedPublicInput; - } - - function Verify(bytes calldata, uint256[] calldata _publicInput) external view returns (bool) { - return expectedPublicInput == _publicInput[0]; - } -} diff --git a/contracts/src/_testing/unit/TestUtils.sol b/contracts/src/_testing/unit/libraries/TestEfficientLeftRightKeccak.sol similarity index 89% rename from contracts/src/_testing/unit/TestUtils.sol rename to contracts/src/_testing/unit/libraries/TestEfficientLeftRightKeccak.sol index 43132fd07..11e0a39ac 100644 --- a/contracts/src/_testing/unit/TestUtils.sol +++ b/contracts/src/_testing/unit/libraries/TestEfficientLeftRightKeccak.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.26; import { EfficientLeftRightKeccak } from "../../libraries/EfficientLeftRightKeccak.sol"; -contract TestUtils { +contract TestEfficientLeftRightKeccak { function efficientKeccak(bytes32 _left, bytes32 _right) external pure returns (bytes32 value) { return EfficientLeftRightKeccak._efficientKeccak(_left, _right); } diff --git a/contracts/src/_testing/unit/TestL1MessageManager.sol b/contracts/src/_testing/unit/messaging/TestL1MessageManager.sol similarity index 100% rename from contracts/src/_testing/unit/TestL1MessageManager.sol rename to contracts/src/_testing/unit/messaging/TestL1MessageManager.sol diff --git a/contracts/src/_testing/unit/TestL1MessageService.sol b/contracts/src/_testing/unit/messaging/TestL1MessageService.sol similarity index 100% rename from contracts/src/_testing/unit/TestL1MessageService.sol rename to contracts/src/_testing/unit/messaging/TestL1MessageService.sol diff --git a/contracts/src/_testing/unit/TestL1MessageServiceMerkleProof.sol b/contracts/src/_testing/unit/messaging/TestL1MessageServiceMerkleProof.sol similarity index 100% rename from contracts/src/_testing/unit/TestL1MessageServiceMerkleProof.sol rename to contracts/src/_testing/unit/messaging/TestL1MessageServiceMerkleProof.sol diff --git a/contracts/src/_testing/unit/TestL2MessageManager.sol b/contracts/src/_testing/unit/messaging/TestL2MessageManager.sol similarity index 100% rename from contracts/src/_testing/unit/TestL2MessageManager.sol rename to contracts/src/_testing/unit/messaging/TestL2MessageManager.sol diff --git a/contracts/src/_testing/unit/TestL2MessageService.sol b/contracts/src/_testing/unit/messaging/TestL2MessageService.sol similarity index 100% rename from contracts/src/_testing/unit/TestL2MessageService.sol rename to contracts/src/_testing/unit/messaging/TestL2MessageService.sol diff --git a/contracts/src/_testing/unit/TestMessageServiceBase.sol b/contracts/src/_testing/unit/messaging/TestMessageServiceBase.sol similarity index 100% rename from contracts/src/_testing/unit/TestMessageServiceBase.sol rename to contracts/src/_testing/unit/messaging/TestMessageServiceBase.sol diff --git a/contracts/src/_testing/unit/TestSparseMerkleTreeVerifier.sol b/contracts/src/_testing/unit/messaging/TestSparseMerkleTreeVerifier.sol similarity index 100% rename from contracts/src/_testing/unit/TestSparseMerkleTreeVerifier.sol rename to contracts/src/_testing/unit/messaging/TestSparseMerkleTreeVerifier.sol diff --git a/contracts/src/_testing/unit/ErrorAndDestructionTesting.sol b/contracts/src/_testing/unit/opcodes/ErrorAndDestructionTesting.sol similarity index 100% rename from contracts/src/_testing/unit/ErrorAndDestructionTesting.sol rename to contracts/src/_testing/unit/opcodes/ErrorAndDestructionTesting.sol diff --git a/contracts/src/_testing/unit/LondonEvmCodes.yul b/contracts/src/_testing/unit/opcodes/LondonEvmCodes.yul similarity index 100% rename from contracts/src/_testing/unit/LondonEvmCodes.yul rename to contracts/src/_testing/unit/opcodes/LondonEvmCodes.yul diff --git a/contracts/src/_testing/unit/OpcodeTestContract.sol b/contracts/src/_testing/unit/opcodes/OpcodeTestContract.sol similarity index 100% rename from contracts/src/_testing/unit/OpcodeTestContract.sol rename to contracts/src/_testing/unit/opcodes/OpcodeTestContract.sol diff --git a/contracts/src/_testing/unit/OpcodeTester.sol b/contracts/src/_testing/unit/opcodes/OpcodeTester.sol similarity index 100% rename from contracts/src/_testing/unit/OpcodeTester.sol rename to contracts/src/_testing/unit/opcodes/OpcodeTester.sol diff --git a/contracts/src/_testing/unit/TestLineaRollup.sol b/contracts/src/_testing/unit/rollup/TestLineaRollup.sol similarity index 100% rename from contracts/src/_testing/unit/TestLineaRollup.sol rename to contracts/src/_testing/unit/rollup/TestLineaRollup.sol diff --git a/contracts/src/_testing/unit/TestLineaRollupV5.sol b/contracts/src/_testing/unit/rollup/TestLineaRollupV5.sol similarity index 100% rename from contracts/src/_testing/unit/TestLineaRollupV5.sol rename to contracts/src/_testing/unit/rollup/TestLineaRollupV5.sol diff --git a/contracts/src/_testing/unit/TestPauseManager.sol b/contracts/src/_testing/unit/security/TestPauseManager.sol similarity index 100% rename from contracts/src/_testing/unit/TestPauseManager.sol rename to contracts/src/_testing/unit/security/TestPauseManager.sol diff --git a/contracts/src/_testing/unit/TestRateLimiter.sol b/contracts/src/_testing/unit/security/TestRateLimiter.sol similarity index 100% rename from contracts/src/_testing/unit/TestRateLimiter.sol rename to contracts/src/_testing/unit/security/TestRateLimiter.sol diff --git a/contracts/src/_testing/unit/TestSetPauseTypeRoles.sol b/contracts/src/_testing/unit/security/TestSetPauseTypeRoles.sol similarity index 100% rename from contracts/src/_testing/unit/TestSetPauseTypeRoles.sol rename to contracts/src/_testing/unit/security/TestSetPauseTypeRoles.sol diff --git a/contracts/src/_testing/unit/TestLineaSurgeXP.sol b/contracts/src/_testing/unit/tokens/TestLineaSurgeXP.sol similarity index 100% rename from contracts/src/_testing/unit/TestLineaSurgeXP.sol rename to contracts/src/_testing/unit/tokens/TestLineaSurgeXP.sol diff --git a/contracts/src/_testing/unit/TestPlonkVerifierForDataAggregation.sol b/contracts/src/_testing/unit/verifiers/TestPlonkVerifierForDataAggregation.sol similarity index 100% rename from contracts/src/_testing/unit/TestPlonkVerifierForDataAggregation.sol rename to contracts/src/_testing/unit/verifiers/TestPlonkVerifierForDataAggregation.sol diff --git a/contracts/test/lib/Utils.ts b/contracts/test/lib/EfficientLeftRightKeccak.ts similarity index 63% rename from contracts/test/lib/Utils.ts rename to contracts/test/lib/EfficientLeftRightKeccak.ts index 4acd6e878..d2481c543 100644 --- a/contracts/test/lib/Utils.ts +++ b/contracts/test/lib/EfficientLeftRightKeccak.ts @@ -1,17 +1,17 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; -import { TestUtils } from "../../typechain-types"; +import { TestEfficientLeftRightKeccak } from "../../typechain-types"; import { deployFromFactory } from "../common/deployment"; import { generateKeccak256, generateRandomBytes } from "../common/helpers"; -describe("Utils Library", () => { - let contract: TestUtils; +describe("EfficientLeftRightKeccak Library", () => { + let contract: TestEfficientLeftRightKeccak; - async function deployTestUtilsFixture() { - return deployFromFactory("TestUtils"); + async function deployTestEfficientLeftRightKeccakFixture() { + return deployFromFactory("TestEfficientLeftRightKeccak"); } beforeEach(async () => { - contract = (await loadFixture(deployTestUtilsFixture)) as TestUtils; + contract = (await loadFixture(deployTestEfficientLeftRightKeccakFixture)) as TestEfficientLeftRightKeccak; }); describe("efficientKeccak", () => { From 96ae531859a58d982422f103b55bbf0e730aee6b Mon Sep 17 00:00:00 2001 From: VGau Date: Tue, 7 Jan 2025 12:45:19 +0100 Subject: [PATCH 08/14] fix: clean test folder structure --- .../tokenBridge/test/deployTokenBridges.ts | 2 +- .../TestEfficientLeftRightKeccak.sol | 2 +- .../unit/messaging/TestL1MessageManager.sol | 2 +- .../unit/messaging/TestL1MessageService.sol | 4 +- .../TestL1MessageServiceMerkleProof.sol | 6 +- .../unit/messaging/TestL2MessageManager.sol | 6 +- .../unit/messaging/TestL2MessageService.sol | 2 +- .../unit/messaging/TestMessageServiceBase.sol | 2 +- .../TestSparseMerkleTreeVerifier.sol | 4 +- .../_testing/unit/rollup/TestLineaRollup.sol | 2 +- .../unit/rollup/TestLineaRollupV5.sol | 2 +- .../unit/security/TestPauseManager.sol | 2 +- .../unit/security/TestRateLimiter.sol | 2 +- .../unit/security/TestSetPauseTypeRoles.sol | 2 +- .../PlonkVerifierForDataAggregation.sol | 359 +++++++++--------- .../test/common/constants/submissionData.ts | 58 --- .../test/{ => hardhat}/L1MessageService.ts | 2 +- .../verify_L2MessageService_Upgrade.ts | 0 .../verify_LineaRollup_Upgrade.ts | 0 .../compressedData/aggregatedProof-1-155.json | 27 ++ .../compressedData/blocks-1-46.json | 0 .../compressedData/blocks-115-155.json | 0 .../compressedData/blocks-47-81.json | 0 .../compressedData/blocks-82-114.json | 0 .../multipleProofs/aggregatedProof-1-81.json | 25 ++ .../aggregatedProof-82-153.json | 25 ++ .../multipleProofs/blocks-1-46.json | 0 .../multipleProofs/blocks-120-153.json | 0 .../multipleProofs/blocks-47-81.json | 0 .../multipleProofs/blocks-82-119.json | 0 .../test/aggregatedProof-1-46.json | 24 ++ .../compressedData/test/blocks-1-46.json | 0 .../aggregatedProof-1-155.json | 27 ++ .../compressedDataEip4844/blocks-1-46.json | 0 .../compressedDataEip4844/blocks-115-155.json | 0 .../compressedDataEip4844/blocks-47-81.json | 0 .../compressedDataEip4844/blocks-82-114.json | 0 .../multipleProofs/aggregatedProof-1-81.json | 25 ++ .../aggregatedProof-82-153.json | 25 ++ .../multipleProofs/blocks-1-46.json | 0 .../multipleProofs/blocks-120-153.json | 0 .../multipleProofs/blocks-47-81.json | 0 .../multipleProofs/blocks-82-119.json | 0 .../test/aggregatedProof-1-155.json | 0 .../test/aggregatedProof-1-206.json | 0 .../test/aggregatedProof-1-46.json | 24 ++ .../test/blocks-1-46.json | 0 .../test/blocks-115-155.json | 0 .../test/blocks-156-175.json | 0 .../test/blocks-176-206.json | 0 .../test/blocks-47-81.json | 0 .../test/blocks-82-114.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 ....0-ccv0.0.0-getZkBlobCompressionProof.json | 0 .../rolling-hash-history.json | 0 .../_testData}/merkle-proof-data.json | 0 .../_testData}/mimc-test-data.json | 0 .../_testData}/test-transactions.json | 0 .../_testData}/trusted_setup.txt | 0 .../bridging/token}/BridgedToken.ts | 2 +- .../bridging/token/MockedE2E.ts} | 12 +- .../bridging/token}/TokenBridge.ts | 10 +- .../bridging/token}/utils/permitHelper.ts | 2 +- .../common/constants/calldata.ts | 0 .../common/constants/errorMessages.ts | 0 .../{ => hardhat}/common/constants/fees.ts | 0 .../{ => hardhat}/common/constants/general.ts | 0 .../{ => hardhat}/common/constants/index.ts | 0 .../common/constants/merkleTree.ts | 0 .../common/constants/messageStatuses.ts | 0 .../common/constants/pauseTypes.ts | 0 .../{ => hardhat}/common/constants/roles.ts | 0 .../common/constants/submissionData.ts | 58 +++ .../{ => hardhat}/common/constants/time.ts | 0 .../test/{ => hardhat}/common/deployment.ts | 0 .../common/helpers/dataGeneration.ts | 0 .../common/helpers/dataLoader.ts | 0 .../{ => hardhat}/common/helpers/encoding.ts | 0 .../common/helpers/expectations.ts | 0 .../{ => hardhat}/common/helpers/general.ts | 0 .../{ => hardhat}/common/helpers/hashing.ts | 0 .../{ => hardhat}/common/helpers/index.ts | 0 .../{ => hardhat}/common/helpers/messaging.ts | 0 contracts/test/{ => hardhat}/common/types.ts | 0 .../lib => hardhat/governance}/Timelock.ts | 4 +- .../libraries}/EfficientLeftRightKeccak.ts | 2 +- .../mimc.ts => hardhat/libraries/Mimc.ts} | 4 +- .../libraries}/SparseMerkleProof.ts | 4 +- .../messaging}/MessageServiceBase.ts | 2 +- .../messaging}/l1/L1MessageManager.ts | 2 +- .../messaging}/l2/L2MessageManager.ts | 2 +- .../messaging}/l2/L2MessageService.ts | 6 +- .../libraries}/SparseMerkleTreeVerifier.ts | 4 +- .../recovery}/RecoverFunds.ts | 2 +- .../test/{ => hardhat/rollup}/LineaRollup.ts | 36 +- .../{lib => hardhat/security}/PauseManager.ts | 79 +++- .../lib => hardhat/security}/RateLimiter.ts | 6 +- .../{token => hardhat/tokens}/LineaSurgeXP.ts | 2 +- .../tokens}/LineaVoyageXP.ts | 2 +- .../tokens}/TokenMintingRateLimiter.ts | 3 +- .../compressedData/aggregatedProof-1-155.json | 27 -- .../multipleProofs/aggregatedProof-1-81.json | 25 -- .../aggregatedProof-82-153.json | 25 -- .../test/aggregatedProof-1-46.json | 24 -- .../aggregatedProof-1-155.json | 27 -- .../multipleProofs/aggregatedProof-1-81.json | 25 -- .../aggregatedProof-82-153.json | 25 -- .../test/aggregatedProof-1-46.json | 24 -- .../compression-aggregation/autoupdate.sh | 14 +- 132 files changed, 579 insertions(+), 542 deletions(-) delete mode 100644 contracts/test/common/constants/submissionData.ts rename contracts/test/{ => hardhat}/L1MessageService.ts (99%) rename contracts/test/{upgrades => hardhat/_manualTesting}/verify_L2MessageService_Upgrade.ts (100%) rename contracts/test/{upgrades => hardhat/_manualTesting}/verify_LineaRollup_Upgrade.ts (100%) create mode 100644 contracts/test/hardhat/_testData/compressedData/aggregatedProof-1-155.json rename contracts/test/{testData => hardhat/_testData}/compressedData/blocks-1-46.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedData/blocks-115-155.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedData/blocks-47-81.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedData/blocks-82-114.json (100%) create mode 100644 contracts/test/hardhat/_testData/compressedData/multipleProofs/aggregatedProof-1-81.json create mode 100644 contracts/test/hardhat/_testData/compressedData/multipleProofs/aggregatedProof-82-153.json rename contracts/test/{testData => hardhat/_testData}/compressedData/multipleProofs/blocks-1-46.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedData/multipleProofs/blocks-120-153.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedData/multipleProofs/blocks-47-81.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedData/multipleProofs/blocks-82-119.json (100%) create mode 100644 contracts/test/hardhat/_testData/compressedData/test/aggregatedProof-1-46.json rename contracts/test/{testData => hardhat/_testData}/compressedData/test/blocks-1-46.json (100%) create mode 100644 contracts/test/hardhat/_testData/compressedDataEip4844/aggregatedProof-1-155.json rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/blocks-1-46.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/blocks-115-155.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/blocks-47-81.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/blocks-82-114.json (100%) create mode 100644 contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json create mode 100644 contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/aggregatedProof-82-153.json rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/multipleProofs/blocks-1-46.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/multipleProofs/blocks-120-153.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/multipleProofs/blocks-47-81.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/multipleProofs/blocks-82-119.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/test/aggregatedProof-1-155.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/test/aggregatedProof-1-206.json (100%) create mode 100644 contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-46.json rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/test/blocks-1-46.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/test/blocks-115-155.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/test/blocks-156-175.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/test/blocks-176-206.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/test/blocks-47-81.json (100%) rename contracts/test/{testData => hardhat/_testData}/compressedDataEip4844/test/blocks-82-114.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000501-1000503-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000504-1000505-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000506-1000507-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000508-1000512-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000513-1000518-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000519-1000522-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000523-1000528-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000529-1000530-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000531-1000536-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000537-1000538-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000539-1000544-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000545-1000548-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000549-1000550-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000551-1000554-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000555-1000560-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000561-1000563-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000564-1000565-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000566-1000571-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000572-1000576-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000577-1000580-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000581-1000586-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000587-1000588-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000589-1000592-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000593-1000594-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/blobSubmissions/1000595-1000599-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json (100%) rename contracts/test/{testData => hardhat/_testData}/integrationWithProver/rolling-hash-history.json (100%) rename contracts/test/{testData => hardhat/_testData}/merkle-proof-data.json (100%) rename contracts/test/{testData => hardhat/_testData}/mimc-test-data.json (100%) rename contracts/test/{testData => hardhat/_testData}/test-transactions.json (100%) rename contracts/test/{testData => hardhat/_testData}/trusted_setup.txt (100%) rename contracts/test/{tokenBridge => hardhat/bridging/token}/BridgedToken.ts (98%) rename contracts/test/{tokenBridge/E2E.ts => hardhat/bridging/token/MockedE2E.ts} (98%) rename contracts/test/{tokenBridge => hardhat/bridging/token}/TokenBridge.ts (99%) rename contracts/test/{tokenBridge => hardhat/bridging/token}/utils/permitHelper.ts (95%) rename contracts/test/{ => hardhat}/common/constants/calldata.ts (100%) rename contracts/test/{ => hardhat}/common/constants/errorMessages.ts (100%) rename contracts/test/{ => hardhat}/common/constants/fees.ts (100%) rename contracts/test/{ => hardhat}/common/constants/general.ts (100%) rename contracts/test/{ => hardhat}/common/constants/index.ts (100%) rename contracts/test/{ => hardhat}/common/constants/merkleTree.ts (100%) rename contracts/test/{ => hardhat}/common/constants/messageStatuses.ts (100%) rename contracts/test/{ => hardhat}/common/constants/pauseTypes.ts (100%) rename contracts/test/{ => hardhat}/common/constants/roles.ts (100%) create mode 100644 contracts/test/hardhat/common/constants/submissionData.ts rename contracts/test/{ => hardhat}/common/constants/time.ts (100%) rename contracts/test/{ => hardhat}/common/deployment.ts (100%) rename contracts/test/{ => hardhat}/common/helpers/dataGeneration.ts (100%) rename contracts/test/{ => hardhat}/common/helpers/dataLoader.ts (100%) rename contracts/test/{ => hardhat}/common/helpers/encoding.ts (100%) rename contracts/test/{ => hardhat}/common/helpers/expectations.ts (100%) rename contracts/test/{ => hardhat}/common/helpers/general.ts (100%) rename contracts/test/{ => hardhat}/common/helpers/hashing.ts (100%) rename contracts/test/{ => hardhat}/common/helpers/index.ts (100%) rename contracts/test/{ => hardhat}/common/helpers/messaging.ts (100%) rename contracts/test/{ => hardhat}/common/types.ts (100%) rename contracts/test/{messageService/lib => hardhat/governance}/Timelock.ts (94%) rename contracts/test/{lib => hardhat/libraries}/EfficientLeftRightKeccak.ts (93%) rename contracts/test/{lib/mimc.ts => hardhat/libraries/Mimc.ts} (92%) rename contracts/test/{lib => hardhat/libraries}/SparseMerkleProof.ts (98%) rename contracts/test/{messageService => hardhat/messaging}/MessageServiceBase.ts (99%) rename contracts/test/{messageService => hardhat/messaging}/l1/L1MessageManager.ts (98%) rename contracts/test/{messageService => hardhat/messaging}/l2/L2MessageManager.ts (99%) rename contracts/test/{messageService => hardhat/messaging}/l2/L2MessageService.ts (99%) rename contracts/test/{messageService/lib => hardhat/messaging/libraries}/SparseMerkleTreeVerifier.ts (98%) rename contracts/test/{tools => hardhat/recovery}/RecoverFunds.ts (98%) rename contracts/test/{ => hardhat/rollup}/LineaRollup.ts (98%) rename contracts/test/{lib => hardhat/security}/PauseManager.ts (86%) rename contracts/test/{messageService/lib => hardhat/security}/RateLimiter.ts (98%) rename contracts/test/{token => hardhat/tokens}/LineaSurgeXP.ts (99%) rename contracts/test/{token => hardhat/tokens}/LineaVoyageXP.ts (99%) rename contracts/test/{token => hardhat/tokens}/TokenMintingRateLimiter.ts (98%) delete mode 100644 contracts/test/testData/compressedData/aggregatedProof-1-155.json delete mode 100644 contracts/test/testData/compressedData/multipleProofs/aggregatedProof-1-81.json delete mode 100644 contracts/test/testData/compressedData/multipleProofs/aggregatedProof-82-153.json delete mode 100644 contracts/test/testData/compressedData/test/aggregatedProof-1-46.json delete mode 100644 contracts/test/testData/compressedDataEip4844/aggregatedProof-1-155.json delete mode 100644 contracts/test/testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json delete mode 100644 contracts/test/testData/compressedDataEip4844/multipleProofs/aggregatedProof-82-153.json delete mode 100644 contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-46.json diff --git a/contracts/scripts/tokenBridge/test/deployTokenBridges.ts b/contracts/scripts/tokenBridge/test/deployTokenBridges.ts index 576e5e6a1..ad87f9e27 100644 --- a/contracts/scripts/tokenBridge/test/deployTokenBridges.ts +++ b/contracts/scripts/tokenBridge/test/deployTokenBridges.ts @@ -3,7 +3,7 @@ import { ethers, upgrades } from "hardhat"; import { TokenBridge } from "../../../typechain-types"; import { SupportedChainIds } from "../../../common/supportedNetworks"; import { deployBridgedTokenBeacon } from "./deployBridgedTokenBeacon"; -import { pauseTypeRoles, unpauseTypeRoles } from "../../../test/common/constants"; +import { pauseTypeRoles, unpauseTypeRoles } from "../../../test/hardhat/common/constants"; import { generateRoleAssignments } from "contracts/common/helpers"; import { TOKEN_BRIDGE_ROLES } from "contracts/common/constants"; diff --git a/contracts/src/_testing/unit/libraries/TestEfficientLeftRightKeccak.sol b/contracts/src/_testing/unit/libraries/TestEfficientLeftRightKeccak.sol index 11e0a39ac..2cbd0e049 100644 --- a/contracts/src/_testing/unit/libraries/TestEfficientLeftRightKeccak.sol +++ b/contracts/src/_testing/unit/libraries/TestEfficientLeftRightKeccak.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { EfficientLeftRightKeccak } from "../../libraries/EfficientLeftRightKeccak.sol"; +import { EfficientLeftRightKeccak } from "../../../libraries/EfficientLeftRightKeccak.sol"; contract TestEfficientLeftRightKeccak { function efficientKeccak(bytes32 _left, bytes32 _right) external pure returns (bytes32 value) { diff --git a/contracts/src/_testing/unit/messaging/TestL1MessageManager.sol b/contracts/src/_testing/unit/messaging/TestL1MessageManager.sol index 869a5f10b..91f1a2614 100644 --- a/contracts/src/_testing/unit/messaging/TestL1MessageManager.sol +++ b/contracts/src/_testing/unit/messaging/TestL1MessageManager.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { L1MessageManager } from "../../messaging/l1/L1MessageManager.sol"; +import { L1MessageManager } from "../../../messaging/l1/L1MessageManager.sol"; contract TestL1MessageManager is L1MessageManager { /** diff --git a/contracts/src/_testing/unit/messaging/TestL1MessageService.sol b/contracts/src/_testing/unit/messaging/TestL1MessageService.sol index 4c48dbf4b..61ff28806 100644 --- a/contracts/src/_testing/unit/messaging/TestL1MessageService.sol +++ b/contracts/src/_testing/unit/messaging/TestL1MessageService.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { L1MessageService } from "../../messaging/l1/L1MessageService.sol"; -import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol"; +import { L1MessageService } from "../../../messaging/l1/L1MessageService.sol"; +import { TestSetPauseTypeRoles } from "../security/TestSetPauseTypeRoles.sol"; contract TestL1MessageService is L1MessageService, TestSetPauseTypeRoles { /** diff --git a/contracts/src/_testing/unit/messaging/TestL1MessageServiceMerkleProof.sol b/contracts/src/_testing/unit/messaging/TestL1MessageServiceMerkleProof.sol index f5c59b181..b53f31853 100644 --- a/contracts/src/_testing/unit/messaging/TestL1MessageServiceMerkleProof.sol +++ b/contracts/src/_testing/unit/messaging/TestL1MessageServiceMerkleProof.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { L1MessageService } from "../../messaging/l1/L1MessageService.sol"; -import { IL1MessageService } from "../../messaging/l1/interfaces/IL1MessageService.sol"; -import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol"; +import { L1MessageService } from "../../../messaging/l1/L1MessageService.sol"; +import { IL1MessageService } from "../../../messaging/l1/interfaces/IL1MessageService.sol"; +import { TestSetPauseTypeRoles } from "../security/TestSetPauseTypeRoles.sol"; interface ITestL1MessageService { function claimMessageWithProof(IL1MessageService.ClaimMessageWithProofParams calldata _params) external; diff --git a/contracts/src/_testing/unit/messaging/TestL2MessageManager.sol b/contracts/src/_testing/unit/messaging/TestL2MessageManager.sol index 9a19aad6b..1b64df924 100644 --- a/contracts/src/_testing/unit/messaging/TestL2MessageManager.sol +++ b/contracts/src/_testing/unit/messaging/TestL2MessageManager.sol @@ -2,9 +2,9 @@ pragma solidity 0.8.19; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; -import { L2MessageManager } from "../../messaging/l2/L2MessageManager.sol"; -import { IGenericErrors } from "../../interfaces/IGenericErrors.sol"; -import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol"; +import { L2MessageManager } from "../../../messaging/l2/L2MessageManager.sol"; +import { IGenericErrors } from "../../../interfaces/IGenericErrors.sol"; +import { TestSetPauseTypeRoles } from "../security/TestSetPauseTypeRoles.sol"; contract TestL2MessageManager is Initializable, L2MessageManager, IGenericErrors, TestSetPauseTypeRoles { /// @custom:oz-upgrades-unsafe-allow constructor diff --git a/contracts/src/_testing/unit/messaging/TestL2MessageService.sol b/contracts/src/_testing/unit/messaging/TestL2MessageService.sol index 8b1469533..9b1f4bce6 100644 --- a/contracts/src/_testing/unit/messaging/TestL2MessageService.sol +++ b/contracts/src/_testing/unit/messaging/TestL2MessageService.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.19; -import { L2MessageService } from "../../messaging/l2/L2MessageService.sol"; +import { L2MessageService } from "../../../messaging/l2/L2MessageService.sol"; contract TestL2MessageService is L2MessageService { address public originalSender; diff --git a/contracts/src/_testing/unit/messaging/TestMessageServiceBase.sol b/contracts/src/_testing/unit/messaging/TestMessageServiceBase.sol index 71705dcbd..2c7a3c10b 100644 --- a/contracts/src/_testing/unit/messaging/TestMessageServiceBase.sol +++ b/contracts/src/_testing/unit/messaging/TestMessageServiceBase.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity >=0.8.19 <=0.8.26; -import { MessageServiceBase } from "../../messaging/MessageServiceBase.sol"; +import { MessageServiceBase } from "../../../messaging/MessageServiceBase.sol"; contract TestMessageServiceBase is MessageServiceBase { function initialize(address _messageService, address _remoteSender) external initializer { diff --git a/contracts/src/_testing/unit/messaging/TestSparseMerkleTreeVerifier.sol b/contracts/src/_testing/unit/messaging/TestSparseMerkleTreeVerifier.sol index e7068999f..09e1c94bd 100644 --- a/contracts/src/_testing/unit/messaging/TestSparseMerkleTreeVerifier.sol +++ b/contracts/src/_testing/unit/messaging/TestSparseMerkleTreeVerifier.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { SparseMerkleTreeVerifier } from "../../messaging/libraries/SparseMerkleTreeVerifier.sol"; -import { EfficientLeftRightKeccak } from "../../libraries/EfficientLeftRightKeccak.sol"; +import { SparseMerkleTreeVerifier } from "../../../messaging/libraries/SparseMerkleTreeVerifier.sol"; +import { EfficientLeftRightKeccak } from "../../../libraries/EfficientLeftRightKeccak.sol"; contract TestSparseMerkleTreeVerifier { using SparseMerkleTreeVerifier for *; diff --git a/contracts/src/_testing/unit/rollup/TestLineaRollup.sol b/contracts/src/_testing/unit/rollup/TestLineaRollup.sol index 6233a55e9..823a82381 100644 --- a/contracts/src/_testing/unit/rollup/TestLineaRollup.sol +++ b/contracts/src/_testing/unit/rollup/TestLineaRollup.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { LineaRollup } from "../../rollup/LineaRollup.sol"; +import { LineaRollup } from "../../../rollup/LineaRollup.sol"; contract TestLineaRollup is LineaRollup { function addRollingHash(uint256 _messageNumber, bytes32 _messageHash) external { diff --git a/contracts/src/_testing/unit/rollup/TestLineaRollupV5.sol b/contracts/src/_testing/unit/rollup/TestLineaRollupV5.sol index 9fa1e15f2..6388810be 100644 --- a/contracts/src/_testing/unit/rollup/TestLineaRollupV5.sol +++ b/contracts/src/_testing/unit/rollup/TestLineaRollupV5.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.24; -import { LineaRollupV5 } from "../integration/LineaRollupV5.sol"; +import { LineaRollupV5 } from "../../integration/LineaRollupV5.sol"; contract TestLineaRollupV5 is LineaRollupV5 { function setDefaultShnarfExistValue(bytes32 _shnarf) external { diff --git a/contracts/src/_testing/unit/security/TestPauseManager.sol b/contracts/src/_testing/unit/security/TestPauseManager.sol index 152bc6f28..756225ba8 100644 --- a/contracts/src/_testing/unit/security/TestPauseManager.sol +++ b/contracts/src/_testing/unit/security/TestPauseManager.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity >=0.8.19 <=0.8.26; -import { PauseManager } from "../../security/pausing/PauseManager.sol"; +import { PauseManager } from "../../../security/pausing/PauseManager.sol"; import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol"; contract TestPauseManager is PauseManager, TestSetPauseTypeRoles { diff --git a/contracts/src/_testing/unit/security/TestRateLimiter.sol b/contracts/src/_testing/unit/security/TestRateLimiter.sol index b27f12e64..1d0b9c738 100644 --- a/contracts/src/_testing/unit/security/TestRateLimiter.sol +++ b/contracts/src/_testing/unit/security/TestRateLimiter.sol @@ -2,7 +2,7 @@ pragma solidity >=0.8.19 <=0.8.26; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; -import { RateLimiter } from "../../security/limiting/RateLimiter.sol"; +import { RateLimiter } from "../../../security/limiting/RateLimiter.sol"; contract TestRateLimiter is Initializable, RateLimiter { // we need eth to test the limits with diff --git a/contracts/src/_testing/unit/security/TestSetPauseTypeRoles.sol b/contracts/src/_testing/unit/security/TestSetPauseTypeRoles.sol index f8f6c8f4c..643ab63cd 100644 --- a/contracts/src/_testing/unit/security/TestSetPauseTypeRoles.sol +++ b/contracts/src/_testing/unit/security/TestSetPauseTypeRoles.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity >=0.8.19 <=0.8.26; -import { PauseManager } from "../../security/pausing/PauseManager.sol"; +import { PauseManager } from "../../../security/pausing/PauseManager.sol"; contract TestSetPauseTypeRoles is PauseManager { function initializePauseTypesAndPermissions( diff --git a/contracts/src/verifiers/PlonkVerifierForDataAggregation.sol b/contracts/src/verifiers/PlonkVerifierForDataAggregation.sol index 8670ce2a4..b7bbee3bf 100644 --- a/contracts/src/verifiers/PlonkVerifierForDataAggregation.sol +++ b/contracts/src/verifiers/PlonkVerifierForDataAggregation.sol @@ -19,29 +19,28 @@ pragma solidity 0.8.26; contract PlonkVerifierForDataAggregation { + uint256 private constant R_MOD = 21888242871839275222246405745257275088548364400416034343698204186575808495617; - uint256 private constant R_MOD_MINUS_ONE = - 21888242871839275222246405745257275088548364400416034343698204186575808495616; + uint256 private constant R_MOD_MINUS_ONE = 21888242871839275222246405745257275088548364400416034343698204186575808495616; uint256 private constant P_MOD = 21888242871839275222246405745257275088696311157297823662689037894645226208583; - + uint256 private constant G2_SRS_0_X_0 = 11559732032986387107991004021392285783925812861821192530917403151452391805634; uint256 private constant G2_SRS_0_X_1 = 10857046999023057135944570762232829481370756359578518086990519993285655852781; uint256 private constant G2_SRS_0_Y_0 = 4082367875863433681332203403145435568316851327593401208105741076214120093531; uint256 private constant G2_SRS_0_Y_1 = 8495653923123431417604973247489272438418190587263600148770280649306958101930; - + uint256 private constant G2_SRS_1_X_0 = 15805639136721018565402881920352193254830339253282065586954346329754995870280; uint256 private constant G2_SRS_1_X_1 = 19089565590083334368588890253123139704298730990782503769911324779715431555531; uint256 private constant G2_SRS_1_Y_0 = 9779648407879205346559610309258181044130619080926897934572699915909528404984; uint256 private constant G2_SRS_1_Y_1 = 6779728121489434657638426458390319301070371227460768374343986326751507916979; - + uint256 private constant G1_SRS_X = 14312776538779914388377568895031746459131577658076416373430523308756343304251; uint256 private constant G1_SRS_Y = 11763105256161367503191792604679297387056316997144156930871823008787082098465; // ----------------------- vk --------------------- uint256 private constant VK_NB_PUBLIC_INPUTS = 1; uint256 private constant VK_DOMAIN_SIZE = 16; - uint256 private constant VK_INV_DOMAIN_SIZE = - 20520227692349320520856005386178695395514091625390032197217066424914820464641; + uint256 private constant VK_INV_DOMAIN_SIZE = 20520227692349320520856005386178695395514091625390032197217066424914820464641; uint256 private constant VK_OMEGA = 14940766826517323942636479241147756311199852622225275649687664389641784935947; uint256 private constant VK_QL_COM_X = 3767637989833674092151354229632559107224950590673664856842061399469467338879; uint256 private constant VK_QL_COM_Y = 18545409996679466114224178746162553880737296402729089689774308937082946761979; @@ -53,21 +52,23 @@ contract PlonkVerifierForDataAggregation { uint256 private constant VK_QO_COM_Y = 10782414695040549646706468913781794882209258381887890407509684555513355143197; uint256 private constant VK_QK_COM_X = 309591480144351325314158474719361148480191595146291661238142838254651436989; uint256 private constant VK_QK_COM_Y = 12063173869829536468830946547606069911666129778788708678515573607390482939756; - + uint256 private constant VK_S1_COM_X = 12287072751694848944507699577006619791724925439540371477056092891137357229312; uint256 private constant VK_S1_COM_Y = 2469356406782415219782253630635766217009619642857495098799013714324696399305; - + uint256 private constant VK_S2_COM_X = 17261757720471042341269061128759148572672168808566386603388432325173708264418; uint256 private constant VK_S2_COM_Y = 20976565876611279190744172824963243461988367679364518747954008723085439460611; - + uint256 private constant VK_S3_COM_X = 18758025488249277181117376239193628449359868741625564388668468130204669284937; uint256 private constant VK_S3_COM_Y = 15566903578741238761792344329051427316196307361197991677131114502821508927172; - + uint256 private constant VK_COSET_SHIFT = 5; - + + uint256 private constant VK_QCP_0_X = 4559262075452024065272338216146989708834054079507534161096300708463935456394; uint256 private constant VK_QCP_0_Y = 1898950104727986554890445533779776634695458253078091580309593009754027486622; - + + uint256 private constant VK_INDEX_COMMIT_API_0 = 5; uint256 private constant VK_NB_CUSTOM_GATES = 1; @@ -77,7 +78,7 @@ contract PlonkVerifierForDataAggregation { uint256 private constant FIXED_PROOF_SIZE = 0x300; // offset proof - + uint256 private constant PROOF_L_COM_X = 0x0; uint256 private constant PROOF_L_COM_Y = 0x20; uint256 private constant PROOF_R_COM_X = 0x40; @@ -121,7 +122,7 @@ contract PlonkVerifierForDataAggregation { // -------- offset state // challenges to check the claimed quotient - + uint256 private constant STATE_ALPHA = 0x0; uint256 private constant STATE_BETA = 0x20; uint256 private constant STATE_GAMMA = 0x40; @@ -152,13 +153,15 @@ contract PlonkVerifierForDataAggregation { // -------- errors uint256 private constant ERROR_STRING_ID = 0x08c379a000000000000000000000000000000000000000000000000000000000; // selector for function Error(string) + // -------- utils (for hash_fr) - uint256 private constant HASH_FR_BB = 340282366920938463463374607431768211456; // 2**128 - uint256 private constant HASH_FR_ZERO_UINT256 = 0; - uint8 private constant HASH_FR_LEN_IN_BYTES = 48; - uint8 private constant HASH_FR_SIZE_DOMAIN = 11; - uint8 private constant HASH_FR_ONE = 1; - uint8 private constant HASH_FR_TWO = 2; + uint256 private constant HASH_FR_BB = 340282366920938463463374607431768211456; // 2**128 + uint256 private constant HASH_FR_ZERO_UINT256 = 0; + uint8 private constant HASH_FR_LEN_IN_BYTES = 48; + uint8 private constant HASH_FR_SIZE_DOMAIN = 11; + uint8 private constant HASH_FR_ONE = 1; + uint8 private constant HASH_FR_TWO = 2; + // -------- precompiles uint8 private constant SHA2 = 0x2; @@ -166,14 +169,17 @@ contract PlonkVerifierForDataAggregation { uint8 private constant EC_ADD = 0x6; uint8 private constant EC_MUL = 0x7; uint8 private constant EC_PAIR = 0x8; - + /// Verify a Plonk proof. /// Reverts if the proof or the public inputs are malformed. /// @param proof serialised plonk proof (using gnark's MarshalSolidity) /// @param public_inputs (must be reduced) /// @return success true if the proof passes false otherwise - function Verify(bytes calldata proof, uint256[] calldata public_inputs) public view returns (bool success) { + function Verify(bytes calldata proof, uint256[] calldata public_inputs) + public view returns(bool success) { + assembly { + let mem := mload(0x40) let freeMem := add(mem, STATE_LAST_MEM) @@ -305,23 +311,20 @@ contract PlonkVerifierForDataAggregation { // end errors ------------------------------------------------- // Beginning checks ------------------------------------------------- - + /// @param s actual number of public inputs function check_number_of_public_inputs(s) { if iszero(eq(s, VK_NB_PUBLIC_INPUTS)) { error_nb_public_inputs() } } - + /// Checks that the public inputs are < R_MOD. /// @param s number of public inputs /// @param p pointer to the public inputs array function check_inputs_size(s, p) { - for { - let i - } lt(i, s) { - i := add(i, 1) - } { + for {let i} lt(i, s) {i:=add(i,1)} + { if gt(calldataload(p), R_MOD_MINUS_ONE) { error_inputs_size() } @@ -332,16 +335,17 @@ contract PlonkVerifierForDataAggregation { /// Checks if the proof is of the correct size /// @param actual_proof_size size of the proof (not the expected size) function check_proof_size(actual_proof_size) { - let expected_proof_size := add(FIXED_PROOF_SIZE, mul(VK_NB_CUSTOM_GATES, 0x60)) + let expected_proof_size := add(FIXED_PROOF_SIZE, mul(VK_NB_CUSTOM_GATES,0x60)) if iszero(eq(actual_proof_size, expected_proof_size)) { - error_proof_size() + error_proof_size() } } - + /// Checks if the multiple openings of the polynomials are < R_MOD. /// @param aproof pointer to the beginning of the proof /// @dev the 'a' prepending proof is to have a local name function check_proof_openings_size(aproof) { + // PROOF_L_AT_ZETA let p := add(aproof, PROOF_L_AT_ZETA) if gt(calldataload(p), R_MOD_MINUS_ONE) { @@ -365,7 +369,7 @@ contract PlonkVerifierForDataAggregation { if gt(calldataload(p), R_MOD_MINUS_ONE) { error_proof_openings_size() } - + // PROOF_S2_AT_ZETA p := add(aproof, PROOF_S2_AT_ZETA) if gt(calldataload(p), R_MOD_MINUS_ONE) { @@ -379,18 +383,16 @@ contract PlonkVerifierForDataAggregation { } // PROOF_OPENING_QCP_AT_ZETA - + p := add(aproof, PROOF_OPENING_QCP_AT_ZETA) - for { - let i := 0 - } lt(i, VK_NB_CUSTOM_GATES) { - i := add(i, 1) - } { + for {let i:=0} lt(i, VK_NB_CUSTOM_GATES) {i:=add(i,1)} + { if gt(calldataload(p), R_MOD_MINUS_ONE) { error_proof_openings_size() } p := add(p, 0x20) } + } // end checks ------------------------------------------------- @@ -412,32 +414,34 @@ contract PlonkVerifierForDataAggregation { /// and is encoded as a uint256 number n. In basis b = 256, the number looks like this /// [0 0 0 .. 0x67 0x61 0x6d, 0x6d, 0x61]. The first non zero entry is at position 27=0x1b /// Gamma reduced (the actual challenge) is stored at add(state, state_gamma) - function derive_gamma(aproof, nb_pi, pi) -> gamma_not_reduced { + function derive_gamma(aproof, nb_pi, pi)->gamma_not_reduced { + let state := mload(0x40) let mPtr := add(state, STATE_LAST_MEM) mstore(mPtr, FS_GAMMA) // "gamma" - mstore(add(mPtr, 0x20), VK_S1_COM_X) - mstore(add(mPtr, 0x40), VK_S1_COM_Y) - mstore(add(mPtr, 0x60), VK_S2_COM_X) - mstore(add(mPtr, 0x80), VK_S2_COM_Y) - mstore(add(mPtr, 0xa0), VK_S3_COM_X) - mstore(add(mPtr, 0xc0), VK_S3_COM_Y) - mstore(add(mPtr, 0xe0), VK_QL_COM_X) - mstore(add(mPtr, 0x100), VK_QL_COM_Y) - mstore(add(mPtr, 0x120), VK_QR_COM_X) - mstore(add(mPtr, 0x140), VK_QR_COM_Y) - mstore(add(mPtr, 0x160), VK_QM_COM_X) - mstore(add(mPtr, 0x180), VK_QM_COM_Y) - mstore(add(mPtr, 0x1a0), VK_QO_COM_X) - mstore(add(mPtr, 0x1c0), VK_QO_COM_Y) - mstore(add(mPtr, 0x1e0), VK_QK_COM_X) - mstore(add(mPtr, 0x200), VK_QK_COM_Y) - - mstore(add(mPtr, 0x220), VK_QCP_0_X) - mstore(add(mPtr, 0x240), VK_QCP_0_Y) - + + mstore(add(mPtr, 0x20), VK_S1_COM_X) + mstore(add(mPtr, 0x40), VK_S1_COM_Y) + mstore(add(mPtr, 0x60), VK_S2_COM_X) + mstore(add(mPtr, 0x80), VK_S2_COM_Y) + mstore(add(mPtr, 0xa0), VK_S3_COM_X) + mstore(add(mPtr, 0xc0), VK_S3_COM_Y) + mstore(add(mPtr, 0xe0), VK_QL_COM_X) + mstore(add(mPtr, 0x100), VK_QL_COM_Y) + mstore(add(mPtr, 0x120), VK_QR_COM_X) + mstore(add(mPtr, 0x140), VK_QR_COM_Y) + mstore(add(mPtr, 0x160), VK_QM_COM_X) + mstore(add(mPtr, 0x180), VK_QM_COM_Y) + mstore(add(mPtr, 0x1a0), VK_QO_COM_X) + mstore(add(mPtr, 0x1c0), VK_QO_COM_Y) + mstore(add(mPtr, 0x1e0), VK_QK_COM_X) + mstore(add(mPtr, 0x200), VK_QK_COM_Y) + + mstore(add(mPtr, 0x220), VK_QCP_0_X) + mstore(add(mPtr, 0x240), VK_QCP_0_Y) + // public inputs let _mPtr := add(mPtr, 0x260) let size_pi_in_bytes := mul(nb_pi, 0x20) @@ -454,7 +458,7 @@ contract PlonkVerifierForDataAggregation { // + nb_public_inputs*0x20 // + nb_custom gates*0x40 let size := add(0x2c5, size_pi_in_bytes) - + size := add(size, mul(VK_NB_CUSTOM_GATES, 0x40)) let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1b), size, mPtr, 0x20) //0x1b -> 000.."gamma" if iszero(l_success) { @@ -469,7 +473,8 @@ contract PlonkVerifierForDataAggregation { /// @return beta_not_reduced the next challenge, beta, not reduced /// @notice the transcript consists of the previous challenge only. /// The reduced version of beta is stored at add(state, state_beta) - function derive_beta(gamma_not_reduced) -> beta_not_reduced { + function derive_beta(gamma_not_reduced)->beta_not_reduced{ + let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) @@ -490,8 +495,9 @@ contract PlonkVerifierForDataAggregation { /// @return alpha_not_reduced the next challenge, alpha, not reduced /// @notice the transcript consists of the previous challenge (beta) /// not reduced, the commitments to the wires associated to the QCP_i, - /// and the commitment to the grand product polynomial - function derive_alpha(aproof, beta_not_reduced) -> alpha_not_reduced { + /// and the commitment to the grand product polynomial + function derive_alpha(aproof, beta_not_reduced)->alpha_not_reduced { + let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) let full_size := 0x65 // size("alpha") + 0x20 (previous challenge) @@ -501,14 +507,14 @@ contract PlonkVerifierForDataAggregation { let _mPtr := add(mPtr, 0x20) mstore(_mPtr, beta_not_reduced) _mPtr := add(_mPtr, 0x20) - + // Bsb22Commitments let proof_bsb_commitments := add(aproof, PROOF_BSB_COMMITMENTS) let size_bsb_commitments := mul(0x40, VK_NB_CUSTOM_GATES) calldatacopy(_mPtr, proof_bsb_commitments, size_bsb_commitments) _mPtr := add(_mPtr, size_bsb_commitments) full_size := add(full_size, size_bsb_commitments) - + // [Z], the commitment to the grand product polynomial calldatacopy(_mPtr, add(aproof, PROOF_GRAND_PRODUCT_COMMITMENT_X), 0x40) let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1b), full_size, mPtr, 0x20) @@ -526,6 +532,7 @@ contract PlonkVerifierForDataAggregation { /// The transcript consists of the previous challenge and the commitment to /// the quotient polynomial h. function derive_zeta(aproof, alpha_not_reduced) { + let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) @@ -550,7 +557,8 @@ contract PlonkVerifierForDataAggregation { /// @param n number of public inputs /// @param mPtr free memory /// @return pi_wo_commit public inputs contribution (except the public inputs coming from the custom gate) - function sum_pi_wo_api_commit(ins, n, mPtr) -> pi_wo_commit { + function sum_pi_wo_api_commit(ins, n, mPtr)->pi_wo_commit { + let state := mload(0x40) let z := mload(add(state, STATE_ZETA)) let zpnmo := mload(add(state, STATE_ZETA_POWER_N_MINUS_ONE)) @@ -559,16 +567,14 @@ contract PlonkVerifierForDataAggregation { batch_compute_lagranges_at_z(z, zpnmo, n, li) let tmp := 0 - for { - let i := 0 - } lt(i, n) { - i := add(i, 1) - } { + for {let i:=0} lt(i,n) {i:=add(i,1)} + { tmp := mulmod(mload(li), calldataload(ins), R_MOD) pi_wo_commit := addmod(pi_wo_commit, tmp, R_MOD) li := add(li, 0x20) ins := add(ins, 0x20) } + } /// batch_compute_lagranges_at_z computes [L_0(z), .., L_{n-1}(z)] @@ -577,32 +583,27 @@ contract PlonkVerifierForDataAggregation { /// @param n_pub number of public inputs (number of Lagranges to compute) /// @param mPtr pointer to which the results are stored function batch_compute_lagranges_at_z(z, zpnmo, n_pub, mPtr) { - let zn := mulmod(zpnmo, VK_INV_DOMAIN_SIZE, R_MOD) // 1/n * (ζⁿ - 1) + let zn := mulmod(zpnmo, VK_INV_DOMAIN_SIZE, R_MOD) // 1/n * (ζⁿ - 1) + let _w := 1 let _mPtr := mPtr - for { - let i := 0 - } lt(i, n_pub) { - i := add(i, 1) - } { - mstore(_mPtr, addmod(z, sub(R_MOD, _w), R_MOD)) + for {let i:=0} lt(i,n_pub) {i:=add(i,1)} + { + mstore(_mPtr, addmod(z,sub(R_MOD, _w), R_MOD)) _w := mulmod(_w, VK_OMEGA, R_MOD) _mPtr := add(_mPtr, 0x20) } batch_invert(mPtr, n_pub, _mPtr) _mPtr := mPtr _w := 1 - for { - let i := 0 - } lt(i, n_pub) { - i := add(i, 1) - } { - mstore(_mPtr, mulmod(mulmod(mload(_mPtr), zn, R_MOD), _w, R_MOD)) + for {let i:=0} lt(i,n_pub) {i:=add(i,1)} + { + mstore(_mPtr, mulmod(mulmod(mload(_mPtr), zn , R_MOD), _w, R_MOD)) _mPtr := add(_mPtr, 0x20) _w := mulmod(_w, VK_OMEGA, R_MOD) } - } + } /// @notice Montgomery trick for batch inversion mod R_MOD /// @param ins pointer to the data to batch invert @@ -611,11 +612,8 @@ contract PlonkVerifierForDataAggregation { function batch_invert(ins, nb_ins, mPtr) { mstore(mPtr, 1) let offset := 0 - for { - let i := 0 - } lt(i, nb_ins) { - i := add(i, 1) - } { + for {let i:=0} lt(i, nb_ins) {i:=add(i,1)} + { let prev := mload(add(mPtr, offset)) let cur := mload(add(ins, offset)) cur := mulmod(prev, cur, R_MOD) @@ -624,12 +622,9 @@ contract PlonkVerifierForDataAggregation { } ins := add(ins, sub(offset, 0x20)) mPtr := add(mPtr, offset) - let inv := pow(mload(mPtr), sub(R_MOD, 2), add(mPtr, 0x20)) - for { - let i := 0 - } lt(i, nb_ins) { - i := add(i, 1) - } { + let inv := pow(mload(mPtr), sub(R_MOD,2), add(mPtr, 0x20)) + for {let i:=0} lt(i, nb_ins) {i:=add(i,1)} + { mPtr := sub(mPtr, 0x20) let tmp := mload(ins) let cur := mulmod(inv, mload(mPtr), R_MOD) @@ -639,12 +634,14 @@ contract PlonkVerifierForDataAggregation { } } + /// Public inputs (the ones coming from the custom gate) contribution /// @param aproof pointer to the proof /// @param nb_public_inputs number of public inputs /// @param mPtr pointer to free memory /// @return pi_commit custom gate public inputs contribution - function sum_pi_commit(aproof, nb_public_inputs, mPtr) -> pi_commit { + function sum_pi_commit(aproof, nb_public_inputs, mPtr)->pi_commit { + let state := mload(0x40) let z := mload(add(state, STATE_ZETA)) let zpnmo := mload(add(state, STATE_ZETA_POWER_N_MINUS_ONE)) @@ -652,10 +649,14 @@ contract PlonkVerifierForDataAggregation { let p := add(aproof, PROOF_BSB_COMMITMENTS) let h_fr, ith_lagrange - + + h_fr := hash_fr(calldataload(p), calldataload(add(p, 0x20)), mPtr) ith_lagrange := compute_ith_lagrange_at_z(z, zpnmo, add(nb_public_inputs, VK_INDEX_COMMIT_API_0), mPtr) pi_commit := addmod(pi_commit, mulmod(h_fr, ith_lagrange, R_MOD), R_MOD) + + + } /// Computes L_i(zeta) = ωⁱ/n * (ζⁿ-1)/(ζ-ωⁱ) where: @@ -663,14 +664,16 @@ contract PlonkVerifierForDataAggregation { /// @param zpmno ζⁿ-1 /// @param i i-th lagrange /// @param mPtr free memory - /// @return res = ωⁱ/n * (ζⁿ-1)/(ζ-ωⁱ) - function compute_ith_lagrange_at_z(z, zpnmo, i, mPtr) -> res { + /// @return res = ωⁱ/n * (ζⁿ-1)/(ζ-ωⁱ) + function compute_ith_lagrange_at_z(z, zpnmo, i, mPtr)->res { + let w := pow(VK_OMEGA, i, mPtr) // w**i i := addmod(z, sub(R_MOD, w), R_MOD) // z-w**i w := mulmod(w, VK_INV_DOMAIN_SIZE, R_MOD) // w**i/n - i := pow(i, sub(R_MOD, 2), mPtr) // (z-w**i)**-1 + i := pow(i, sub(R_MOD,2), mPtr) // (z-w**i)**-1 w := mulmod(w, i, R_MOD) // w**i/n*(z-w)**-1 res := mulmod(w, zpnmo, R_MOD) + } /// @dev https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06#section-5.2 @@ -678,14 +681,15 @@ contract PlonkVerifierForDataAggregation { /// @param y y coordinate of a point on Bn254(𝔽_p) /// @param mPtr free memory /// @return res an element mod R_MOD - function hash_fr(x, y, mPtr) -> res { + function hash_fr(x, y, mPtr)->res { + // [0x00, .. , 0x00 || x, y, || 0, 48, 0, dst, HASH_FR_SIZE_DOMAIN] // <- 64 bytes -> <-64b -> <- 1 bytes each -> // [0x00, .., 0x00] 64 bytes of zero mstore(mPtr, HASH_FR_ZERO_UINT256) mstore(add(mPtr, 0x20), HASH_FR_ZERO_UINT256) - + // msg = x || y , both on 32 bytes mstore(add(mPtr, 0x40), x) mstore(add(mPtr, 0x60), y) @@ -721,7 +725,7 @@ contract PlonkVerifierForDataAggregation { // [b0 || one || dst || HASH_FR_SIZE_DOMAIN] // <-64bytes -> <- 1 byte each -> mstore8(add(mPtr, 0x20), HASH_FR_ONE) // 1 - + mstore8(add(mPtr, 0x21), 0x42) // dst mstore8(add(mPtr, 0x22), 0x53) mstore8(add(mPtr, 0x23), 0x42) @@ -773,8 +777,9 @@ contract PlonkVerifierForDataAggregation { res := mulmod(mload(mPtr), HASH_FR_BB, R_MOD) // <- res = 2**128 * mPtr[:32] let b1 := shr(128, mload(add(mPtr, 0x20))) // b1 <- [0, 0, .., 0 || b2[:16] ] res := addmod(res, b1, R_MOD) - } + } + // END compute_pi ------------------------------------------------- /// @notice compute α² * 1/n * (ζ{n}-1)/(ζ - 1) where @@ -782,7 +787,7 @@ contract PlonkVerifierForDataAggregation { /// * n = vk_domain_size /// * ω = vk_omega (generator of the multiplicative cyclic group of order n in (ℤ/rℤ)*) /// * ζ = zeta (challenge derived with Fiat Shamir) - function compute_alpha_square_lagrange_0() { + function compute_alpha_square_lagrange_0() { let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) @@ -822,7 +827,7 @@ contract PlonkVerifierForDataAggregation { mstore(add(mPtr, 0x100), mload(add(state, STATE_ZETA))) mstore(add(mPtr, 0x120), mload(add(state, STATE_GAMMA_KZG))) let random := staticcall(gas(), SHA2, mPtr, 0x140, mPtr, 0x20) - if iszero(random) { + if iszero(random){ error_random_generation() } random := mod(mload(mPtr), R_MOD) // use the same variable as we are one variable away from getting stack-too-deep error... @@ -871,18 +876,18 @@ contract PlonkVerifierForDataAggregation { mstore(folded_quotients_y, sub(P_MOD, mload(folded_quotients_y))) mstore(mPtr, mload(folded_digests)) - - mstore(add(mPtr, 0x20), mload(add(folded_digests, 0x20))) - mstore(add(mPtr, 0x40), G2_SRS_0_X_0) // the 4 lines are the canonical G2 point on BN254 - mstore(add(mPtr, 0x60), G2_SRS_0_X_1) - mstore(add(mPtr, 0x80), G2_SRS_0_Y_0) - mstore(add(mPtr, 0xa0), G2_SRS_0_Y_1) - mstore(add(mPtr, 0xc0), mload(folded_quotients)) - mstore(add(mPtr, 0xe0), mload(add(folded_quotients, 0x20))) - mstore(add(mPtr, 0x100), G2_SRS_1_X_0) - mstore(add(mPtr, 0x120), G2_SRS_1_X_1) - mstore(add(mPtr, 0x140), G2_SRS_1_Y_0) - mstore(add(mPtr, 0x160), G2_SRS_1_Y_1) + + mstore(add(mPtr, 0x20), mload(add(folded_digests, 0x20))) + mstore(add(mPtr, 0x40), G2_SRS_0_X_0) // the 4 lines are the canonical G2 point on BN254 + mstore(add(mPtr, 0x60), G2_SRS_0_X_1) + mstore(add(mPtr, 0x80), G2_SRS_0_Y_0) + mstore(add(mPtr, 0xa0), G2_SRS_0_Y_1) + mstore(add(mPtr, 0xc0), mload(folded_quotients)) + mstore(add(mPtr, 0xe0), mload(add(folded_quotients, 0x20))) + mstore(add(mPtr, 0x100), G2_SRS_1_X_0) + mstore(add(mPtr, 0x120), G2_SRS_1_X_1) + mstore(add(mPtr, 0x140), G2_SRS_1_Y_0) + mstore(add(mPtr, 0x160), G2_SRS_1_Y_1) check_pairing_kzg(mPtr) } @@ -907,6 +912,7 @@ contract PlonkVerifierForDataAggregation { /// @param aproof pointer to the proof /// acc_gamma stores the γⁱ function fold_state(aproof) { + let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) let mPtr20 := add(mPtr, 0x20) @@ -943,14 +949,15 @@ contract PlonkVerifierForDataAggregation { point_acc_mul(state_folded_digests, mPtr, acc_gamma, mPtr40) fr_acc_mul_calldata(add(state, STATE_FOLDED_CLAIMED_VALUES), add(aproof, PROOF_S2_AT_ZETA), acc_gamma) let poqaz := add(aproof, PROOF_OPENING_QCP_AT_ZETA) - + acc_gamma := mulmod(acc_gamma, l_gamma_kzg, R_MOD) mstore(mPtr, VK_QCP_0_X) mstore(mPtr20, VK_QCP_0_Y) point_acc_mul(state_folded_digests, mPtr, acc_gamma, mPtr40) fr_acc_mul_calldata(add(state, STATE_FOLDED_CLAIMED_VALUES), poqaz, acc_gamma) poqaz := add(poqaz, 0x20) - } + + } /// @notice generate the challenge (using Fiat Shamir) to fold the opening proofs /// at ζ. @@ -968,22 +975,23 @@ contract PlonkVerifierForDataAggregation { /// * Z(ζω) /// @param aproof pointer to the proof function compute_gamma_kzg(aproof) { + let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) mstore(mPtr, FS_GAMMA_KZG) // "gamma" mstore(add(mPtr, 0x20), mload(add(state, STATE_ZETA))) - mstore(add(mPtr, 0x40), mload(add(state, STATE_LINEARISED_POLYNOMIAL_X))) - mstore(add(mPtr, 0x60), mload(add(state, STATE_LINEARISED_POLYNOMIAL_Y))) + mstore(add(mPtr,0x40), mload(add(state, STATE_LINEARISED_POLYNOMIAL_X))) + mstore(add(mPtr,0x60), mload(add(state, STATE_LINEARISED_POLYNOMIAL_Y))) calldatacopy(add(mPtr, 0x80), add(aproof, PROOF_L_COM_X), 0xc0) - mstore(add(mPtr, 0x140), VK_S1_COM_X) - mstore(add(mPtr, 0x160), VK_S1_COM_Y) - mstore(add(mPtr, 0x180), VK_S2_COM_X) - mstore(add(mPtr, 0x1a0), VK_S2_COM_Y) - + mstore(add(mPtr,0x140), VK_S1_COM_X) + mstore(add(mPtr,0x160), VK_S1_COM_Y) + mstore(add(mPtr,0x180), VK_S2_COM_X) + mstore(add(mPtr,0x1a0), VK_S2_COM_Y) + let offset := 0x1c0 - - mstore(add(mPtr, offset), VK_QCP_0_X) - mstore(add(mPtr, add(offset, 0x20)), VK_QCP_0_Y) + + mstore(add(mPtr,offset), VK_QCP_0_X) + mstore(add(mPtr,add(offset, 0x20)), VK_QCP_0_Y) offset := add(offset, 0x40) mstore(add(mPtr, offset), mload(add(state, STATE_OPENING_LINEARISED_POLYNOMIAL_ZETA))) mstore(add(mPtr, add(offset, 0x20)), calldataload(add(aproof, PROOF_L_AT_ZETA))) @@ -994,23 +1002,18 @@ contract PlonkVerifierForDataAggregation { let _mPtr := add(mPtr, add(offset, 0xc0)) + let _poqaz := add(aproof, PROOF_OPENING_QCP_AT_ZETA) calldatacopy(_mPtr, _poqaz, mul(VK_NB_CUSTOM_GATES, 0x20)) _mPtr := add(_mPtr, mul(VK_NB_CUSTOM_GATES, 0x20)) + mstore(_mPtr, calldataload(add(aproof, PROOF_GRAND_PRODUCT_AT_ZETA_OMEGA))) let start_input := 0x1b // 00.."gamma" - let size_input := add(0x14, mul(VK_NB_CUSTOM_GATES, 3)) // number of 32bytes elmts = 0x14 (zeta+3*6 for the digests+openings) + 3*VK_NB_CUSTOM_GATES (for the commitments of the selectors) + 1 (opening of Z at ζω) + let size_input := add(0x14, mul(VK_NB_CUSTOM_GATES,3)) // number of 32bytes elmts = 0x14 (zeta+3*6 for the digests+openings) + 3*VK_NB_CUSTOM_GATES (for the commitments of the selectors) + 1 (opening of Z at ζω) size_input := add(0x5, mul(size_input, 0x20)) // size in bytes: 15*32 bytes + 5 bytes for gamma - let check_staticcall := staticcall( - gas(), - SHA2, - add(mPtr, start_input), - size_input, - add(state, STATE_GAMMA_KZG), - 0x20 - ) + let check_staticcall := staticcall(gas(), SHA2, add(mPtr,start_input), size_input, add(state, STATE_GAMMA_KZG), 0x20) if iszero(check_staticcall) { error_verify() } @@ -1018,6 +1021,7 @@ contract PlonkVerifierForDataAggregation { } function compute_commitment_linearised_polynomial_ec(aproof, s1, s2) { + let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) @@ -1062,6 +1066,7 @@ contract PlonkVerifierForDataAggregation { add(mPtr, 0x40) ) + let qcp_opening_at_zeta := add(aproof, PROOF_OPENING_QCP_AT_ZETA) let bsb_commitments := add(aproof, PROOF_BSB_COMMITMENTS) for { @@ -1080,6 +1085,7 @@ contract PlonkVerifierForDataAggregation { qcp_opening_at_zeta := add(qcp_opening_at_zeta, 0x20) bsb_commitments := add(bsb_commitments, 0x40) } + mstore(mPtr, VK_S3_COM_X) mstore(add(mPtr, 0x20), VK_S3_COM_Y) @@ -1090,11 +1096,10 @@ contract PlonkVerifierForDataAggregation { point_acc_mul(add(state, STATE_LINEARISED_POLYNOMIAL_X), mPtr, s2, add(mPtr, 0x40)) point_add( - add(state, STATE_LINEARISED_POLYNOMIAL_X), - add(state, STATE_LINEARISED_POLYNOMIAL_X), - add(state, STATE_FOLDED_H_X), - mPtr - ) + add(state, STATE_LINEARISED_POLYNOMIAL_X), + add(state, STATE_LINEARISED_POLYNOMIAL_X), + add(state, STATE_FOLDED_H_X), + mPtr) } /// @notice Compute the commitment to the linearized polynomial equal to @@ -1161,25 +1166,10 @@ contract PlonkVerifierForDataAggregation { let mPtr := add(mload(0x40), STATE_LAST_MEM) let zeta_power_n_plus_two := pow(mload(add(state, STATE_ZETA)), n_plus_two, mPtr) point_mul_calldata(add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_2_COM_X), zeta_power_n_plus_two, mPtr) - point_add_calldata( - add(state, STATE_FOLDED_H_X), - add(state, STATE_FOLDED_H_X), - add(aproof, PROOF_H_1_COM_X), - mPtr - ) + point_add_calldata(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_1_COM_X), mPtr) point_mul(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), zeta_power_n_plus_two, mPtr) - point_add_calldata( - add(state, STATE_FOLDED_H_X), - add(state, STATE_FOLDED_H_X), - add(aproof, PROOF_H_0_COM_X), - mPtr - ) - point_mul( - add(state, STATE_FOLDED_H_X), - add(state, STATE_FOLDED_H_X), - mload(add(state, STATE_ZETA_POWER_N_MINUS_ONE)), - mPtr - ) + point_add_calldata(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_0_COM_X), mPtr) + point_mul(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), mload(add(state, STATE_ZETA_POWER_N_MINUS_ONE)), mPtr) let folded_h_y := mload(add(state, STATE_FOLDED_H_Y)) folded_h_y := sub(P_MOD, folded_h_y) mstore(add(state, STATE_FOLDED_H_Y), folded_h_y) @@ -1189,6 +1179,7 @@ contract PlonkVerifierForDataAggregation { /// - [ PI(ζ) - α²*L₁(ζ) + α(l(ζ)+β*s1(ζ)+γ)(r(ζ)+β*s2(ζ)+γ)(o(ζ)+γ)*z(ωζ) ] /// @param aproof pointer to the proof function compute_opening_linearised_polynomial(aproof) { + let state := mload(0x40) // (l(ζ)+β*s1(ζ)+γ) @@ -1224,7 +1215,7 @@ contract PlonkVerifierForDataAggregation { } // BEGINNING utils math functions ------------------------------------------------- - + /// @param dst pointer storing the result /// @param p pointer to the first point /// @param q pointer to the second point @@ -1234,7 +1225,7 @@ contract PlonkVerifierForDataAggregation { mstore(add(mPtr, 0x20), mload(add(p, 0x20))) mstore(add(mPtr, 0x40), mload(q)) mstore(add(mPtr, 0x60), mload(add(q, 0x20))) - let l_success := staticcall(gas(), EC_ADD, mPtr, 0x80, dst, 0x40) + let l_success := staticcall(gas(),EC_ADD,mPtr,0x80,dst,0x40) if iszero(l_success) { error_ec_op() } @@ -1259,11 +1250,11 @@ contract PlonkVerifierForDataAggregation { /// @param src pointer to a point on Bn254(𝔽_p) /// @param s scalar /// @param mPtr free memory - function point_mul(dst, src, s, mPtr) { - mstore(mPtr, mload(src)) - mstore(add(mPtr, 0x20), mload(add(src, 0x20))) - mstore(add(mPtr, 0x40), s) - let l_success := staticcall(gas(), EC_MUL, mPtr, 0x60, dst, 0x40) + function point_mul(dst,src,s, mPtr) { + mstore(mPtr,mload(src)) + mstore(add(mPtr,0x20),mload(add(src,0x20))) + mstore(add(mPtr,0x40),s) + let l_success := staticcall(gas(),EC_MUL,mPtr,0x60,dst,0x40) if iszero(l_success) { error_ec_op() } @@ -1288,14 +1279,14 @@ contract PlonkVerifierForDataAggregation { /// @param src pointer to the point to multiply and add /// @param s scalar /// @param mPtr free memory - function point_acc_mul(dst, src, s, mPtr) { - mstore(mPtr, mload(src)) - mstore(add(mPtr, 0x20), mload(add(src, 0x20))) - mstore(add(mPtr, 0x40), s) - let l_success := staticcall(gas(), 7, mPtr, 0x60, mPtr, 0x40) - mstore(add(mPtr, 0x40), mload(dst)) - mstore(add(mPtr, 0x60), mload(add(dst, 0x20))) - l_success := and(l_success, staticcall(gas(), EC_ADD, mPtr, 0x80, dst, 0x40)) + function point_acc_mul(dst,src,s, mPtr) { + mstore(mPtr,mload(src)) + mstore(add(mPtr,0x20),mload(add(src,0x20))) + mstore(add(mPtr,0x40),s) + let l_success := staticcall(gas(),7,mPtr,0x60,mPtr,0x40) + mstore(add(mPtr,0x40),mload(dst)) + mstore(add(mPtr,0x60),mload(add(dst,0x20))) + l_success := and(l_success, staticcall(gas(),EC_ADD,mPtr,0x80,dst, 0x40)) if iszero(l_success) { error_ec_op() } @@ -1324,7 +1315,7 @@ contract PlonkVerifierForDataAggregation { /// @param src pointer to the scalar to multiply and add (on calldata) /// @param s scalar function fr_acc_mul_calldata(dst, src, s) { - let tmp := mulmod(calldataload(src), s, R_MOD) + let tmp := mulmod(calldataload(src), s, R_MOD) mstore(dst, addmod(mload(dst), tmp, R_MOD)) } @@ -1332,16 +1323,16 @@ contract PlonkVerifierForDataAggregation { /// @param e exponent /// @param mPtr free memory /// @return res x ** e mod r - function pow(x, e, mPtr) -> res { + function pow(x, e, mPtr)->res { mstore(mPtr, 0x20) mstore(add(mPtr, 0x20), 0x20) mstore(add(mPtr, 0x40), 0x20) mstore(add(mPtr, 0x60), x) mstore(add(mPtr, 0x80), e) mstore(add(mPtr, 0xa0), R_MOD) - let check_staticcall := staticcall(gas(), MOD_EXP, mPtr, 0xc0, mPtr, 0x20) + let check_staticcall := staticcall(gas(),MOD_EXP,mPtr,0xc0,mPtr,0x20) if eq(check_staticcall, 0) { - error_mod_exp() + error_mod_exp() } res := mload(mPtr) } diff --git a/contracts/test/common/constants/submissionData.ts b/contracts/test/common/constants/submissionData.ts deleted file mode 100644 index 79f62ea7c..000000000 --- a/contracts/test/common/constants/submissionData.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { HASH_ZERO } from "./general"; - -import firstCompressedDataContent from "../../testData/compressedData/blocks-1-46.json"; -import fourthCompressedDataContent from "../../testData/compressedData/blocks-115-155.json"; -import secondCompressedDataContent from "../../testData/compressedData/blocks-47-81.json"; -import thirdCompressedDataContent from "../../testData/compressedData/blocks-82-114.json"; -import fourthBlobDataContent from "../../testData/compressedDataEip4844/blocks-115-155.json"; -import thirdBlobDataContent from "../../testData/compressedDataEip4844/blocks-82-114.json"; -import secondBlobDataContent from "../../testData/compressedDataEip4844/blocks-47-81.json"; -import firstBlobDataContent from "../../testData/compressedDataEip4844/blocks-1-46.json"; - -import firstCompressedDataContent_multiple from "../../testData/compressedData/multipleProofs/blocks-1-46.json"; -import secondCompressedDataContent_multiple from "../../testData/compressedData/multipleProofs/blocks-47-81.json"; -import thirdCompressedDataContent_multiple from "../../testData/compressedData/multipleProofs/blocks-82-119.json"; -import fourthCompressedDataContent_multiple from "../../testData/compressedData/multipleProofs/blocks-120-153.json"; - -import firstBlobContent_multiple from "../../testData/compressedDataEip4844/multipleProofs/blocks-1-46.json"; -import secondBlobContent_multiple from "../../testData/compressedDataEip4844/multipleProofs/blocks-47-81.json"; -import thirdBlobContent_multiple from "../../testData/compressedDataEip4844/multipleProofs/blocks-82-119.json"; -import fourthBlobContent_multiple from "../../testData/compressedDataEip4844/multipleProofs/blocks-120-153.json"; - -export const DEFAULT_SUBMISSION_DATA = { - dataParentHash: HASH_ZERO, - compressedData: "0x", - finalBlockInData: 0n, - firstBlockInData: 0n, - parentStateRootHash: HASH_ZERO, - finalStateRootHash: HASH_ZERO, - snarkHash: HASH_ZERO, -}; - -export const COMPRESSED_SUBMISSION_DATA = [ - firstCompressedDataContent, - secondCompressedDataContent, - thirdCompressedDataContent, - fourthCompressedDataContent, -]; - -export const BLOB_SUBMISSION_DATA = [ - firstBlobDataContent, - secondBlobDataContent, - thirdBlobDataContent, - fourthBlobDataContent, -]; - -export const COMPRESSED_SUBMISSION_DATA_MULTIPLE_PROOF = [ - firstCompressedDataContent_multiple, - secondCompressedDataContent_multiple, - thirdCompressedDataContent_multiple, - fourthCompressedDataContent_multiple, -]; - -export const BLOB_SUBMISSION_DATA_MULTIPLE_PROOF = [ - firstBlobContent_multiple, - secondBlobContent_multiple, - thirdBlobContent_multiple, - fourthBlobContent_multiple, -]; diff --git a/contracts/test/L1MessageService.ts b/contracts/test/hardhat/L1MessageService.ts similarity index 99% rename from contracts/test/L1MessageService.ts rename to contracts/test/hardhat/L1MessageService.ts index 599b2b23c..410cbb1ab 100644 --- a/contracts/test/L1MessageService.ts +++ b/contracts/test/hardhat/L1MessageService.ts @@ -8,7 +8,7 @@ import { TestL1MessageServiceMerkleProof, TestL1RevertContract, TestReceivingContract, -} from "../typechain-types"; +} from "../../typechain-types"; import { ADDRESS_ZERO, DEFAULT_ADMIN_ROLE, diff --git a/contracts/test/upgrades/verify_L2MessageService_Upgrade.ts b/contracts/test/hardhat/_manualTesting/verify_L2MessageService_Upgrade.ts similarity index 100% rename from contracts/test/upgrades/verify_L2MessageService_Upgrade.ts rename to contracts/test/hardhat/_manualTesting/verify_L2MessageService_Upgrade.ts diff --git a/contracts/test/upgrades/verify_LineaRollup_Upgrade.ts b/contracts/test/hardhat/_manualTesting/verify_LineaRollup_Upgrade.ts similarity index 100% rename from contracts/test/upgrades/verify_LineaRollup_Upgrade.ts rename to contracts/test/hardhat/_manualTesting/verify_LineaRollup_Upgrade.ts diff --git a/contracts/test/hardhat/_testData/compressedData/aggregatedProof-1-155.json b/contracts/test/hardhat/_testData/compressedData/aggregatedProof-1-155.json new file mode 100644 index 000000000..d792dfe3c --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedData/aggregatedProof-1-155.json @@ -0,0 +1,27 @@ +{ + "finalShnarf": "0xdf1e9f621e3a89f02d44dbc266056d50d5d1524dc4d135f93b81619f3d674b7c", + "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", + "aggregatedProof": "0x0fca908fdabf2e4a48549b3169fc32f03d9bead71a949b3f321fe015368eda2907dd0c4d0ca22989d6beb8e98e379c2e6e26d5f92a7fc174e794b01f19f5a0260f846571ee911b857ea377e1d6e97d8667c32772db9bd5c771f26a5f0307d8d90627bd4efe26fa407774622155acc312139da21e89675c461198443312215ec2303185e66a815aadd406bd85cad499ba0f36ecbdc0cd5d85442f0045d5e5e51d1089fb10695fed82746e83ce265c8bc5aabe5562358dccb22f0e98f5254aef25157cbc8f0acef75219e160c6d42ce666e65b3850118a9fa062ada9d7fb65c0b22eedd8fa728240b123bb4e232f1951b531b3f09fb708b8ce33928e197c90b6b5060dcf56d254007fe6886a5bef306026d4a6a962792e00de026acef0210fbe280b89934a94d8c37ac6012f0ee450204f626b7ffdde445ae90f83b710e901ec6a255159d6288f7af1e49b681873fccbf5e4191bfe1fd91624b3758e4aedfa437a002211100d1137847c898064cf479ed33acc9e68e61459e17c35be140a7b5aac2942e9f7a6902a1994a4330e1285fa248ee831a0a795251c0e9aaad7e0b23c892f4856540c1459cfb4eb27b210556239e13542d8e4cdfdf988f00761c1c9f76c13d3fe61d4896cb390d059ce129cc848690f777b951e455a5a278066112379042e5dd006fab14bbf02c513ffdd0c747e7a4769b2588b22dc8515c535f0a2c22c1cc227e0a77e206dc101f13fdb7b59968a2a70b9554a51b7e947cd27ab1f2250014d38be63992958204464c1f6de4df648b8493316946716ea4250aaccbff1301c4f79b96aa50114e5b155d2c5769a8ac95f80c62b830e1c5b262989e0de85352cfbf1bd633464a1df637c46af8b5575031d3c9348bd7a95b02b6570b8ad15270b53a0fc81183f77a2ce3e7f84323a7a340d94334faf21ea7652573f4e83d0e61b8509d5a83ebba7afb2b87009df8ace4f4d6baf0f16fe7a553db7110e712a3802c6ef7efc484495b967658d9021f89229462885bafc010e47599a1fd5c22d9e26ded2cdbb3450b23cc5a2522d569e3e49bca65c2c343b4c702782efe74e3477131df957b4fd0757eee471f960cecd3affc1b58194715fa90566f12c462cbc592b2cbaeec63e45ea428cba04a2e512bb37988517b47b58bd9774ffa93475d92a02f8e1993616392ae12210e957603a83709f0601e9c4e55d246c63496f237c47", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x233fd3d94f86264d6b666cdcb455c1cb144d3dc399edc9d17bd50aa42ae789a2", + "dataHashes": [ + "0x7126453ddb4c09537a505a70bae0dd57a3f5daba4522fa1f79b760fb28efb35c", + "0x82694a9670032c50548d42dbf6f0d9d09febc4f2454796997ec9a4edc7f87106", + "0x08a70f876b12e010a0c34fe2bb03389fbeaf1749e9528359b7196df67a8c76fc", + "0x93eb7218f429a6efeb1ce6931a3915e0a032131ca9ff6ccc5c8428178221aa4c" + ], + "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", + "parentAggregationLastBlockTimestamp": 1683325137, + "lastFinalizedBlockNumber": 0, + "finalTimestamp": 1683335137, + "finalBlockNumber": 155, + "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", + "l1RollingHashMessageNumber": 1, + "l2MerkleRoots": [ + "0x8c11bf3dd28eeb8e951be357df5c22d4de2500ac61ecb04da92971c71b55585c" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/testData/compressedData/blocks-1-46.json b/contracts/test/hardhat/_testData/compressedData/blocks-1-46.json similarity index 100% rename from contracts/test/testData/compressedData/blocks-1-46.json rename to contracts/test/hardhat/_testData/compressedData/blocks-1-46.json diff --git a/contracts/test/testData/compressedData/blocks-115-155.json b/contracts/test/hardhat/_testData/compressedData/blocks-115-155.json similarity index 100% rename from contracts/test/testData/compressedData/blocks-115-155.json rename to contracts/test/hardhat/_testData/compressedData/blocks-115-155.json diff --git a/contracts/test/testData/compressedData/blocks-47-81.json b/contracts/test/hardhat/_testData/compressedData/blocks-47-81.json similarity index 100% rename from contracts/test/testData/compressedData/blocks-47-81.json rename to contracts/test/hardhat/_testData/compressedData/blocks-47-81.json diff --git a/contracts/test/testData/compressedData/blocks-82-114.json b/contracts/test/hardhat/_testData/compressedData/blocks-82-114.json similarity index 100% rename from contracts/test/testData/compressedData/blocks-82-114.json rename to contracts/test/hardhat/_testData/compressedData/blocks-82-114.json diff --git a/contracts/test/hardhat/_testData/compressedData/multipleProofs/aggregatedProof-1-81.json b/contracts/test/hardhat/_testData/compressedData/multipleProofs/aggregatedProof-1-81.json new file mode 100644 index 000000000..5ff9ee4ec --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedData/multipleProofs/aggregatedProof-1-81.json @@ -0,0 +1,25 @@ +{ + "finalShnarf": "0x6d2b3535e06f4778e03c8439145dd9b8e4ae312953b9ccc154ef73b8a00c26c1", + "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", + "aggregatedProof": "0x30313033438c42faf4016734dade2d11b2c8372525f7b60a71d0a4bccfe3833607ff64adef856f488a5d6191332dbad346c74e8737094e038510a772270b94ce2c793adeed38658e33aa53af2f3c45eca455eb9fff8021336c82b01888f4cbaf0bf6b936b576d83c17b240e9b86daa7e27a841064d3fcb2711e49288c179fd66047fbadced4bfc6a74876d6123c0f0d88692329b433bd1a684e0f6554ea82aea02137b6b2c819906123960e5c9bdb8b8ba2919dba14891b0820892060f55e5ea1a453a2e09a07924e0118b28ee331d78452eb3c2366fba758cbcbdeac1ac724b1dffcef65d461efb0faea23561735399155a3b373002d1b6ae85cd184c9bfe540f0721d02a1d64901b31f614523948790e7ada89ed76818017c248f8522a75d62f04dbe225b6dfbbb4296beed9a6141beeaa87ab64bf9bbe698391ab3a3cff782a691bfbe9ff2efa56bb22ee886ff542a9ff5fb373a862d50f5aeb5c2fbc199708d4894e927cacf2775052d647da284d26edfb266cb92813a77a6f0c1dacf19314d1bee7aa56293f89dce7227f97d819b5c784d6624dee655e046a199a1b625c23db82a0683847d0755be3456d6af915c063d0076c63c3ee43fa4b2534ce955510715048a073ff6a9447c9c91472e1c24d77de85ffaa4b988a789a64b56a100220b095962e7da48d8d319bd90c544b915d5542b5f9d6629046f3902c0d9532cf0b7dcd5b8e005bdb6e0023ac7a4b20081d87171d7224d6351ca3bc6ec6c6d3462537b527eacccc92813d01ed29cda62df3adc0d3dcda55f8b0fce45fab6e7067251dea1b40f4d3853c174054672529fe8547130da71e6188d2d44ea6a3bba3370f75ab406764cf80d980534708547b044a794b56759e64eec2b6f11722beb749048141e22a568ae1ef5ee180c1af59ad5196918852f8390e1739b5ffbf778ff109989bb8768d2c37ec41337318a50e6daed527e9d6b9e17d042f5242ec99d8da24d863eb866aad9f0bd91ff5999b5673ced7321a525c2af47f66d78132bad769223ffbc303fcea302190912a8947ca7a298f7930b75a49ff3c5d755d94292e88104d5affe82c7bbf18cd35861075968ad1f95b0b55f09ade5ba44153899fcf8a09c9e28b1035beb3a493b34585b5095561166d094283a4ce6427590f0c3bfe261ca5336d739f9a56c0386c7323c41faeee3e811c4a9266c52eddab877efbfc22", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x216ea864c4d4392d0315997af776dbc1856686e376a07c85ed67f8509c14328e", + "dataHashes": [ + "0x7126453ddb4c09537a505a70bae0dd57a3f5daba4522fa1f79b760fb28efb35c", + "0x82694a9670032c50548d42dbf6f0d9d09febc4f2454796997ec9a4edc7f87106" + ], + "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", + "parentAggregationLastBlockTimestamp": 1683325137, + "lastFinalizedBlockNumber": 0, + "finalTimestamp": 1683335137, + "finalBlockNumber": 81, + "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", + "l1RollingHashMessageNumber": 1, + "l2MerkleRoots": [ + "0x6de197db892fd7d3fe0a389452dae0c5d0520e23d18ad20327546e2189a7e3f1" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/hardhat/_testData/compressedData/multipleProofs/aggregatedProof-82-153.json b/contracts/test/hardhat/_testData/compressedData/multipleProofs/aggregatedProof-82-153.json new file mode 100644 index 000000000..3781a95dd --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedData/multipleProofs/aggregatedProof-82-153.json @@ -0,0 +1,25 @@ +{ + "finalShnarf": "0x4b7f110cbe7fcab315cd99683b2c7864bff2615903a3230d5bf2222b7a71a756", + "parentAggregationFinalShnarf": "0x6d2b3535e06f4778e03c8439145dd9b8e4ae312953b9ccc154ef73b8a00c26c1", + "aggregatedProof": "0x02e41bca53d5e1bf8b0ec55fb1c0fddc9d3d15d17ca10d6d9f7c5df01a30e3a307973b320ac40a80dc1c477b66d0e8309afeef3cbf9ba0fe5bbdbc209808665500b85bff38c9a4282e7856dd28fb5c927f9f333f9d9b7d047cd83461d757366d0738c665bbbd51f638809e31137c96b9762f4618ac6a692023a97a32b79b7cc715185be875358a46b9368ee6d93b6ff2188c438a53bd9063df9d89ae59dafb552cc4b719a800bdde6151a1de1714ad0fce697c8ba7f2be87686843c0caf76bef3007d80de9b305ca1d2ab62becbf8a7d2941590767c2bd548e9693309e33abdb24929a28df52816e1ebbe6e41918daa403fc41f344ad498027ffa7a822978e39217dc16adfeeababe6944025dc46a8a96fd323242d2d1eaf820cfcb7e8ca878200495bfd3d1956beb18706aa06063d8941f5276f1a81f6c976527c97f9d9d3a22f71ff3c0350dea7c87677bed824774203d4c760e0541db17e7c83b8dc0687d20adf52de3bc87a6b64dc64a4ea63ab5066e8d8e289e1abc1a776ee67ddeda9511a3b360a51822865d213c7738c4bdbed78dd9525a9a8bbaa57387d5c7e1651881bb0a5c1dd9044a987b746bd1e343d3a3f72701d2d1de04157013988770b4af4145d768e3054e9627d538d5002a93768b84c6248c6777d77cd9a22f8e63b0d302f77e5902a68ab5ff3121caf3985299f0c3527fc77468e6a86e48b85edaaa76d11a7549e00f916793361956c440cc44ff8a546aa770f8c654c669694411c35fd2e9bea56c5746d00a93ca4f8c4150e366a176bb0a5ec8bd4c595cce8b3dc9bd21b4d812ccc92f4e24b6536028fcb0fba77ac59b0196a495489a551546b2e07fb1407535d02080b425445fbac0fd02ce48b29652aaa7948dbd1f7e0fe46816164173e3ea2c8a909a9e2299950c9fa9d17dc77f87aa24df14bbd33d8714c70788c0088b322369fa5a4792726b1f45364c959d19b01d1c1baaed98dc17c03fc0e2125b0f151c66e1640a956a6cb2815edeacf0a417e1bf7dc4a8e281f79991cc9ce2bf0b60c2aec641622c8617d79aefe26cfffa10a7d3fd69bc99d67cb24209ed4055f625e0b4b45423d49c3332401ca6d83fd9fcad279dd64ec426e4b502554b9152232491ddbb32b219f3ef8f303574005b7a7d0fbf13c9a854a4ac233609d532044a1a7e87d38e3843fe9220554d52a291100d0a9a6e6e1c921215f0da10c23", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x0ecda6d6b122aa50210c937e14351066a6e98db71c066ace19abb75a3abdfda8", + "dataHashes": [ + "0xd1ef92f67e60ec41ee3b2f448024802d1608c138d4770ab1d3ada17facd6f0cc", + "0xa54a0666ba33710a751591da5edb268dc309934de83a5efa03eefc6e2e384737" + ], + "dataParentHash": "0x82694a9670032c50548d42dbf6f0d9d09febc4f2454796997ec9a4edc7f87106", + "parentStateRootHash": "0xf0f26782f7afb93f926cacb145f55530714f20b1356725e3971dc99e0ef8b591", + "parentAggregationLastBlockTimestamp": 1683335137, + "lastFinalizedBlockNumber": 81, + "finalTimestamp": 1683355137, + "finalBlockNumber": 153, + "l1RollingHash": "0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "l1RollingHashMessageNumber": 14, + "l2MerkleRoots": [ + "0xf82d0ea8590489e98ca4279f30bd4b32a4fd62e6574ddc4f606d6496096b3721" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/testData/compressedData/multipleProofs/blocks-1-46.json b/contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-1-46.json similarity index 100% rename from contracts/test/testData/compressedData/multipleProofs/blocks-1-46.json rename to contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-1-46.json diff --git a/contracts/test/testData/compressedData/multipleProofs/blocks-120-153.json b/contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-120-153.json similarity index 100% rename from contracts/test/testData/compressedData/multipleProofs/blocks-120-153.json rename to contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-120-153.json diff --git a/contracts/test/testData/compressedData/multipleProofs/blocks-47-81.json b/contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-47-81.json similarity index 100% rename from contracts/test/testData/compressedData/multipleProofs/blocks-47-81.json rename to contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-47-81.json diff --git a/contracts/test/testData/compressedData/multipleProofs/blocks-82-119.json b/contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-82-119.json similarity index 100% rename from contracts/test/testData/compressedData/multipleProofs/blocks-82-119.json rename to contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-82-119.json diff --git a/contracts/test/hardhat/_testData/compressedData/test/aggregatedProof-1-46.json b/contracts/test/hardhat/_testData/compressedData/test/aggregatedProof-1-46.json new file mode 100644 index 000000000..f571cb582 --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedData/test/aggregatedProof-1-46.json @@ -0,0 +1,24 @@ +{ + "finalShnarf": "0x9562fa89830a0ba0063a636ca96e52ce2f032b855336c95dd788321f4e193419", + "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", + "aggregatedProof": "0x19aab25faace24e8e145a1b0bfd39a16d64dd3c25e38f366e818e03e55ac05d20b0fb1301da772825a8154088acad5274012a8a71309c5946ff67823c6af507e2d1ea9aeaabbecc81b0b8738487551d59ea40d3fbf921d4021a060a355bbdf112a49c1eb9274529c85771f8b63b43677bca4944a04ae9f1625097106646ee63b1914d5ad67d01ca17939f70928d6479359c140fa56c2f2a9f5c52a8bb4cab9541c9938c7f3806753fe3e894581191a197bb5ec27ddfe8d05c0de190800aa5bc2186904597890bfcc70b23336d8e8683cd366a94aec8879c1a15500e6ab6b05d410083f0529116156338903222587a4d7ca36b1bdf277219bfa9daa043386db820711eb3413b5277ec42c69b95e0f4e46f55c312abd3cc544d2c69d59965be71f013e0fb72adc4e1fd983ec9f1c1bd5998e3a0ac513ba2e929ae248faf944a1d613f18c9d815f576bac14c1d5a0840c0266f2cb497bb0af762598c6154933075d2f7d4ba04fc7c0cf38cf09f681b3d48299e2d1f5e9cdf9e8a575a1f9df2548e007496b104947579a80f2781c62b3b6c8895532786806d0e179118f18b4a6af28041e13e09169bb323e11664b956933d4767955ad17e0e2254fcd0459e48ef31124b7c84d983c0c447fcacff16301ff544b814533a20fd78840843335f50f92d805d2c5604a8d85719b71194d2d39efea2b22eb7b3121b7486a13ea8e0ebc18e90efc462348ae8f0062a2f7504bc7c5197c5a899375b854206cda2bdd1ceedab42afb04ce57e7adc01f4490bcfb274be404c3646c331b8bf4d6cba0dff1aae0440b3bf6d54890ec9dd014518cffe85027afb3f820456ef3434762b5d1b30b96b813129cacfa233be272f82629ec0ad8ca5d6915aa9dae66e084f90feea2a575840bf9983bbaa2b091b801a6f16bffd37c16612c8da12ca883b20c84cfe6d3471d0e47f74aae689ec3d5cec1fea21910233ed6c1ae384fca1ed7c496448350a3860da912be5019b67c38c63919f04aead40276af6b7c0f9ac1889bdd91c0802dff17cd402c0cbed112d67e2ee9d4472e81cccbfc3caedb92cf03ff1a977bd7e513262d10e1beef18632fdcdf0ee01dc92c7dc1aa877516c0533788d0b3e3333e812d8dfe633a2073ab3377e1943596be47c00f894d41a08eea403118cf1909a0510197ac2a260e913e0728b015fd568141af83b0a6d2eec3639bdebcab139159fa", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x1e77e4d1bba517cf992e7788a104fc5612e539ea2b459b532d69efe6c416235a", + "dataHashes": [ + "0x7126453ddb4c09537a505a70bae0dd57a3f5daba4522fa1f79b760fb28efb35c" + ], + "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", + "parentAggregationLastBlockTimestamp": 1683325137, + "lastFinalizedBlockNumber": 0, + "finalTimestamp": 1683335137, + "finalBlockNumber": 46, + "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", + "l1RollingHashMessageNumber": 1, + "l2MerkleRoots": [ + "0x97cd1539d08f7c0ba06ad836b2690eef50afd86609a0672517ec0ef8c1f94796" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/testData/compressedData/test/blocks-1-46.json b/contracts/test/hardhat/_testData/compressedData/test/blocks-1-46.json similarity index 100% rename from contracts/test/testData/compressedData/test/blocks-1-46.json rename to contracts/test/hardhat/_testData/compressedData/test/blocks-1-46.json diff --git a/contracts/test/hardhat/_testData/compressedDataEip4844/aggregatedProof-1-155.json b/contracts/test/hardhat/_testData/compressedDataEip4844/aggregatedProof-1-155.json new file mode 100644 index 000000000..d1e4d6fab --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedDataEip4844/aggregatedProof-1-155.json @@ -0,0 +1,27 @@ +{ + "finalShnarf": "0x602c8eeedd7f6dbb7bc0348da1b0dced846acf09586c9f27aa06b494a1c49249", + "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", + "aggregatedProof": "0x01b8eedfd19a973d0750c42ba4d969ebc42ebbd3db56d891e61ab42035771477015671a6fdd0e82fb20b1648f18d87435bc7847f1d138aadc8ab5edc683b271e15d7314d73c422bd3f7e508b0b10c5db59a4f7471f915526038ab31d9a47b4c827ecac6f15aabfa78f686ff94cba2232a74cbd3c6b10be7b92c28d8b74cb4f490ab3d4b37b0dbfb59676448b23388168e8308d1d478d03834437c830b1777679235e6fa08f028c188c070b9c07d9fb46eb387755d517fe28a804d501c021da2c169a99586e804c34578b198a299d948bdbf89a065cdc7e5f7e601e195794071f14e81f8e7dd222937b101485d332a3ac8c2f8bf6a6d46d942ad37b7467ddc4f11e13ba64f9c7d19866258eef37769bfc963e5b5ac4475a92348ab167360377f02c1f9b720dc2783951e06d616d00218f6504b3cbfa833103ee8e5359a21854b512d6721687a315f497deb9c65fc770d21f9b5e097db201b7340d0edbf9d2fd042b6f5ad716592c0626a77bd68024b1fceb6cc12a1072bdb2449c2c8b0c78def10210596f2ea17ffd12b8f4c45d9bfa8c17461dbe9d4a8af75a20a9c9b2ac90880d413b6dce475a9cad4790f2d682fd3f31d53f13c7add0d81aa3d4fff8bd0e962fe0c07b58cbf5ae3b52b3850549ab9f03cc1c0cb762f6325919d3f1e08b726b24472472c96bdcd7df8fbc8f43b6220603ca59cde518787c7df3836ffe0d7b0626da07c2c556cfa2fc40347b6bb81aa5ba02281c5f58370f257273a4ba369e09057784e031a3e245e5ad5c190ff694f4eebafcacc47d22b09d367739375afb9e214f6110d4e27c5ef42c24d725f9757c2dee7aa7e0207d473562801a6ab114650dd58b43cd7bc3e03cebb39e3fdb56d0ddee5ea5db19fe5874e8bb6d0d0d7fba09b194160c583e95ba6795e226373124ff28be6cc0956560c4d2e326c772dab2118db10e8926bc2a8da6e65aeecfc94636897d2695165aa287532f3e617bba1c01894ba5545f8f187bca11e65688241617a46cfd2b999dc5c6295228b2d93ec11512741ad3ae4d4512efad1e9fb14121896888f27cd55514af42388037cb1dbb225644640fa654a8184c3d8826a855a2ad54477b51e33ce33cb01ce5e648fe1b2e794ee1a3972982fca964f11c65a4b35eecd4d77869a0f6e8d5748601bc58e8091d6bdd480528aa4a1b0b99454e24024b4f72a0b6ea0193b811fe28ef5222b8", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x1538dc88156cbdf280326f52e33192924ff311be4abc0dede43a14fbfb160a55", + "dataHashes": [ + "0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95", + "0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618", + "0x017b1d49c6c7947f83855cc16063ef19d02369540b97867855427b56cdaea487", + "0x012cab32c78df416fe59f8f123e2ded2466a64e201bacddc8396231f335d2088" + ], + "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", + "parentAggregationLastBlockTimestamp": 1683325137, + "lastFinalizedBlockNumber": 0, + "finalTimestamp": 1683335137, + "finalBlockNumber": 155, + "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", + "l1RollingHashMessageNumber": 1, + "l2MerkleRoots": [ + "0x8c11bf3dd28eeb8e951be357df5c22d4de2500ac61ecb04da92971c71b55585c" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/testData/compressedDataEip4844/blocks-1-46.json b/contracts/test/hardhat/_testData/compressedDataEip4844/blocks-1-46.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/blocks-1-46.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/blocks-1-46.json diff --git a/contracts/test/testData/compressedDataEip4844/blocks-115-155.json b/contracts/test/hardhat/_testData/compressedDataEip4844/blocks-115-155.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/blocks-115-155.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/blocks-115-155.json diff --git a/contracts/test/testData/compressedDataEip4844/blocks-47-81.json b/contracts/test/hardhat/_testData/compressedDataEip4844/blocks-47-81.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/blocks-47-81.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/blocks-47-81.json diff --git a/contracts/test/testData/compressedDataEip4844/blocks-82-114.json b/contracts/test/hardhat/_testData/compressedDataEip4844/blocks-82-114.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/blocks-82-114.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/blocks-82-114.json diff --git a/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json new file mode 100644 index 000000000..0d85961fc --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json @@ -0,0 +1,25 @@ +{ + "finalShnarf": "0xfd910670a8da6aaaf2431ce7345a605dc15dc41298b9410065d2f7bb1ba99fea", + "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", + "aggregatedProof": "0x204f16273856ff81bac2e62d7841efe1d89f1b756746befee1835b0f23add0391e6a5c7648f07ab179ad0af3be93f52b981641e95da794c6f3495f8bccefba692938c8c5c809a6c6b195a755fefd6ba94c6d9aafe4cfb2d0592f31ebe6b5b41f13d131c6bf9ddcfa526bee005f89a9b430b6239281d0646fe0e519243b1c89fb081bd3bc1e75dcf70db4dc0a82dd697df4a685c57bb037f2aaed2d9a44df36a51f56d26ff700797930a559d109348b6bfe519066450652ffda155b4a1883cc0e19e38253931546be3143b28eee17968bae69cff96be2af8d4fcb5bf903a7ae931a7f467531a1c599c166a64d175fe0a4c8f2cf28df322d34c494268def7e2d72180a7477bc6c7c63dd8ffceee6cbd87641e774164cc49383d1576d08ae8919f31160e7be139f6a49bd6bad7094e2d5bf6bb275646dcc71b5fce10720205682700b19829de6760df255b6a9b6766d40a77c33570131af7319579a4b125266c5542d2be76197e67687a4c6958fc5a1e06685f42a4729c07b54bfa75efafa3766fa05f1c2bea07da865eae383d779a3482bf93dd09b0c1cc8ff1fc928af24afca8d243b3678fc8c7c461fdc15540e3f69cb22bf017cff888fa1e0efd27c00511cc72fb1c3d4989efb96cae362f3601497aa776e30a36b02001890fcd5b131a15d250952e2312ee6c9e9d5221d4179cc78c3d4ac8ef15eadb9dbafd563704440deb6250187725d5319969850055d2c1de2a2814918c297251d33afcf103c30ea37d0204fb81d73056b53476db411ed59019370d48262f33ac4c9a556b304b60c14fe009b3c747e9bcd285eea97b7997ae5b1a9d517ee1d9a422a28a3c7b914dc6eca0810a198b219689b36752fe7e64a98771c3fd7bbdde9403e16594a55da4728d92dcc717675970eca07a72082f9e4ea9a4a9909593dfcc52f72463fac1fe184992ee3c84e4bc9680ce19f7ca8e8173e366ca665360f5344d3206149492b17a9ca2431d782069f0bb6e0f2f596da8ef2e8d5374f8fa8fb426718f4ec6a389d7f202ef740cb19053f726419238eff09605ff37f9abcc360b569fe9579d0a77b7a0905f3a705e390b13b8951e59a7cc5f41b1b7b5c7c8f3383382485b715f2a7bd900fcf788b75c1b5c9c8cc619d969b6dd081b5d618facb54cb5fe46a1fc41622292a93210d9fbcfc703d87aeb3e25e72f0a312794fa4038737830d04ba214a1311", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x02df9c4f607afe80ac52003978e4a9e197a7a0b61b6601d5e0788a6fdec1c08d", + "dataHashes": [ + "0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95", + "0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618" + ], + "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", + "parentAggregationLastBlockTimestamp": 1683325137, + "lastFinalizedBlockNumber": 0, + "finalTimestamp": 1683335137, + "finalBlockNumber": 81, + "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", + "l1RollingHashMessageNumber": 1, + "l2MerkleRoots": [ + "0x6de197db892fd7d3fe0a389452dae0c5d0520e23d18ad20327546e2189a7e3f1" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/aggregatedProof-82-153.json b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/aggregatedProof-82-153.json new file mode 100644 index 000000000..6675d2c13 --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/aggregatedProof-82-153.json @@ -0,0 +1,25 @@ +{ + "finalShnarf": "0x42d7511a7a880ac5c3a61a0f480e95ec7b0e2cfff1aa106ea0256aa94bf2b865", + "parentAggregationFinalShnarf": "0xfd910670a8da6aaaf2431ce7345a605dc15dc41298b9410065d2f7bb1ba99fea", + "aggregatedProof": "0x033557c5d13a30ca1669875ffb80a1be98d6c167e438189af0fb73d54151f94e0b0955070468945895898f7f1c3a77a0a6afff34227b352fc49678e4db78c4a602caf4c3ad916ca9ad06ca3d02e3a3b3dc2eeeef17d8708f2d2f0dd73820e7220228e23d2ed96859bc5602f9070c7ea4ab25de390c518d93fbd5a573518c3a5b1b87fceb317d63198839d5447a466d19096673cde01c025ae78960aab89010130aff9b2feb5c17665d7055db4722beee2b8bb4a36754bc1aceee949078926576113b6b00be25c5e3ab5e8b32481709ee6ed8953349b84128337e07f468e39e5f23d6ddb6ab6d01d253bcfd00cf763a02023d0a1a2b72a2f024e9b1704a93c0d50afb34279f71c35cb8d0dcf5fe23c8edc24740b768ed6b679199c104427cd05418b64479bb825e12c417afd127b0a869a82e30c1b4e4494be464db3518e54bcf22e3f2a2f1e6d6473d8cc1a65a5cd3b1a88fed0b18e9c8b999cd7151b5b9c14d28889db5eafe3f7fc10bc28803927d10cfc65d4c6c402c3f3dca4009e1d3b704284d77530c241580cf668c188c666a2986a6b2a41ebc75e5474fd0e7435fb23e1e812e9a77cc2a5c593ed996f2e9b7d400fb30b684cafb1803a2d780053f27ed0a4a1428d13f9ea2d6ae6bfbd520f0bf18013e6d404aba036729ff95e34a59ce1a4f8a250b11936c0ef81c220a1c4225f32209990d2d2dc13e2b32c4c02535c416a3e2c11d6346a2a509567e83e96767fc21de7cc2ab8e067bea77beed78a7442f3615040638385346edb1389508b48ae7666a35e559facb9ebc498bf4c25ce40ee15e0ba2445d251457ef2e596ff67653d5de839ee4d7aadc5f05d5577c1b5d267386e5389b2056485a84c72ac4be2a2141c6660e372107c3ccdf3944df36b201f3be39dce41c79eb49c605db28e24ae3a42e3762e3794a0ebcaf59dd3d70100820bd55fdb3237a404e7d3097ebb85c0faf3a83662bd28ff663765c9adef9c60c7686c5b4bcb20e535483e032e0ec61de4d4b5630e78918a0b21b7e47ce1ac925a364c5e25148715c7f70e9019f08c2e36f8d27ed7f0de8773e3a7867ff3a9306b89a0500eb45f6eb563fc52c64e2edc497660f9c4e2fc263771b3815b6b16b2dffc656e03aacc8c9874fcc859cb0cd1cecad6e0671f8d6f4ebb146a9fa30111749ac08641ec8b0f7891c876da368b7a4acb088996f3e71e631035945c3dbf7", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x23151dfee9756b7eb4a018d5ef30730f20e05edfd3ce67a8f898c46cb2d79341", + "dataHashes": [ + "0x01bdfef0d1ddb163bf8431ea63ad7166bcd69a72a4fa30342138335d7fac96f4", + "0x0112b6fcf15707263de267fdc63c78cf9881654e88455b94fb8f9f7623223365" + ], + "dataParentHash": "0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618", + "parentStateRootHash": "0xf0f26782f7afb93f926cacb145f55530714f20b1356725e3971dc99e0ef8b591", + "parentAggregationLastBlockTimestamp": 1683335137, + "lastFinalizedBlockNumber": 81, + "finalTimestamp": 1683355137, + "finalBlockNumber": 153, + "l1RollingHash": "0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "l1RollingHashMessageNumber": 14, + "l2MerkleRoots": [ + "0xf82d0ea8590489e98ca4279f30bd4b32a4fd62e6574ddc4f606d6496096b3721" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-1-46.json b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-1-46.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-1-46.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-1-46.json diff --git a/contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-120-153.json b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-120-153.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-120-153.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-120-153.json diff --git a/contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-47-81.json b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-47-81.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-47-81.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-47-81.json diff --git a/contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-82-119.json b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-82-119.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-82-119.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-82-119.json diff --git a/contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-155.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-155.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-155.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-155.json diff --git a/contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-206.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-206.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-206.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-206.json diff --git a/contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-46.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-46.json new file mode 100644 index 000000000..c4603dc81 --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-46.json @@ -0,0 +1,24 @@ +{ + "finalShnarf": "0x4e584b910dc758442e58e56e0bb46c001addaffe770fb740ea0e1b90c0e2b056", + "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", + "aggregatedProof": "0x11cd421a70428e11749089cfa09f497f97c48b11869fbcf6392497e257b5511f06b2e71e1d8a101dd197884bdd82d85e017694efe4fcccfea89a08485fba307a11cd3d439d22d3bc71962037c2300a3df1941a443eaba2fea8fbaf7d33e7822d182b87d1921b56dd51ee4540e2f57353f517311aa37cfc50291860c3bf33977809f875d199ff26840859191d8d742ec987f17b7e2d7643d0620cde28c0968cc906ca504d6bbccd9a22e7becf62591ab80b306d40644d262a1ffc31ec91438b281386adb22420decebd13e6a902f2515e4a75a44925d4ea208d2fb6c6f58567d7189f301d2a08badc647852dda3c51ea84e32f0f3207d013abcee0e705c4bde9b21cb81cfda904568c3d3aa6d5349038c0fd11efc90c127291968e390e2d9b52a0b93dcadb97bf4b8ce6a76b3606349611556ae2f4c8747a9b5fe317a93173afd278dd2e50791089ca6f2b0b1541beb6ce6b90e2b8350e05313b44e70821e74270669d00462ecdfa5955a0b58bfff42f7f729d3801817d02bb6842cc5aec17caf268aba200e1f7d48935ecb23920b037a62ae719fe5aa17f2ffd2b5b89523cad204127a42cb96c648c7a560c66c08fa2f9e9615aa71316f06f055088b28738ac8120e0c3a1bbe339f499d0cb62540effac69832b7bdc9f2b3527ef5c8e82ea5ce181a5793cb5378a71c0a7ad4bdbdae0863427ed1e49cc90ea9dc1ec9fcb7a4072fc9297f4013d5315a418a6e829cabb33a23cd7417a19ccb57e4ba210d2057ad06d16e28060e14c447b01e06ec83972ad2d1f4d07cf077a66a9c538e10deaa19171dae203d7ae5d43a9ba37e6c3d05acb7fd63dfa64c1b2d33b2c580ff5ed97a070ba28b4acb73c73b489e10f2f99164131a92eae79719617bc7ac34e6f4e2370b280a0227c2d225662509fbff12aeaaeeed14f888b963ad770a1a4b81549ab103a0a09290510a90e353f6ee519bfade3d55a30e6d4a9f1fde1a3ec2b4f46af003ded1ab46f68a2279e927966d019084d4a9b128618448b31b74a99725b202af161aca24bba201b9e6f822c8b8a7f8acdc35162dfe6478706c58c8e11b38ffcf04bec2d0fc995b97aca6e5c5454167ee36acc63c62b3d25d396e9135e9d3ed430b9ddf6d97622ed424bf4e789fbce736186bee2ad9514c383315c4da53a6e8c00b490f5f45eb6115b11c1a5ea4f57e6bb6b25892b63f318b4cf0c40266ad90e2", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x0c16c609b50fbc6f660b3fe38c5989ce059ea171048c99c0dad306cea570df61", + "dataHashes": [ + "0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95" + ], + "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", + "parentAggregationLastBlockTimestamp": 1683325137, + "lastFinalizedBlockNumber": 0, + "finalTimestamp": 1683335137, + "finalBlockNumber": 46, + "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", + "l1RollingHashMessageNumber": 1, + "l2MerkleRoots": [ + "0x97cd1539d08f7c0ba06ad836b2690eef50afd86609a0672517ec0ef8c1f94796" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/testData/compressedDataEip4844/test/blocks-1-46.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-1-46.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/blocks-1-46.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-1-46.json diff --git a/contracts/test/testData/compressedDataEip4844/test/blocks-115-155.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-115-155.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/blocks-115-155.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-115-155.json diff --git a/contracts/test/testData/compressedDataEip4844/test/blocks-156-175.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-156-175.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/blocks-156-175.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-156-175.json diff --git a/contracts/test/testData/compressedDataEip4844/test/blocks-176-206.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-176-206.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/blocks-176-206.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-176-206.json diff --git a/contracts/test/testData/compressedDataEip4844/test/blocks-47-81.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-47-81.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/blocks-47-81.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-47-81.json diff --git a/contracts/test/testData/compressedDataEip4844/test/blocks-82-114.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-82-114.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/blocks-82-114.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-82-114.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000501-1000503-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000501-1000503-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000501-1000503-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000501-1000503-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000504-1000505-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000504-1000505-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000504-1000505-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000504-1000505-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000506-1000507-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000506-1000507-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000506-1000507-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000506-1000507-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000508-1000512-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000508-1000512-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000508-1000512-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000508-1000512-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000513-1000518-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000513-1000518-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000513-1000518-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000513-1000518-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000519-1000522-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000519-1000522-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000519-1000522-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000519-1000522-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000523-1000528-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000523-1000528-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000523-1000528-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000523-1000528-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000529-1000530-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000529-1000530-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000529-1000530-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000529-1000530-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000531-1000536-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000531-1000536-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000531-1000536-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000531-1000536-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000537-1000538-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000537-1000538-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000537-1000538-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000537-1000538-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000539-1000544-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000539-1000544-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000539-1000544-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000539-1000544-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000545-1000548-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000545-1000548-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000545-1000548-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000545-1000548-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000549-1000550-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000549-1000550-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000549-1000550-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000549-1000550-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000551-1000554-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000551-1000554-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000551-1000554-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000551-1000554-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000555-1000560-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000555-1000560-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000555-1000560-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000555-1000560-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000561-1000563-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000561-1000563-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000561-1000563-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000561-1000563-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000564-1000565-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000564-1000565-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000564-1000565-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000564-1000565-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000566-1000571-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000566-1000571-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000566-1000571-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000566-1000571-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000572-1000576-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000572-1000576-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000572-1000576-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000572-1000576-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000577-1000580-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000577-1000580-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000577-1000580-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000577-1000580-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000581-1000586-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000581-1000586-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000581-1000586-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000581-1000586-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000587-1000588-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000587-1000588-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000587-1000588-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000587-1000588-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000589-1000592-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000589-1000592-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000589-1000592-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000589-1000592-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000593-1000594-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000593-1000594-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000593-1000594-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000593-1000594-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000595-1000599-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000595-1000599-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000595-1000599-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000595-1000599-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/rolling-hash-history.json b/contracts/test/hardhat/_testData/integrationWithProver/rolling-hash-history.json similarity index 100% rename from contracts/test/testData/integrationWithProver/rolling-hash-history.json rename to contracts/test/hardhat/_testData/integrationWithProver/rolling-hash-history.json diff --git a/contracts/test/testData/merkle-proof-data.json b/contracts/test/hardhat/_testData/merkle-proof-data.json similarity index 100% rename from contracts/test/testData/merkle-proof-data.json rename to contracts/test/hardhat/_testData/merkle-proof-data.json diff --git a/contracts/test/testData/mimc-test-data.json b/contracts/test/hardhat/_testData/mimc-test-data.json similarity index 100% rename from contracts/test/testData/mimc-test-data.json rename to contracts/test/hardhat/_testData/mimc-test-data.json diff --git a/contracts/test/testData/test-transactions.json b/contracts/test/hardhat/_testData/test-transactions.json similarity index 100% rename from contracts/test/testData/test-transactions.json rename to contracts/test/hardhat/_testData/test-transactions.json diff --git a/contracts/test/testData/trusted_setup.txt b/contracts/test/hardhat/_testData/trusted_setup.txt similarity index 100% rename from contracts/test/testData/trusted_setup.txt rename to contracts/test/hardhat/_testData/trusted_setup.txt diff --git a/contracts/test/tokenBridge/BridgedToken.ts b/contracts/test/hardhat/bridging/token/BridgedToken.ts similarity index 98% rename from contracts/test/tokenBridge/BridgedToken.ts rename to contracts/test/hardhat/bridging/token/BridgedToken.ts index 3aeef1616..0ecb0f8dd 100644 --- a/contracts/test/tokenBridge/BridgedToken.ts +++ b/contracts/test/hardhat/bridging/token/BridgedToken.ts @@ -1,7 +1,7 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers, upgrades } from "hardhat"; -import { BridgedToken, UpgradedBridgedToken } from "../../typechain-types"; +import { BridgedToken, UpgradedBridgedToken } from "../../../../typechain-types"; const initialUserBalance = 10000; diff --git a/contracts/test/tokenBridge/E2E.ts b/contracts/test/hardhat/bridging/token/MockedE2E.ts similarity index 98% rename from contracts/test/tokenBridge/E2E.ts rename to contracts/test/hardhat/bridging/token/MockedE2E.ts index d24b16c59..4c410c372 100644 --- a/contracts/test/tokenBridge/E2E.ts +++ b/contracts/test/hardhat/bridging/token/MockedE2E.ts @@ -2,20 +2,20 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { deployTokenBridgeWithMockMessaging } from "../../scripts/tokenBridge/test/deployTokenBridges"; -import { deployTokens } from "../../scripts/tokenBridge/test/deployTokens"; -import { BridgedToken, ERC20Fees, MockERC20MintBurn } from "../../typechain-types"; +import { deployTokenBridgeWithMockMessaging } from "../../../../scripts/tokenBridge/test/deployTokenBridges"; +import { deployTokens } from "../../../../scripts/tokenBridge/test/deployTokens"; +import { BridgedToken, ERC20Fees, MockERC20MintBurn } from "../../../../typechain-types"; import { buildAccessErrorMessage, expectEvent, expectRevertWithCustomError, expectRevertWithReason, -} from "../common/helpers"; +} from "../../common/helpers"; import { COMPLETE_TOKEN_BRIDGING_PAUSE_TYPE, INITIATE_TOKEN_BRIDGING_PAUSE_TYPE, SET_MESSAGE_SERVICE_ROLE, -} from "../common/constants"; +} from "../../common/constants"; const initialUserBalance = BigInt(10 ** 9); const RESERVED_STATUS = ethers.getAddress("0x0000000000000000000000000000000000000111"); @@ -25,7 +25,7 @@ const mockName = "L1 DAI"; const mockSymbol = "L1DAI"; const mockDecimals = 18; -describe("E2E tests", function () { +describe("Mocked E2E tests", function () { async function deployContractsFixture() { const [deployer, user] = await ethers.getSigners(); diff --git a/contracts/test/tokenBridge/TokenBridge.ts b/contracts/test/hardhat/bridging/token/TokenBridge.ts similarity index 99% rename from contracts/test/tokenBridge/TokenBridge.ts rename to contracts/test/hardhat/bridging/token/TokenBridge.ts index 96378effd..2f70f5ca3 100644 --- a/contracts/test/tokenBridge/TokenBridge.ts +++ b/contracts/test/hardhat/bridging/token/TokenBridge.ts @@ -1,9 +1,9 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers, upgrades } from "hardhat"; -import { deployTokenBridgeWithMockMessaging } from "../../scripts/tokenBridge/test/deployTokenBridges"; -import { deployTokens } from "../../scripts/tokenBridge/test/deployTokens"; -import { BridgedToken, TestTokenBridge, TokenBridge, ProxyAdmin } from "../../typechain-types"; +import { deployTokenBridgeWithMockMessaging } from "../../../../scripts/tokenBridge/test/deployTokenBridges"; +import { deployTokens } from "../../../../scripts/tokenBridge/test/deployTokens"; +import { BridgedToken, TestTokenBridge, TokenBridge, ProxyAdmin } from "../../../../typechain-types"; import { getPermitData } from "./utils/permitHelper"; import { Contract, ZeroAddress } from "ethers"; import { @@ -23,13 +23,13 @@ import { PAUSE_ALL_ROLE, UNPAUSE_ALL_ROLE, HASH_ZERO, -} from "../common/constants"; +} from "../../common/constants"; import { buildAccessErrorMessage, expectEvent, expectRevertWithCustomError, expectRevertWithReason, -} from "../common/helpers"; +} from "../../common/helpers"; import { DEFAULT_ADMIN_ROLE } from "contracts/common/constants"; import { SupportedChainIds } from "contracts/common/supportedNetworks"; diff --git a/contracts/test/tokenBridge/utils/permitHelper.ts b/contracts/test/hardhat/bridging/token/utils/permitHelper.ts similarity index 95% rename from contracts/test/tokenBridge/utils/permitHelper.ts rename to contracts/test/hardhat/bridging/token/utils/permitHelper.ts index 90ff61539..fa31f1c2e 100644 --- a/contracts/test/tokenBridge/utils/permitHelper.ts +++ b/contracts/test/hardhat/bridging/token/utils/permitHelper.ts @@ -1,6 +1,6 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { ethers } from "ethers"; -import { BridgedToken } from "../../../typechain-types"; +import { BridgedToken } from "../../../../../typechain-types"; const Permit = [ { name: "owner", type: "address" }, diff --git a/contracts/test/common/constants/calldata.ts b/contracts/test/hardhat/common/constants/calldata.ts similarity index 100% rename from contracts/test/common/constants/calldata.ts rename to contracts/test/hardhat/common/constants/calldata.ts diff --git a/contracts/test/common/constants/errorMessages.ts b/contracts/test/hardhat/common/constants/errorMessages.ts similarity index 100% rename from contracts/test/common/constants/errorMessages.ts rename to contracts/test/hardhat/common/constants/errorMessages.ts diff --git a/contracts/test/common/constants/fees.ts b/contracts/test/hardhat/common/constants/fees.ts similarity index 100% rename from contracts/test/common/constants/fees.ts rename to contracts/test/hardhat/common/constants/fees.ts diff --git a/contracts/test/common/constants/general.ts b/contracts/test/hardhat/common/constants/general.ts similarity index 100% rename from contracts/test/common/constants/general.ts rename to contracts/test/hardhat/common/constants/general.ts diff --git a/contracts/test/common/constants/index.ts b/contracts/test/hardhat/common/constants/index.ts similarity index 100% rename from contracts/test/common/constants/index.ts rename to contracts/test/hardhat/common/constants/index.ts diff --git a/contracts/test/common/constants/merkleTree.ts b/contracts/test/hardhat/common/constants/merkleTree.ts similarity index 100% rename from contracts/test/common/constants/merkleTree.ts rename to contracts/test/hardhat/common/constants/merkleTree.ts diff --git a/contracts/test/common/constants/messageStatuses.ts b/contracts/test/hardhat/common/constants/messageStatuses.ts similarity index 100% rename from contracts/test/common/constants/messageStatuses.ts rename to contracts/test/hardhat/common/constants/messageStatuses.ts diff --git a/contracts/test/common/constants/pauseTypes.ts b/contracts/test/hardhat/common/constants/pauseTypes.ts similarity index 100% rename from contracts/test/common/constants/pauseTypes.ts rename to contracts/test/hardhat/common/constants/pauseTypes.ts diff --git a/contracts/test/common/constants/roles.ts b/contracts/test/hardhat/common/constants/roles.ts similarity index 100% rename from contracts/test/common/constants/roles.ts rename to contracts/test/hardhat/common/constants/roles.ts diff --git a/contracts/test/hardhat/common/constants/submissionData.ts b/contracts/test/hardhat/common/constants/submissionData.ts new file mode 100644 index 000000000..f4949ae29 --- /dev/null +++ b/contracts/test/hardhat/common/constants/submissionData.ts @@ -0,0 +1,58 @@ +import { HASH_ZERO } from "./general"; + +import firstCompressedDataContent from "../../_testData/compressedData/blocks-1-46.json"; +import fourthCompressedDataContent from "../../_testData/compressedData/blocks-115-155.json"; +import secondCompressedDataContent from "../../_testData/compressedData/blocks-47-81.json"; +import thirdCompressedDataContent from "../../_testData/compressedData/blocks-82-114.json"; +import fourthBlobDataContent from "../../_testData/compressedDataEip4844/blocks-115-155.json"; +import thirdBlobDataContent from "../../_testData/compressedDataEip4844/blocks-82-114.json"; +import secondBlobDataContent from "../../_testData/compressedDataEip4844/blocks-47-81.json"; +import firstBlobDataContent from "../../_testData/compressedDataEip4844/blocks-1-46.json"; + +import firstCompressedDataContent_multiple from "../../_testData/compressedData/multipleProofs/blocks-1-46.json"; +import secondCompressedDataContent_multiple from "../../_testData/compressedData/multipleProofs/blocks-47-81.json"; +import thirdCompressedDataContent_multiple from "../../_testData/compressedData/multipleProofs/blocks-82-119.json"; +import fourthCompressedDataContent_multiple from "../../_testData/compressedData/multipleProofs/blocks-120-153.json"; + +import firstBlobContent_multiple from "../../_testData/compressedDataEip4844/multipleProofs/blocks-1-46.json"; +import secondBlobContent_multiple from "../../_testData/compressedDataEip4844/multipleProofs/blocks-47-81.json"; +import thirdBlobContent_multiple from "../../_testData/compressedDataEip4844/multipleProofs/blocks-82-119.json"; +import fourthBlobContent_multiple from "../../_testData/compressedDataEip4844/multipleProofs/blocks-120-153.json"; + +export const DEFAULT_SUBMISSION_DATA = { + dataParentHash: HASH_ZERO, + compressedData: "0x", + finalBlockInData: 0n, + firstBlockInData: 0n, + parentStateRootHash: HASH_ZERO, + finalStateRootHash: HASH_ZERO, + snarkHash: HASH_ZERO, +}; + +export const COMPRESSED_SUBMISSION_DATA = [ + firstCompressedDataContent, + secondCompressedDataContent, + thirdCompressedDataContent, + fourthCompressedDataContent, +]; + +export const BLOB_SUBMISSION_DATA = [ + firstBlobDataContent, + secondBlobDataContent, + thirdBlobDataContent, + fourthBlobDataContent, +]; + +export const COMPRESSED_SUBMISSION_DATA_MULTIPLE_PROOF = [ + firstCompressedDataContent_multiple, + secondCompressedDataContent_multiple, + thirdCompressedDataContent_multiple, + fourthCompressedDataContent_multiple, +]; + +export const BLOB_SUBMISSION_DATA_MULTIPLE_PROOF = [ + firstBlobContent_multiple, + secondBlobContent_multiple, + thirdBlobContent_multiple, + fourthBlobContent_multiple, +]; diff --git a/contracts/test/common/constants/time.ts b/contracts/test/hardhat/common/constants/time.ts similarity index 100% rename from contracts/test/common/constants/time.ts rename to contracts/test/hardhat/common/constants/time.ts diff --git a/contracts/test/common/deployment.ts b/contracts/test/hardhat/common/deployment.ts similarity index 100% rename from contracts/test/common/deployment.ts rename to contracts/test/hardhat/common/deployment.ts diff --git a/contracts/test/common/helpers/dataGeneration.ts b/contracts/test/hardhat/common/helpers/dataGeneration.ts similarity index 100% rename from contracts/test/common/helpers/dataGeneration.ts rename to contracts/test/hardhat/common/helpers/dataGeneration.ts diff --git a/contracts/test/common/helpers/dataLoader.ts b/contracts/test/hardhat/common/helpers/dataLoader.ts similarity index 100% rename from contracts/test/common/helpers/dataLoader.ts rename to contracts/test/hardhat/common/helpers/dataLoader.ts diff --git a/contracts/test/common/helpers/encoding.ts b/contracts/test/hardhat/common/helpers/encoding.ts similarity index 100% rename from contracts/test/common/helpers/encoding.ts rename to contracts/test/hardhat/common/helpers/encoding.ts diff --git a/contracts/test/common/helpers/expectations.ts b/contracts/test/hardhat/common/helpers/expectations.ts similarity index 100% rename from contracts/test/common/helpers/expectations.ts rename to contracts/test/hardhat/common/helpers/expectations.ts diff --git a/contracts/test/common/helpers/general.ts b/contracts/test/hardhat/common/helpers/general.ts similarity index 100% rename from contracts/test/common/helpers/general.ts rename to contracts/test/hardhat/common/helpers/general.ts diff --git a/contracts/test/common/helpers/hashing.ts b/contracts/test/hardhat/common/helpers/hashing.ts similarity index 100% rename from contracts/test/common/helpers/hashing.ts rename to contracts/test/hardhat/common/helpers/hashing.ts diff --git a/contracts/test/common/helpers/index.ts b/contracts/test/hardhat/common/helpers/index.ts similarity index 100% rename from contracts/test/common/helpers/index.ts rename to contracts/test/hardhat/common/helpers/index.ts diff --git a/contracts/test/common/helpers/messaging.ts b/contracts/test/hardhat/common/helpers/messaging.ts similarity index 100% rename from contracts/test/common/helpers/messaging.ts rename to contracts/test/hardhat/common/helpers/messaging.ts diff --git a/contracts/test/common/types.ts b/contracts/test/hardhat/common/types.ts similarity index 100% rename from contracts/test/common/types.ts rename to contracts/test/hardhat/common/types.ts diff --git a/contracts/test/messageService/lib/Timelock.ts b/contracts/test/hardhat/governance/Timelock.ts similarity index 94% rename from contracts/test/messageService/lib/Timelock.ts rename to contracts/test/hardhat/governance/Timelock.ts index 52f459daf..0a9d0dafe 100644 --- a/contracts/test/messageService/lib/Timelock.ts +++ b/contracts/test/hardhat/governance/Timelock.ts @@ -3,8 +3,8 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; import { TimeLock } from "../../../typechain-types"; -import { CANCELLER_ROLE, EXECUTOR_ROLE, PROPOSER_ROLE, TIMELOCK_ADMIN_ROLE } from "../../common/constants"; -import { deployFromFactory } from "../../common/deployment"; +import { CANCELLER_ROLE, EXECUTOR_ROLE, PROPOSER_ROLE, TIMELOCK_ADMIN_ROLE } from "../common/constants"; +import { deployFromFactory } from "../common/deployment"; describe("Timelock", () => { let contract: TimeLock; diff --git a/contracts/test/lib/EfficientLeftRightKeccak.ts b/contracts/test/hardhat/libraries/EfficientLeftRightKeccak.ts similarity index 93% rename from contracts/test/lib/EfficientLeftRightKeccak.ts rename to contracts/test/hardhat/libraries/EfficientLeftRightKeccak.ts index d2481c543..5b9fe4a47 100644 --- a/contracts/test/lib/EfficientLeftRightKeccak.ts +++ b/contracts/test/hardhat/libraries/EfficientLeftRightKeccak.ts @@ -1,6 +1,6 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; -import { TestEfficientLeftRightKeccak } from "../../typechain-types"; +import { TestEfficientLeftRightKeccak } from "../../../typechain-types"; import { deployFromFactory } from "../common/deployment"; import { generateKeccak256, generateRandomBytes } from "../common/helpers"; diff --git a/contracts/test/lib/mimc.ts b/contracts/test/hardhat/libraries/Mimc.ts similarity index 92% rename from contracts/test/lib/mimc.ts rename to contracts/test/hardhat/libraries/Mimc.ts index e97ddf9fc..ea6c31314 100644 --- a/contracts/test/lib/mimc.ts +++ b/contracts/test/hardhat/libraries/Mimc.ts @@ -1,8 +1,8 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { Mimc } from "../../typechain-types"; -import mimcTestData from "../testData/mimc-test-data.json"; +import { Mimc } from "../../../typechain-types"; +import mimcTestData from "../_testData/mimc-test-data.json"; import { deployFromFactory } from "../common/deployment"; import { expectRevertWithCustomError } from "../common/helpers"; diff --git a/contracts/test/lib/SparseMerkleProof.ts b/contracts/test/hardhat/libraries/SparseMerkleProof.ts similarity index 98% rename from contracts/test/lib/SparseMerkleProof.ts rename to contracts/test/hardhat/libraries/SparseMerkleProof.ts index 3a47f45ea..30f1a10de 100644 --- a/contracts/test/lib/SparseMerkleProof.ts +++ b/contracts/test/hardhat/libraries/SparseMerkleProof.ts @@ -1,8 +1,8 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { Mimc, SparseMerkleProof } from "../../typechain-types"; -import merkleProofTestData from "../testData/merkle-proof-data.json"; +import { Mimc, SparseMerkleProof } from "../../../typechain-types"; +import merkleProofTestData from "../_testData/merkle-proof-data.json"; import { deployFromFactory } from "../common/deployment"; import { expectRevertWithCustomError } from "../common/helpers"; diff --git a/contracts/test/messageService/MessageServiceBase.ts b/contracts/test/hardhat/messaging/MessageServiceBase.ts similarity index 99% rename from contracts/test/messageService/MessageServiceBase.ts rename to contracts/test/hardhat/messaging/MessageServiceBase.ts index 281450076..7bd301b7b 100644 --- a/contracts/test/messageService/MessageServiceBase.ts +++ b/contracts/test/hardhat/messaging/MessageServiceBase.ts @@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { TestL2MessageService, TestMessageServiceBase } from "../../typechain-types"; +import { TestL2MessageService, TestMessageServiceBase } from "../../../typechain-types"; import { INITIALIZED_ERROR_MESSAGE, INITIAL_WITHDRAW_LIMIT, diff --git a/contracts/test/messageService/l1/L1MessageManager.ts b/contracts/test/hardhat/messaging/l1/L1MessageManager.ts similarity index 98% rename from contracts/test/messageService/l1/L1MessageManager.ts rename to contracts/test/hardhat/messaging/l1/L1MessageManager.ts index b5a0b0e65..30d638b2f 100644 --- a/contracts/test/messageService/l1/L1MessageManager.ts +++ b/contracts/test/hardhat/messaging/l1/L1MessageManager.ts @@ -1,6 +1,6 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; -import { TestL1MessageManager } from "../../../typechain-types"; +import { TestL1MessageManager } from "../../../../typechain-types"; import { INBOX_STATUS_UNKNOWN } from "../../common/constants"; import { deployFromFactory } from "../../common/deployment"; import { diff --git a/contracts/test/messageService/l2/L2MessageManager.ts b/contracts/test/hardhat/messaging/l2/L2MessageManager.ts similarity index 99% rename from contracts/test/messageService/l2/L2MessageManager.ts rename to contracts/test/hardhat/messaging/l2/L2MessageManager.ts index 51f75a147..36bb60a49 100644 --- a/contracts/test/messageService/l2/L2MessageManager.ts +++ b/contracts/test/hardhat/messaging/l2/L2MessageManager.ts @@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { TestL2MessageManager } from "../../../typechain-types"; +import { TestL2MessageManager } from "../../../../typechain-types"; import { DEFAULT_ADMIN_ROLE, GENERAL_PAUSE_TYPE, diff --git a/contracts/test/messageService/l2/L2MessageService.ts b/contracts/test/hardhat/messaging/l2/L2MessageService.ts similarity index 99% rename from contracts/test/messageService/l2/L2MessageService.ts rename to contracts/test/hardhat/messaging/l2/L2MessageService.ts index e59d51415..19cff34c5 100644 --- a/contracts/test/messageService/l2/L2MessageService.ts +++ b/contracts/test/hardhat/messaging/l2/L2MessageService.ts @@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers, upgrades } from "hardhat"; -import { TestL2MessageService, TestReceivingContract } from "../../../typechain-types"; +import { TestL2MessageService, TestReceivingContract } from "../../../../typechain-types"; import { ADDRESS_ZERO, BLOCK_COINBASE, @@ -41,7 +41,7 @@ import { generateKeccak256Hash, } from "../../common/helpers"; import { ZeroAddress } from "ethers"; -import { generateRoleAssignments } from "../../../common/helpers"; +import { generateRoleAssignments } from "../../../../common/helpers"; import { L2_MESSAGE_SERVICE_PAUSE_TYPES_ROLES, L2_MESSAGE_SERVICE_ROLES, @@ -50,7 +50,7 @@ import { PAUSE_L2_L1_ROLE, UNPAUSE_L1_L2_ROLE, UNPAUSE_L2_L1_ROLE, -} from "../../../common/constants"; +} from "../../../../common/constants"; describe("L2MessageService", () => { let l2MessageService: TestL2MessageService; diff --git a/contracts/test/messageService/lib/SparseMerkleTreeVerifier.ts b/contracts/test/hardhat/messaging/libraries/SparseMerkleTreeVerifier.ts similarity index 98% rename from contracts/test/messageService/lib/SparseMerkleTreeVerifier.ts rename to contracts/test/hardhat/messaging/libraries/SparseMerkleTreeVerifier.ts index cf5426bc8..302a06e28 100644 --- a/contracts/test/messageService/lib/SparseMerkleTreeVerifier.ts +++ b/contracts/test/hardhat/messaging/libraries/SparseMerkleTreeVerifier.ts @@ -2,10 +2,10 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { TestSparseMerkleTreeVerifier } from "../../../typechain-types"; +import { TestSparseMerkleTreeVerifier } from "../../../../typechain-types"; import { MAX_UINT32, MAX_UINT33, MESSAGE_FEE, MESSAGE_VALUE_1ETH } from "../../common/constants"; import { deployFromFactory } from "../../common/deployment"; -import { expectRevertWithCustomError, generateRandomBytes, range } from "contracts/test/common/helpers"; +import { expectRevertWithCustomError, generateRandomBytes, range } from "../../common/helpers"; describe("SparseMerkleTreeVerifier", () => { let sparseMerkleTreeVerifier: TestSparseMerkleTreeVerifier; diff --git a/contracts/test/tools/RecoverFunds.ts b/contracts/test/hardhat/recovery/RecoverFunds.ts similarity index 98% rename from contracts/test/tools/RecoverFunds.ts rename to contracts/test/hardhat/recovery/RecoverFunds.ts index 267909865..30a67118d 100644 --- a/contracts/test/tools/RecoverFunds.ts +++ b/contracts/test/hardhat/recovery/RecoverFunds.ts @@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { RecoverFunds, TestExternalCalls } from "../../typechain-types"; +import { RecoverFunds, TestExternalCalls } from "../../../typechain-types"; import { ADDRESS_ZERO, DEFAULT_ADMIN_ROLE, diff --git a/contracts/test/LineaRollup.ts b/contracts/test/hardhat/rollup/LineaRollup.ts similarity index 98% rename from contracts/test/LineaRollup.ts rename to contracts/test/hardhat/rollup/LineaRollup.ts index 76c0fc8e3..f324d2bfc 100644 --- a/contracts/test/LineaRollup.ts +++ b/contracts/test/hardhat/rollup/LineaRollup.ts @@ -4,14 +4,14 @@ import { expect } from "chai"; import { config, ethers, upgrades } from "hardhat"; import { HardhatNetworkHDAccountsConfig } from "hardhat/types"; import { BaseContract, Contract, HDNodeWallet, Transaction, Wallet, ZeroAddress } from "ethers"; -import { CallForwardingProxy, TestLineaRollup, TestLineaRollupV5 } from "../typechain-types"; -import calldataAggregatedProof1To155 from "./testData/compressedData/aggregatedProof-1-155.json"; -import blobAggregatedProof1To155 from "./testData/compressedDataEip4844/aggregatedProof-1-155.json"; -import blobMultipleAggregatedProof1To81 from "./testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json"; -import firstCompressedDataContent from "./testData/compressedData/blocks-1-46.json"; -import secondCompressedDataContent from "./testData/compressedData/blocks-47-81.json"; -import fourthCompressedDataContent from "./testData/compressedData/blocks-115-155.json"; -import fourthMultipleCompressedDataContent from "./testData/compressedData/multipleProofs/blocks-120-153.json"; +import { CallForwardingProxy, TestLineaRollup, TestLineaRollupV5 } from "../../../typechain-types"; +import calldataAggregatedProof1To155 from "../_testData/compressedData/aggregatedProof-1-155.json"; +import blobAggregatedProof1To155 from "../_testData/compressedDataEip4844/aggregatedProof-1-155.json"; +import blobMultipleAggregatedProof1To81 from "../_testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json"; +import firstCompressedDataContent from "../_testData/compressedData/blocks-1-46.json"; +import secondCompressedDataContent from "../_testData/compressedData/blocks-47-81.json"; +import fourthCompressedDataContent from "../_testData/compressedData/blocks-115-155.json"; +import fourthMultipleCompressedDataContent from "../_testData/compressedData/multipleProofs/blocks-120-153.json"; import { ADDRESS_ZERO, GENERAL_PAUSE_TYPE, @@ -45,8 +45,8 @@ import { UNPAUSE_L1_L2_ROLE, UNPAUSE_L2_L1_ROLE, LINEA_ROLLUP_INITIALIZE_SIGNATURE, -} from "./common/constants"; -import { deployUpgradableFromFactory } from "./common/deployment"; +} from "../common/constants"; +import { deployUpgradableFromFactory } from "../common/deployment"; import { calculateRollingHash, encodeData, @@ -68,10 +68,10 @@ import { calculateLastFinalizedState, expectEvents, expectEventDirectFromReceiptData, -} from "./common/helpers"; -import { CalldataSubmissionData, ShnarfDataGenerator } from "./common/types"; -import aggregatedProof1To81 from "./testData/compressedData/multipleProofs/aggregatedProof-1-81.json"; -import aggregatedProof82To153 from "./testData/compressedData/multipleProofs/aggregatedProof-82-153.json"; +} from "../common/helpers"; +import { CalldataSubmissionData, ShnarfDataGenerator } from "../common/types"; +import aggregatedProof1To81 from "../_testData/compressedData/multipleProofs/aggregatedProof-1-81.json"; +import aggregatedProof82To153 from "../_testData/compressedData/multipleProofs/aggregatedProof-82-153.json"; import * as kzg from "c-kzg"; import { LINEA_ROLLUP_PAUSE_TYPES_ROLES, @@ -80,7 +80,7 @@ import { } from "contracts/common/constants"; import { generateRoleAssignments } from "contracts/common/helpers"; -kzg.loadTrustedSetup(`${__dirname}/testData/trusted_setup.txt`); +kzg.loadTrustedSetup(`${__dirname}/../_testData/trusted_setup.txt`); describe("Linea Rollup contract", () => { let lineaRollup: TestLineaRollup; @@ -2428,7 +2428,7 @@ describe("Linea Rollup contract", () => { verifier = await plonkVerifier.getAddress(); const lineaRollup = (await deployUpgradableFromFactory( - "src/_testing/unit/TestLineaRollupV5.sol:TestLineaRollupV5", + "src/_testing/unit/rollup/TestLineaRollupV5.sol:TestLineaRollupV5", [ parentStateRootHash, 0, @@ -2486,7 +2486,7 @@ describe("Linea Rollup contract", () => { // Deploy new implementation const newLineaRollupFactory = await ethers.getContractFactory( - "src/_testing/unit/TestLineaRollup.sol:TestLineaRollup", + "src/_testing/unit/rollup/TestLineaRollup.sol:TestLineaRollup", ); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, @@ -2526,7 +2526,7 @@ describe("Linea Rollup contract", () => { // Deploy new LineaRollup implementation const newLineaRollupFactory = await ethers.getContractFactory( - "src/_testing/unit/TestLineaRollup.sol:TestLineaRollup", + "src/_testing/unit/rollup/TestLineaRollup.sol:TestLineaRollup", ); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, diff --git a/contracts/test/lib/PauseManager.ts b/contracts/test/hardhat/security/PauseManager.ts similarity index 86% rename from contracts/test/lib/PauseManager.ts rename to contracts/test/hardhat/security/PauseManager.ts index d2cb3614e..c7ea888e9 100644 --- a/contracts/test/lib/PauseManager.ts +++ b/contracts/test/hardhat/security/PauseManager.ts @@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { TestPauseManager } from "../../typechain-types"; +import { TestPauseManager } from "../../../typechain-types"; import { DEFAULT_ADMIN_ROLE, GENERAL_PAUSE_TYPE, @@ -27,7 +27,12 @@ import { UNUSED_PAUSE_TYPE, } from "../common/constants"; import { deployUpgradableFromFactory } from "../common/deployment"; -import { buildAccessErrorMessage, expectEvent, expectRevertWithCustomError, expectRevertWithReason } from "../common/helpers"; +import { + buildAccessErrorMessage, + expectEvent, + expectRevertWithCustomError, + expectRevertWithReason, +} from "../common/helpers"; async function deployTestPauseManagerFixture(): Promise { return deployUpgradableFromFactory("TestPauseManager", [ @@ -103,33 +108,58 @@ describe("PauseManager", () => { }); it("should fail updateUnpauseTypeRole if roles are not different", async () => { - const updateCall = pauseManager.connect(pauseManagerAccount).updatePauseTypeRole(GENERAL_PAUSE_TYPE, PAUSE_ALL_ROLE); + const updateCall = pauseManager + .connect(pauseManagerAccount) + .updatePauseTypeRole(GENERAL_PAUSE_TYPE, PAUSE_ALL_ROLE); await expectRevertWithCustomError(pauseManager, updateCall, "RolesNotDifferent"); }); it("should fail updateUnpauseTypeRole if roles are not different", async () => { - const updateCall = pauseManager.connect(pauseManagerAccount).updateUnpauseTypeRole(GENERAL_PAUSE_TYPE, UNPAUSE_ALL_ROLE); + const updateCall = pauseManager + .connect(pauseManagerAccount) + .updateUnpauseTypeRole(GENERAL_PAUSE_TYPE, UNPAUSE_ALL_ROLE); await expectRevertWithCustomError(pauseManager, updateCall, "RolesNotDifferent"); }); it("should update pause type role with pausing working", async () => { - const updateCall = pauseManager.connect(pauseManagerAccount).updatePauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); - await expectEvent(pauseManager, updateCall, "PauseTypeRoleUpdated", [GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE, PAUSE_ALL_ROLE]) + const updateCall = pauseManager + .connect(pauseManagerAccount) + .updatePauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); + await expectEvent(pauseManager, updateCall, "PauseTypeRoleUpdated", [ + GENERAL_PAUSE_TYPE, + DEFAULT_ADMIN_ROLE, + PAUSE_ALL_ROLE, + ]); await pauseManager.connect(defaultAdmin).pauseByType(GENERAL_PAUSE_TYPE); expect(await pauseManager.isPaused(GENERAL_PAUSE_TYPE)).to.be.true; }); it("should fail to pause with old role", async () => { - const updateCall = pauseManager.connect(pauseManagerAccount).updatePauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); - await expectEvent(pauseManager, updateCall, "PauseTypeRoleUpdated", [GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE, PAUSE_ALL_ROLE]) + const updateCall = pauseManager + .connect(pauseManagerAccount) + .updatePauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); + await expectEvent(pauseManager, updateCall, "PauseTypeRoleUpdated", [ + GENERAL_PAUSE_TYPE, + DEFAULT_ADMIN_ROLE, + PAUSE_ALL_ROLE, + ]); - await expectRevertWithReason(pauseManager.connect(pauseManagerAccount).pauseByType(GENERAL_PAUSE_TYPE), buildAccessErrorMessage(pauseManagerAccount, DEFAULT_ADMIN_ROLE)); + await expectRevertWithReason( + pauseManager.connect(pauseManagerAccount).pauseByType(GENERAL_PAUSE_TYPE), + buildAccessErrorMessage(pauseManagerAccount, DEFAULT_ADMIN_ROLE), + ); }); it("should update unpause type role with unpausing working", async () => { - const updateCall = pauseManager.connect(pauseManagerAccount).updateUnpauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); - await expectEvent(pauseManager, updateCall, "UnPauseTypeRoleUpdated", [GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE, UNPAUSE_ALL_ROLE]) + const updateCall = pauseManager + .connect(pauseManagerAccount) + .updateUnpauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); + await expectEvent(pauseManager, updateCall, "UnPauseTypeRoleUpdated", [ + GENERAL_PAUSE_TYPE, + DEFAULT_ADMIN_ROLE, + UNPAUSE_ALL_ROLE, + ]); // pause with non-modified pausing account await pauseManager.connect(pauseManagerAccount).pauseByType(GENERAL_PAUSE_TYPE); @@ -140,14 +170,23 @@ describe("PauseManager", () => { }); it("should fail to unpause with old role", async () => { - const updateCall = pauseManager.connect(pauseManagerAccount).updateUnpauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); - await expectEvent(pauseManager, updateCall, "UnPauseTypeRoleUpdated", [GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE, UNPAUSE_ALL_ROLE]) + const updateCall = pauseManager + .connect(pauseManagerAccount) + .updateUnpauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); + await expectEvent(pauseManager, updateCall, "UnPauseTypeRoleUpdated", [ + GENERAL_PAUSE_TYPE, + DEFAULT_ADMIN_ROLE, + UNPAUSE_ALL_ROLE, + ]); // pause with non-modified pausing account await pauseManager.connect(pauseManagerAccount).pauseByType(GENERAL_PAUSE_TYPE); expect(await pauseManager.isPaused(GENERAL_PAUSE_TYPE)).to.be.true; - await expectRevertWithReason(pauseManager.connect(pauseManagerAccount).unPauseByType(GENERAL_PAUSE_TYPE), buildAccessErrorMessage(pauseManagerAccount, DEFAULT_ADMIN_ROLE)); + await expectRevertWithReason( + pauseManager.connect(pauseManagerAccount).unPauseByType(GENERAL_PAUSE_TYPE), + buildAccessErrorMessage(pauseManagerAccount, DEFAULT_ADMIN_ROLE), + ); }); }); @@ -204,11 +243,19 @@ describe("PauseManager", () => { describe("Specific type pausing", () => { describe("Unused pause type", () => { it("should revert when pausing with the unused pause type", async () => { - await expectRevertWithCustomError(pauseManager, pauseManager.pauseByType(UNUSED_PAUSE_TYPE), "PauseTypeNotUsed"); + await expectRevertWithCustomError( + pauseManager, + pauseManager.pauseByType(UNUSED_PAUSE_TYPE), + "PauseTypeNotUsed", + ); }); it("should revert when unpausing with the unused pause type", async () => { - await expectRevertWithCustomError(pauseManager, pauseManager.unPauseByType(UNUSED_PAUSE_TYPE), "PauseTypeNotUsed"); + await expectRevertWithCustomError( + pauseManager, + pauseManager.unPauseByType(UNUSED_PAUSE_TYPE), + "PauseTypeNotUsed", + ); }); }); diff --git a/contracts/test/messageService/lib/RateLimiter.ts b/contracts/test/hardhat/security/RateLimiter.ts similarity index 98% rename from contracts/test/messageService/lib/RateLimiter.ts rename to contracts/test/hardhat/security/RateLimiter.ts index c142030fa..2f3d96a01 100644 --- a/contracts/test/messageService/lib/RateLimiter.ts +++ b/contracts/test/hardhat/security/RateLimiter.ts @@ -9,14 +9,14 @@ import { ONE_DAY_IN_SECONDS, RATE_LIMIT_SETTER_ROLE, USED_RATE_LIMIT_RESETTER_ROLE, -} from "../../common/constants"; -import { deployUpgradableFromFactory } from "../../common/deployment"; +} from "../common/constants"; +import { deployUpgradableFromFactory } from "../common/deployment"; import { buildAccessErrorMessage, expectEvent, expectRevertWithCustomError, expectRevertWithReason, -} from "../../common/helpers"; +} from "../common/helpers"; describe("Rate limiter", () => { let testRateLimiter: TestRateLimiter; diff --git a/contracts/test/token/LineaSurgeXP.ts b/contracts/test/hardhat/tokens/LineaSurgeXP.ts similarity index 99% rename from contracts/test/token/LineaSurgeXP.ts rename to contracts/test/hardhat/tokens/LineaSurgeXP.ts index c642520d4..5adefbb4a 100644 --- a/contracts/test/token/LineaSurgeXP.ts +++ b/contracts/test/hardhat/tokens/LineaSurgeXP.ts @@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { LineaSurgeXP, TestLineaSurgeXP } from "../../typechain-types"; +import { LineaSurgeXP, TestLineaSurgeXP } from "../../../typechain-types"; import { ADDRESS_ZERO, DEFAULT_ADMIN_ROLE, MINTER_ROLE, TRANSFER_ROLE } from "../common/constants"; import { deployFromFactory } from "../common/deployment"; diff --git a/contracts/test/token/LineaVoyageXP.ts b/contracts/test/hardhat/tokens/LineaVoyageXP.ts similarity index 99% rename from contracts/test/token/LineaVoyageXP.ts rename to contracts/test/hardhat/tokens/LineaVoyageXP.ts index 4130f7be6..00cad3df9 100644 --- a/contracts/test/token/LineaVoyageXP.ts +++ b/contracts/test/hardhat/tokens/LineaVoyageXP.ts @@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { LineaVoyageXP } from "../../typechain-types"; +import { LineaVoyageXP } from "../../../typechain-types"; import { DEFAULT_ADMIN_ROLE, MINTER_ROLE } from "../common/constants"; import { deployFromFactory } from "../common/deployment"; import { buildAccessErrorMessage, expectRevertWithCustomError, expectRevertWithReason } from "../common/helpers"; diff --git a/contracts/test/token/TokenMintingRateLimiter.ts b/contracts/test/hardhat/tokens/TokenMintingRateLimiter.ts similarity index 98% rename from contracts/test/token/TokenMintingRateLimiter.ts rename to contracts/test/hardhat/tokens/TokenMintingRateLimiter.ts index 94c574b68..834c6074b 100644 --- a/contracts/test/token/TokenMintingRateLimiter.ts +++ b/contracts/test/hardhat/tokens/TokenMintingRateLimiter.ts @@ -10,9 +10,8 @@ import { RATE_LIMIT_SETTER_ROLE, } from "../common/constants"; import { deployFromFactory } from "../common/deployment"; -import { TokenMintingRateLimiter } from "../../typechain-types/contracts/token/TokenMintingRateLimiter"; -import { LineaVoyageXP } from "../../typechain-types"; import { buildAccessErrorMessage, expectRevertWithCustomError, expectRevertWithReason } from "../common/helpers"; +import { LineaVoyageXP, TokenMintingRateLimiter } from "../../../typechain-types"; describe("Token Minting Rate Limiter", () => { let tokenMintingRateLimiter: TokenMintingRateLimiter; diff --git a/contracts/test/testData/compressedData/aggregatedProof-1-155.json b/contracts/test/testData/compressedData/aggregatedProof-1-155.json deleted file mode 100644 index 7b39731f1..000000000 --- a/contracts/test/testData/compressedData/aggregatedProof-1-155.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "finalShnarf": "0xdf1e9f621e3a89f02d44dbc266056d50d5d1524dc4d135f93b81619f3d674b7c", - "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", - "aggregatedProof": "0x2e6431c2cbb8021cc213885d08b39ccb38215789c2fdced773bd4d46d41a6b8217d476fbffa85477a18981fe0ec8c776171a656b8a12a746a3319e2b54c87a400f102032e51da42427391a70286fbc85fd0dd0a49c5ae890e485ff64c0b8ab9d14ec859fdf2eaeff4997e0eb0f429bda9cdf4afef98021dab7853ede9bf3983d28d3b6b08cc253e8ac6dfd36da607ac729f97bfe52da6722c9b9b994db805934143c5c006b101df5174557240204dec4a34cacf76108e7899304c565ac4d6a18086d779a0f60c70925556824c13ac6c269eefc7aa1c1c71b9d534c5e3da6663b04d66f0539ba5396c86e1a823874b7930cd5e5e724456401bc4ec78fef893f7603312b8200ff4885183eb18caa39f3cc5addf3fa269ac3779d2e3147ef8c2e3b2e8a57e79f5817343b1a003c3aff6a8c1472b43c7bb4294ef21e8c6b32e374f901f8067adb88e2fa5acfab716e76c16c25ab3b65cbfcb45b20c376de1b52849316fdca7b5b33aa27b93047fabd81c90de25f77af21746e9323857db6c2228bf12e642cdee60640d21c1fa93085a188757e4d1af7979797c8009d2e94ae08201712498ebb4ba0dd28ce715c09af2849d9b5f3b52f366be9f677291a7adc16e13127a5d239e8a0f92ee532763c46ea4736067653048c57e2b195a73abbdbdf487f2c5fd68152c9df7e5f1bfe20c650b3db1c2c0a595df56221295092bc5847326c1779d7179390ee89f6167e3ab5af2e7183fab9e9e7790c78f0068ee2c958b20f05a975167f7e6b69c1a780b05e9b0dd82ed462bde24a9e0aee2efcbc6c28f4bb199070367e57150fcb771669cf4ba8bc68085ab13e92f1866fba6c3bea5b2e2201a4de8bece0731c62ee90a9d701ac99645f15ead828cb880f8b35f6036e463e12cc0a7c346ba3b8803e53d119d8543569d743723d88e99a4154871153d37399173bd6539f441ca603501f8f402e7b5836c7960550e137dbef5bc7c8c20d7da823aa871781f2f61565ef75bbcb703f3d7dff21322921d93e5c7a071778576aa3180c347201bfcac60ffe35ee3b5054ddf149af7a841a05fcdc7b554cbea8d6362635ba41d6b779fc01e850b450f576a34c528e850868d43764dd71755d4fe770010928c3f6c62450523d5bdfbdda93586d6dfc3ec9e685e2d247502d3836fc7910db1865595094ec3c49a5ab8f84b9c432bc1d6191354dfed12feb07415fc3fa", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x233fd3d94f86264d6b666cdcb455c1cb144d3dc399edc9d17bd50aa42ae789a2", - "dataHashes": [ - "0x7126453ddb4c09537a505a70bae0dd57a3f5daba4522fa1f79b760fb28efb35c", - "0x82694a9670032c50548d42dbf6f0d9d09febc4f2454796997ec9a4edc7f87106", - "0x08a70f876b12e010a0c34fe2bb03389fbeaf1749e9528359b7196df67a8c76fc", - "0x93eb7218f429a6efeb1ce6931a3915e0a032131ca9ff6ccc5c8428178221aa4c" - ], - "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", - "parentAggregationLastBlockTimestamp": 1683325137, - "lastFinalizedBlockNumber": 0, - "finalTimestamp": 1683335137, - "finalBlockNumber": 155, - "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", - "l1RollingHashMessageNumber": 1, - "l2MerkleRoots": [ - "0x8c11bf3dd28eeb8e951be357df5c22d4de2500ac61ecb04da92971c71b55585c" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/contracts/test/testData/compressedData/multipleProofs/aggregatedProof-1-81.json b/contracts/test/testData/compressedData/multipleProofs/aggregatedProof-1-81.json deleted file mode 100644 index 289db3244..000000000 --- a/contracts/test/testData/compressedData/multipleProofs/aggregatedProof-1-81.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "finalShnarf": "0x6d2b3535e06f4778e03c8439145dd9b8e4ae312953b9ccc154ef73b8a00c26c1", - "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", - "aggregatedProof": "0x008e483358dc0ac1d3f6a27b43f6332e88c4196151b2a1ce6c8575013cec2cbe2f666e5649165dfc5a88ede985203341f5910ec2f4e3d4e9fa2a0a2621e4b0a70a91e0f995a8d754a3ddec1698800be83da8815650488540d2ffb699eaf3518d14bff479974f1f5f8bef7687f89c6301247cd92a4ccfa76a868bd24090a670f20eb06513431e74411648ab8c02a270353146bc759451d00cf2a59477d6106b9d11df3e18bca0d3a36951e31699b21a73e22a77fb7fe43a33b717a23dd06a889a102e4143d1e024e053e4318f903c3dbd0ec0f6e49672dd0ccb10749ac00adaf311149a24bf2c2ee4cfe7ed1db713526c6f7c0893f2ec153e5f55a4b390ce135a0d3ebe372c1beea8142afebdc96fe2764b8b5a33efc0457b9ad65f678c8b9ede196eb1fe34a82e0f370fe1d53e5cfc34bc77f38a64eddbb74f6530a82feb0e0a148de4d309b179697ff8a3c97a5516a1bbffc36d8cf153e9f5ee8fdc98002fd1136a2a12603aa1c7a985b34c5dc6774a5efd6270eac180406b4f03c7ef08eee428bb45d04a3c6635a0225aae76c0522049df5080045629cd6a686c2d50d8b7fe10e6facded652c8d75d4a67d5f8f4c3c6b491f44cc23c307064ec94f7c3a44eb1d1dcd369464960e54a88ad3f9edbdd818f2ac711d6c8f49efe224fb2616f2ac0005ca0c753c801d9e2df1133cdd4de5e54554197ac3e2f42d0b140261a12796050d64ec14bb22355173d157a7a2a9a5c0a20d47430819b4c106fda54923f9bf273cbc4145962e07b853279e64e198d3da5919814935c4cf12ffc03128d0e4fc24e8f35180d257253c0ce33725cb665a81141f16418fb20cf2abb96fa65a03bc0fa8e1e842123e2a2590f423e34c1db2c51c9e872ea41942d44d94d735cf8b4b0ccc265c6bdc41dd6f1167da133450a5ea0c07ea4704c9ca377cd201d8a63f932f7d4c9edb88269008bfe08d91d576cbf1a46c2da88b13d2a38e68f66f330552114f37a226c38ed3a9acd35b75f5852e6879eb3c8746ed2676f9e3957d32bbee1493ac055f03a56e964c4ea278d323abde55b36439b5460897771bf5ef3be1992448a5479f3515d5605d403a51391c6c6db94a90b3353aa956a5ba6f7b951fee2b7657ab431f90220c84820c2db8e4b57eaa5c3ea13e8d1f4ed31b9434c5df5c083dbb24fdf9dc5a64ba7416e6d154e6b17727a3acaa9f59820e926196efd232", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x216ea864c4d4392d0315997af776dbc1856686e376a07c85ed67f8509c14328e", - "dataHashes": [ - "0x7126453ddb4c09537a505a70bae0dd57a3f5daba4522fa1f79b760fb28efb35c", - "0x82694a9670032c50548d42dbf6f0d9d09febc4f2454796997ec9a4edc7f87106" - ], - "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", - "parentAggregationLastBlockTimestamp": 1683325137, - "lastFinalizedBlockNumber": 0, - "finalTimestamp": 1683335137, - "finalBlockNumber": 81, - "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", - "l1RollingHashMessageNumber": 1, - "l2MerkleRoots": [ - "0x6de197db892fd7d3fe0a389452dae0c5d0520e23d18ad20327546e2189a7e3f1" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/contracts/test/testData/compressedData/multipleProofs/aggregatedProof-82-153.json b/contracts/test/testData/compressedData/multipleProofs/aggregatedProof-82-153.json deleted file mode 100644 index c2c7f80b2..000000000 --- a/contracts/test/testData/compressedData/multipleProofs/aggregatedProof-82-153.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "finalShnarf": "0x4b7f110cbe7fcab315cd99683b2c7864bff2615903a3230d5bf2222b7a71a756", - "parentAggregationFinalShnarf": "0x6d2b3535e06f4778e03c8439145dd9b8e4ae312953b9ccc154ef73b8a00c26c1", - "aggregatedProof": "0x2ccd7bc052a4a3347fd0fc9134d62c37208cbf5af79ceda0a62bde3861db8329195f5d25f8fee76a7d37c45055766e059dd3750dec0b903783b5928b8a5e8c830a5336cd5876cb7c1a4cb5cf329f1f6c932a38121778a56a2a80d41cf75da03013a32e6ef9159e335e8943fd9daba6d58f48a68f47dd24585cf59e50ce79cf300d84d08f9db0c62db91f0b00f410acd88e1f6217ae3565db6535a086b781038d15bdb30229a0e1a191d5ea26f38cc27bec2ac3b9ddc00ca88ce0b27a745a7b271eb64a673306440b812ac79c53c345adb2c4a7d6d983dab3e8b00e83fc36e0ba3018527b30a861d10944d6d05b295a3dcfe956da4a6b42610ec703ffe74248fb0154a0dfc7bdc8dedcfc4e6bc884a10ba3aa3073efcacd66cf7d59e38a74aa1000a36354762974e610be1ee6988f91f58ea4fa7f3335736a8af7075ffb10ea2a0bede1074f138237a509373679a8d781308401b1ac283772ce163ad1efc5af2216899a8499375154809be8367318d7916933a34f02cf76d20d7715a289c174580229d78df12a39593212751e2e70f26909f7fafc6d63bc877d28278049406f3104b870a14218cf11b2422bb46dafb11aa4fecac8d7bd8570eb72b955688bbfc80cb0fb367fddb4826b6ff2285ddf6d147f38ba068e3d35cf0568a8141e3871b61eeabdbab18df69f0e8087484c2fa7eb15241b8d0e40d2883daf1addff7691e3241ad52968445fb97749bbe4ab7ab2e31717ed545c9d078a57eab2de9cd9db982377d1ba338e35fe231a05a1b81b4c9d4d1332c97cdfc1d0b6e3c6f190c932f201e8814a714bff8c37e80b1aac4ae26c8fe4fa68ca041713aacd705b3306926617503f4eca6c1893e6f5ced6ece0614e66624b9b817c664bc26e3bda711501980cf48324ee61112ac8105e1d645dd72ea6f99312a9f99f37e156b54f4d07f65c2d2dea5a66368fe0d42efbeb6983c81622c5e25eae779dd9ae3be074ca9772be1e65c0906da0e0f408b3daee7d505b99cfabaa3427a9a1abbfe78d273275fe2606f9e57936aad44f500f8ade2e3c0c350dcfbbeba3218205ee74818376bc87f70d0bb1ba55e09ba360aa28037bd8d99ba3ff700045c525b6c8a08acddbaf75d12e3a7863068be75c7e889962d10b6e0d40e0ae9c8334be7597e45936a12249ea0578371f6f0bc77cffeb47527760fcd3ead96ec5349779e8142b8cf6a9304eba", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x0ecda6d6b122aa50210c937e14351066a6e98db71c066ace19abb75a3abdfda8", - "dataHashes": [ - "0xd1ef92f67e60ec41ee3b2f448024802d1608c138d4770ab1d3ada17facd6f0cc", - "0xa54a0666ba33710a751591da5edb268dc309934de83a5efa03eefc6e2e384737" - ], - "dataParentHash": "0x82694a9670032c50548d42dbf6f0d9d09febc4f2454796997ec9a4edc7f87106", - "parentStateRootHash": "0xf0f26782f7afb93f926cacb145f55530714f20b1356725e3971dc99e0ef8b591", - "parentAggregationLastBlockTimestamp": 1683335137, - "lastFinalizedBlockNumber": 81, - "finalTimestamp": 1683355137, - "finalBlockNumber": 153, - "l1RollingHash": "0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", - "l1RollingHashMessageNumber": 14, - "l2MerkleRoots": [ - "0xf82d0ea8590489e98ca4279f30bd4b32a4fd62e6574ddc4f606d6496096b3721" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/contracts/test/testData/compressedData/test/aggregatedProof-1-46.json b/contracts/test/testData/compressedData/test/aggregatedProof-1-46.json deleted file mode 100644 index 8d8e761ab..000000000 --- a/contracts/test/testData/compressedData/test/aggregatedProof-1-46.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "finalShnarf": "0x9562fa89830a0ba0063a636ca96e52ce2f032b855336c95dd788321f4e193419", - "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", - "aggregatedProof": "0x2b8a08e4b319c731ae97081a486f1194d72740fa1bc4a4bdcd310ddf50a75c2f02e6ae770debd31337489d9655d16ab026af7219695762a2475a4875263aa2c120fc987bcfb7e9fdeac64a1db6bc5c9d4d7731a583d84a5d8db3e69132b5583116bb7a6ac8f081a1c33fecf42b51b7f8f827066b79e19d45d587d368ebfee5421e6a8a0d63a2fe696e647088d81c1b6c96190432f42bf5f7cdedddc3fd0698581dc557b353523782c2f137f71cd76f790f4b8be7c5d3f200befaaca4cf95366328cc64b4c98566701bde2e5710cc84dbbaa50e2d1f29147bcbc506924adfd30e016218b1f40bcc6a0bac3faa9023f6855e217a5d98ac9fc7f14005adfc18d52c1368b188aaacf77ec4bbf81a6ebc567330eb405db0effdc9447f744d0595732b19322fcdba4be23e05844ecbda382ba93730fc21d9d12200f0bc625a2f5350840348893f7a0600fdd932e86a2b6c28500fb40eb578563061ce1a27bb401eb7f128233c28ecf4e3e35ed53657aaf820a4cfe9a4057c496e95fc23031c2717bf761fb7a6e471e57990f36187c93c8159929a0141ed568eb05b68dad58fc826c3f90364821de7e0cefeff209bcd7f5250efed7cb3d6ad435fc774161cfb6787916a0f669b7c1668e79d160c0e680d674279217c40b662ee91b5165f94d6939e2a5a05ab12b274c697e35d60943be8aa53ff762c1d52d3390a80f76664737de582e72430b98e07146717df294d8eb5ca704444917c6c9c3f819b929af0e44e34e9dd23c7fd04a541107fb3c74bd1fb583aaf401b6fde6a48e4d8fcb0347d04d73a280c7c5f2807c540474634d323d23d8fde9173b98008d03273a55a1d023093c4730a6ce93a60ee79aa6942c159a3ddf086311e51eafbc90fb81b919a0d588c8c6529f0df37ab008b965e10f1c6560063f0b07bc2299d519bfed68b7c45953726e90997da2b84436f4906546770fe651041208734586c090efa87488dd09ccec05b12f68cfa5f2984f4970801179d5335b2f28dc9303375811736d12041580abc0b10d35acfe032f08ead34481e70668c0efed88d5461529d24352fd6f6071e363703661d460e7edec53cc933b778ddabfab152a4d7aa736b3a361534aece194b15258a67556f07fe55fe84206331187ed3bc909775fb5b4174f16475fdba91a1e9037b49216246e4658fcf5a0b026a70a6316fa0c93f196c6b4cd4eea3904067d3", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x1e77e4d1bba517cf992e7788a104fc5612e539ea2b459b532d69efe6c416235a", - "dataHashes": [ - "0x7126453ddb4c09537a505a70bae0dd57a3f5daba4522fa1f79b760fb28efb35c" - ], - "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", - "parentAggregationLastBlockTimestamp": 1683325137, - "lastFinalizedBlockNumber": 0, - "finalTimestamp": 1683335137, - "finalBlockNumber": 46, - "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", - "l1RollingHashMessageNumber": 1, - "l2MerkleRoots": [ - "0x97cd1539d08f7c0ba06ad836b2690eef50afd86609a0672517ec0ef8c1f94796" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/contracts/test/testData/compressedDataEip4844/aggregatedProof-1-155.json b/contracts/test/testData/compressedDataEip4844/aggregatedProof-1-155.json deleted file mode 100644 index 59db1f159..000000000 --- a/contracts/test/testData/compressedDataEip4844/aggregatedProof-1-155.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "finalShnarf": "0x602c8eeedd7f6dbb7bc0348da1b0dced846acf09586c9f27aa06b494a1c49249", - "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", - "aggregatedProof": "0x1ef8ad12dc4e4b2e4e8979994ab16e0e907e3d594600fe66dff8cc3c25be910508ed51fed1de1cbc4d07869125eb137ede8f908cba8a1a97e26fb666a8ac1db02480bb12080c5ff9900b12963e3dd8a7d5719b3339326232465b232a4ba53c740860893232dc4545ad6b03bb56229a56dcc186710cf398525c18caa05f915459128d2f40878e15c9911904e3c3248d259993386f56c9929d81a3f4cf4b3305931e01e03e83334d62d8581fd5b510a37403e6f53d7b6ec7299ff1bba9f2b110812de395d4b19022f90760db5046e7305620dc64f52c4096d46729b01a397bb7b72cd3d6c66c24a5eef10d3ce870f0486d83c8ec0a9817ce0af0a1b9aa9c5792230469e2cf6d693e10d8a17d60985c9e3782f33fecbd6ed02a251815da2f4e2fc4147df40a7d4e2ceea00758ccd3df17cc20585327a9820d0108dd574f1fcf896c170deac4012eb89e3540a39f3a2b73bb449e9a46bfb9c991819cdf2905398ae00e6958a50ea58f137ec3c99d1a8877e3507920f55c317d6a5fc6718ea3bc255300f1d6325be2b5a5399562a4ffbd5059a483dfc807125d7cd75dd6d668b052cf2dbe0cd5dc3a93b6d9800bde7ba796a080a5281e7b42c38963e7a1e6647ec1eb219587e94ce96c3c258828fadaa0b76bc13f9194e120c3fa8f56847b136fcdd712851a384d0d3b5975152df354ec74847395dd3f6dd4c853f258d7a855fdb12c120c46b74b715273386a5ed3c44407797fbd09f0985c177137957a1342f38e9b090be0e96f7397b6eb380544923497f8dab1c0ef4fc1553bdbcc0fcdbcda8e8604ac0162ee8c60145e4b2fa05b4d3a0e748b6e4128a29842cbffd2992f6520a0163cac4f3fe3af4f901841db9b0a22f5882d3736a498aea2c787269fbc4589c42d71fd3a43dd1b31e8f2be1af62d75172daf970241448b44a91015a7ae4e18250cf54afc8cf67756f524a1bc245c72e2dc48cece0a18f810242f37ea2d9d26460f42e555df9e183031499fd813e666939759661eb772e077150bdfc4e5d1565a2e1e957b787fdda6b1defede8aa1405a9e376212f1be6a685f2bca487440d6f20141d2969b8a40a4144675c0eea6e13512d9c85bea1d6da212f50c5ee5b4e97e29f5131c114e0a3ef0e5702c56f61c0c6fee904aa873fd7d34301d909e9dfbe306ee6a593c2e33a691b3cc62b548c35fedf1761d856e54cf9483cc32b9849ecd", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x1538dc88156cbdf280326f52e33192924ff311be4abc0dede43a14fbfb160a55", - "dataHashes": [ - "0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95", - "0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618", - "0x017b1d49c6c7947f83855cc16063ef19d02369540b97867855427b56cdaea487", - "0x012cab32c78df416fe59f8f123e2ded2466a64e201bacddc8396231f335d2088" - ], - "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", - "parentAggregationLastBlockTimestamp": 1683325137, - "lastFinalizedBlockNumber": 0, - "finalTimestamp": 1683335137, - "finalBlockNumber": 155, - "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", - "l1RollingHashMessageNumber": 1, - "l2MerkleRoots": [ - "0x8c11bf3dd28eeb8e951be357df5c22d4de2500ac61ecb04da92971c71b55585c" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/contracts/test/testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json b/contracts/test/testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json deleted file mode 100644 index 600960d2b..000000000 --- a/contracts/test/testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "finalShnarf": "0xfd910670a8da6aaaf2431ce7345a605dc15dc41298b9410065d2f7bb1ba99fea", - "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", - "aggregatedProof": "0x1bf64c1edf68a488be4029c17e6237e73300a294e09230f0d91265f00645526c2a1c08eaa28e37ac60621b21a3b592a7c65fd9809ef8ddec93050b384c78a03b253f40adaf8ec9ea0993ffbdb305ca570117c90f5b77b810f9f2fc46613dd7010ca7906b191f1658bcc6de9f22867053f26cc13dc34861a7a3934bcd328c97380c785972db98482eaf11c2f48acbb2e5e4291e77c81fe880a1eae39aa7e9b3640c3671c11caf5a72acefbd4455c8a329c7960149a9f87f71a9277a086820dd21074cca6872707e321a20dc2d9e4cca74e7e3be89035b131f8c8686510d369551120eab67ad7ab41337d4c497f7fa19f52ae643b5a5d5fe7bb4bd24f8721bbecc1d12fc89733af07f053d734e4224ed3e456eb4e3a77a0670521106792120c2451407b05a4a6848f0493e1d6e23042ca01eae8f8dfb8b2428482de113e6aa42901ce2a8417b812c67ece9a691e7cf663daa87f5453cd3dc2d738ec604fe6d7d5d0d71f96cb9df2cecd6b1cb0cc35bca85b464dac2c8f28580fe40399fa16488f00dfaacdf58ffc8e28d4a814a2ba70daad9f97c5d693a0e8bedbca897f3aa296907dfb6d1aa8b6803c5bf6d0feb7c2626719b752f0431961c5e16691a296da61a04d6253f5385c32144b0823c31b3fa6be1b6482b89941ceb5dc1ac128a36b7432cbd7de4f3acfb2aaf0e5621dd426882efbfb5b3552c079a0428fe0b0dd5b32e168db05568b22a25aa60b6f4601c918e76e7d508f32e88477f16dbff877acb6e13d99b4015b3b72255294f45b3b1d1ecad980ba0965e69ed99d5ae91d8284db00a387835b71a2afb1a3a9f0efec6c1e377229b1916a1a57b0f559bab41e7813113551b91607348eabfbfe6c4c465caad663e58b200cf8be71bdbb6f47571a94c2863bc18f4b1a7efa4f4be94400047414bf124d0f3a6c62bb329e28ee8c4bf2915b943a77934996c61a4bce84fd66ad709d30c6dfa32735bd502dad08cdf8ecd163615f6a5b1f1cbfe593aaed6dd393bcd9161ffdb8ee755035e033dc2b20d32043f12a37dd340e31d7caf70772766d83e643e3f28f0182180189911c2ba4c7f1184dfbc48d8a49f61b4447f07e3f3d7ebb35632c52de7c953a25d9643b560be02146a8064709ff90f5aee2e0cd9177442788f4548708817d3e6352078dd8a6f2fa628982fb431153c1a2b71f86627ab10026f46a35409bde3da57650eae74ae", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x02df9c4f607afe80ac52003978e4a9e197a7a0b61b6601d5e0788a6fdec1c08d", - "dataHashes": [ - "0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95", - "0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618" - ], - "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", - "parentAggregationLastBlockTimestamp": 1683325137, - "lastFinalizedBlockNumber": 0, - "finalTimestamp": 1683335137, - "finalBlockNumber": 81, - "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", - "l1RollingHashMessageNumber": 1, - "l2MerkleRoots": [ - "0x6de197db892fd7d3fe0a389452dae0c5d0520e23d18ad20327546e2189a7e3f1" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/contracts/test/testData/compressedDataEip4844/multipleProofs/aggregatedProof-82-153.json b/contracts/test/testData/compressedDataEip4844/multipleProofs/aggregatedProof-82-153.json deleted file mode 100644 index 63b5ef67b..000000000 --- a/contracts/test/testData/compressedDataEip4844/multipleProofs/aggregatedProof-82-153.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "finalShnarf": "0x42d7511a7a880ac5c3a61a0f480e95ec7b0e2cfff1aa106ea0256aa94bf2b865", - "parentAggregationFinalShnarf": "0xfd910670a8da6aaaf2431ce7345a605dc15dc41298b9410065d2f7bb1ba99fea", - "aggregatedProof": "0x004d079dc1a3b7ab15b4180dfb1248061c53baf123b0b01cb317dfc6a79ede6104ae63614c13729ff4e937991ca9484d493750ed188427fbf2f80666289623fc1ef6e53c9123bccb4c4a3cf72f62d1e45b01b9d90e5b860c683523c108eeaa1c0364e7a18f985c6db601f25830015918cb61d5bac4f167d9180497242cda9e7315067a4af58faffdc88c8dd1ea503fb97a37b83821bc5c2c5abf2335680468810f3d56de44a398f6b81afc44cb088cf146d03570fed3a3e2fcbdafe62a1febd2211f6c32e6ccf9aabac8dfd8a45be5826e5275ff5e1ff5ee48055fd7f0d050881db23c024fe39e1e774dc5cc697bbe8340f84a1fdbbd4ca898067b51a69f7737017f66c55bb7caef98d7074c6abe644b45ce4d6b9e409f8be2bc75c8d6aa85d110413355c49ca3dd62221d4a8f0719ec633d9a6dcdaafeb2a8ddd93443302b9914b94cce67a74fe652760599efc1791dee4d81aad1244a02dc532340f0a1b31f1be9ca611ee98ba83d730ebcc68547926ce95cf6f9cc26ef67492f97d6f98dd229b9d895c6fd268ffab58751b60a3cb48db3b76f985923fef11e1de0a635616724c69edd2854429298d41e9c46c9282dbb503e26463b19d28a1d05958247899408e549c63032890a253b4c0baa0e34d89c66333ec7dbbbb3aeee1e910fba34ec01b0e31aa1a8b825f794b7f7acb0b6cbbe881ee99aa24fa1bca50f59ab5f31e7259ff3c6b279b2bc1f86e1e5d04d67feee7a4fd338fa0c1d9e1911582347c76317696ecc2a8ae3bf70b666636eb9f1ba0a4422757104c991f6f60d3454bb5fad222e14b451d5d5a0b217582cfd72e3f60e5b748d7b3ba9038cdeffae11170c062dd588da6de561ef8173474a2ac39b73e47fec9968773dec18875754ed40e91021d40b19f9a97bb95ff5531f5addb0331b70e8550614b209a2667ada653a6a18189bff192b99c946dd54dabc4f6c836c28750770484d2dd84b28cad3b2e2dd5b2d8536e48921ad151cc05fe0b9412b95dbbe631cf7484ad7f114e2222339d4fe0555cf70048fc7e1658fbf306e8c4d58b9a8e70707588a7ac8e4b393f13dba5e25b2070532365c46ad698e16b979f96cab0026c5c47fd8cbc1b2365fa94857780c5f581a30150ee802fd84ec53cf6a74ba390746d42147eb0e7132a8a61408f9016202b8704661389696d88ff769f9eaf48e84b0e3988e541e8a9d687a0d3910", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x23151dfee9756b7eb4a018d5ef30730f20e05edfd3ce67a8f898c46cb2d79341", - "dataHashes": [ - "0x01bdfef0d1ddb163bf8431ea63ad7166bcd69a72a4fa30342138335d7fac96f4", - "0x0112b6fcf15707263de267fdc63c78cf9881654e88455b94fb8f9f7623223365" - ], - "dataParentHash": "0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618", - "parentStateRootHash": "0xf0f26782f7afb93f926cacb145f55530714f20b1356725e3971dc99e0ef8b591", - "parentAggregationLastBlockTimestamp": 1683335137, - "lastFinalizedBlockNumber": 81, - "finalTimestamp": 1683355137, - "finalBlockNumber": 153, - "l1RollingHash": "0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", - "l1RollingHashMessageNumber": 14, - "l2MerkleRoots": [ - "0xf82d0ea8590489e98ca4279f30bd4b32a4fd62e6574ddc4f606d6496096b3721" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-46.json b/contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-46.json deleted file mode 100644 index 8b0eb4976..000000000 --- a/contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-46.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "finalShnarf": "0x4e584b910dc758442e58e56e0bb46c001addaffe770fb740ea0e1b90c0e2b056", - "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", - "aggregatedProof": "0x22d33dbcffa57ac78ac3b3b3a2ff52d9304eecb1073c3675fcf8225048b47aa1123499604ff2c96d334772b6d94e661c7a1fbf7e99b3b4fa1f0b8a3febca98762a5734908afa886b37351314dd68ba2f7ceaf08bef33f52d463d64a23f8523572505e5aedf7e24f132e5f21c1e0577b19081113824788bc47e3fe90d5b3da24a0f9270bd3bcac9309b715f64336c1d124a177fee676d52ef87a76bcf71d3f6a8043d5203fd92a92f2a9590e93cdf904228ebf5589c2afe45014398f5035a07c4076050fab21846b77729fdfef13d0903a4baac5a30abf986f08e11d00fa64fd420247c7ae09b7cecca8e8ca928c8ce80689a8c90d86cc3c1494d98fdf37436000c9e5d3389ac4961e8b8e9ffe1059eb34c74d61d94e23c492f24b2199f18bd180f985d8108884282fec6aeee6d59821d2186978bda855f85cd265c56903a814a2975c552578b532a84e41d71cf78cbecbef72dc374862bc692d5959b84f595612b4d55bd40e8d7261eade62c2a1bba2af2c7ba507abda5cc5f09c625ff4746d92b4588f864863a1f7806aebebc5b09bbd845d200f6a1811fb82867c8ada8656422a312841a269a6a4e628ab52eb5b0cf7329c7f876116b178ff28c4c6f0768871eea9236e28a1142df986b01fbce5c7aedd0ccd27a87a4321321c9bf1bf28f7e1365c364a0e2b4806926a18df6ca43f69b967c0473b55d74a1866bb33bc292a4006487ecb843bd209697f55dcc96ee8e15199c988f9abea42d4ddf00204627891f56f82954d1021bf869508fc3c7d0459dc9ab3bbe8b7e0a8e02675bd59a583c234417b8ac05872b5015ef665da3fca0f966d40d6988777c5def1dd834b94da10d95547edf4d56dccbbaf06f0d24ffb20799e3679a06d4748b16c5dafe7c9ba300ed0e4d01ea54fa447318721bf1e3931b9c6e059bee4bbad9976f28f531a420244395e60823940a36bd202d82578420bce7e97b2edc3021e9951c54953a4f2119d6c8912675f81fcd4a3e679f6c88e4be02cfa91f7d311e140736b8b26ceb500c7e6439c1220d645711e9017027f5a078bfffb612a9bce540229148411804d621af256389ef537ace447641bf21b5ea16d0ccf290f6979d2cdd1b26d2f8c20b047cd1d430cd6a77512006fa547193400a34561883693dda58980cbd770af4a22b132ea5302357e3ad0daf767c7b7c4106ff9e33463ccf4feff85933c87faac0", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x0c16c609b50fbc6f660b3fe38c5989ce059ea171048c99c0dad306cea570df61", - "dataHashes": [ - "0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95" - ], - "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", - "parentAggregationLastBlockTimestamp": 1683325137, - "lastFinalizedBlockNumber": 0, - "finalTimestamp": 1683335137, - "finalBlockNumber": 46, - "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", - "l1RollingHashMessageNumber": 1, - "l2MerkleRoots": [ - "0x97cd1539d08f7c0ba06ad836b2690eef50afd86609a0672517ec0ef8c1f94796" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh b/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh index f15ad9659..82ebcec87 100755 --- a/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh +++ b/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh @@ -16,8 +16,8 @@ bin/compression-aggregation-sample --odir .samples-simple-eip4844/ --spec ./cmd/ bin/compression-aggregation-sample --odir .samples-multiproof-eip4844/ --spec ./cmd/dev-tools/testcase-gen/compression-aggregation/spec-comp-eip4844-1.json --spec ./cmd/dev-tools/testcase-gen/compression-aggregation/spec-comp-eip4844-1.json --spec ./cmd/dev-tools/testcase-gen/compression-aggregation/spec-agg.json bin/compression-aggregation-sample --odir .samples-multiproof-eip4844/ --spec ./cmd/dev-tools/testcase-gen/compression-aggregation/spec-comp-eip4844-2.json --spec ./cmd/dev-tools/testcase-gen/compression-aggregation/spec-comp-eip4844-2.json --spec ./cmd/dev-tools/testcase-gen/compression-aggregation/spec-agg-2.json -SOLTESTDIR=../contracts/test/testData/compressedData -SOLTESTDIR_EIP4844=../contracts/test/testData/compressedDataEip4844 +SOLTESTDIR=../contracts/test/hardhat/_testData/compressedData +SOLTESTDIR_EIP4844=../contracts/test/hardhat/_testData/compressedDataEip4844 mkdir -p ${SOLTESTDIR} ${SOLTESTDIR}/multipleProofs ${SOLTESTDIR}/test mkdir -p ${SOLTESTDIR_EIP4844} ${SOLTESTDIR_EIP4844}/multipleProofs ${SOLTESTDIR_EIP4844}/test @@ -37,17 +37,17 @@ mv -f .samples-test-eip4844/* ${SOLTESTDIR_EIP4844}/test rm -rf .samples-simple-calldata .samples-multiproof-calldata .samples-test-calldata rm -rf .samples-simple-eip4844 .samples-multiproof-eip4844 .samples-test-eip4844 -sed -i.bak 's/pragma solidity \0.8.24;/pragma solidity 0.8.26;/g' ../contracts/test/testData/compressedData/Verifier1.sol +sed -i.bak 's/pragma solidity \0.8.24;/pragma solidity 0.8.26;/g' ../contracts/test/hardhat/_testData/compressedData/Verifier1.sol -cp ../contracts/test/testData/compressedData/Verifier1.sol ../contracts/src/verifiers/PlonkVerifierForDataAggregation.sol +cp ../contracts/test/hardhat/_testData/compressedData/Verifier1.sol ../contracts/src/verifiers/PlonkVerifierForDataAggregation.sol sed -i.bak 's/contract PlonkVerifier /contract PlonkVerifierForDataAggregation /g' ../contracts/src/verifiers/PlonkVerifierForDataAggregation.sol -cp ../contracts/test/testData/compressedData/Verifier1.sol ../contracts/src/_testing/unit/TestPlonkVerifierForDataAggregation.sol +cp ../contracts/test/hardhat/_testData/compressedData/Verifier1.sol ../contracts/src/_testing/unit/TestPlonkVerifierForDataAggregation.sol sed -i.bak 's/contract PlonkVerifier /contract TestPlonkVerifierForDataAggregation /g' ../contracts/src/_testing/unit/TestPlonkVerifierForDataAggregation.sol rm ../contracts/src/_testing/unit/TestPlonkVerifierForDataAggregation.sol.bak rm ../contracts/src/verifiers/PlonkVerifierForDataAggregation.sol.bak # Remove this artefact from the code. This litters the contracts tests -rm ../contracts/test/testData/**/Verifier1.* -rm ../contracts/test/testData/**/**/Verifier1.* \ No newline at end of file +rm ../contracts/test/hardhat/_testData/**/Verifier1.* +rm ../contracts/test/hardhat/_testData/**/**/Verifier1.* \ No newline at end of file From 3f439472025e94fe94364ca99404d8b6c9326b23 Mon Sep 17 00:00:00 2001 From: VGau Date: Tue, 7 Jan 2025 12:50:12 +0100 Subject: [PATCH 09/14] fix: update autoupdate.sh script --- .../testcase-gen/compression-aggregation/autoupdate.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh b/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh index 82ebcec87..23d31dd29 100755 --- a/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh +++ b/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh @@ -42,10 +42,10 @@ sed -i.bak 's/pragma solidity \0.8.24;/pragma solidity 0.8.26;/g' ../contracts/t cp ../contracts/test/hardhat/_testData/compressedData/Verifier1.sol ../contracts/src/verifiers/PlonkVerifierForDataAggregation.sol sed -i.bak 's/contract PlonkVerifier /contract PlonkVerifierForDataAggregation /g' ../contracts/src/verifiers/PlonkVerifierForDataAggregation.sol -cp ../contracts/test/hardhat/_testData/compressedData/Verifier1.sol ../contracts/src/_testing/unit/TestPlonkVerifierForDataAggregation.sol -sed -i.bak 's/contract PlonkVerifier /contract TestPlonkVerifierForDataAggregation /g' ../contracts/src/_testing/unit/TestPlonkVerifierForDataAggregation.sol +cp ../contracts/test/hardhat/_testData/compressedData/Verifier1.sol ../contracts/src/_testing/unit/verifiers/TestPlonkVerifierForDataAggregation.sol +sed -i.bak 's/contract PlonkVerifier /contract TestPlonkVerifierForDataAggregation /g' ../contracts/src/_testing/unit/verifiers/TestPlonkVerifierForDataAggregation.sol -rm ../contracts/src/_testing/unit/TestPlonkVerifierForDataAggregation.sol.bak +rm ../contracts/src/_testing/unit/verifiers/TestPlonkVerifierForDataAggregation.sol.bak rm ../contracts/src/verifiers/PlonkVerifierForDataAggregation.sol.bak # Remove this artefact from the code. This litters the contracts tests From f57c0667edde4e7fe80925f922512dc9b4d4ccda Mon Sep 17 00:00:00 2001 From: VGau Date: Tue, 7 Jan 2025 16:39:28 +0100 Subject: [PATCH 10/14] fix: update solcover file --- contracts/.solcover.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/contracts/.solcover.js b/contracts/.solcover.js index e090ea00a..900f90f2a 100644 --- a/contracts/.solcover.js +++ b/contracts/.solcover.js @@ -1,10 +1,7 @@ module.exports = { skipFiles: [ - "test-contracts", - "verifiers/test", + "_testing", "proxies", - "tokenBridge/mocks", - "token/MyToken.sol", - "tokenBridge/CustomBridgedToken.sol", + "bridging/token/CustomBridgedToken.sol", ], }; From 3ad095548b199cc19101dc6e7491d01f5954bde4 Mon Sep 17 00:00:00 2001 From: VGau Date: Tue, 7 Jan 2025 16:57:24 +0100 Subject: [PATCH 11/14] fix: remove static nonce in LineaRollup test --- contracts/test/hardhat/rollup/LineaRollup.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/contracts/test/hardhat/rollup/LineaRollup.ts b/contracts/test/hardhat/rollup/LineaRollup.ts index f324d2bfc..6f60c1e88 100644 --- a/contracts/test/hardhat/rollup/LineaRollup.ts +++ b/contracts/test/hardhat/rollup/LineaRollup.ts @@ -1852,7 +1852,6 @@ describe("Linea Rollup contract", () => { maxFeePerGas: maxFeePerGas!, to: lineaRollupAddress, chainId: 31337, - nonce: 4, value: 0, gasLimit: 5_000_000, }; @@ -1891,7 +1890,6 @@ describe("Linea Rollup contract", () => { maxFeePerGas: maxFeePerGas!, to: lineaRollupAddress, chainId: 31337, - nonce: 4, value: 0, gasLimit: 5_000_000, }; From c59c20e5dbbd3bd99c33089c31f7a26e1b6f4c6d Mon Sep 17 00:00:00 2001 From: thedarkjester Date: Fri, 10 Jan 2025 16:22:58 +0000 Subject: [PATCH 12/14] Merge branch 'main' into fix/399-update-contracts-folder-structure --- .../finalized-tag-updater-github-release.yml | 6 - .github/workflows/main.yml | 18 - bridge-ui/package.json | 11 +- bridge-ui/src/components/ConnectButton.tsx | 4 +- bridge-ui/src/config/wagmi.ts | 35 +- bridge-ui/src/contexts/web3.context.tsx | 28 +- contracts/.gitignore | 1 + contracts/README.md | 2 +- .../bridging/token/utils/StorageFiller39.mdx | 2 - .../api/rollup/interfaces/ILineaRollup.mdx | 2 +- contracts/foundry.toml | 2 +- contracts/hardhat.config.ts | 12 +- contracts/package.json | 2 +- .../_testing/integration/LineaRollupV5.sol | 2 +- .../_testing/unit/rollup/TestLineaRollup.sol | 4 + .../src/messaging/l1/L1MessageManager.sol | 5 +- .../src/rollup/interfaces/ILineaRollup.sol | 2 +- .../src/security/pausing/PauseManager.sol | 4 +- .../PlonkVerifierForDataAggregation.sol | 359 ++--- .../verifiers/PlonkVerifierSepoliaFull.sol | 1350 +++++++++++++++++ contracts/test/foundry/LineaRollup.t.sol | 205 +++ ...720328a7a5f-getZkBlobCompressionProof.json | 1 + ...d7214f06b7a-getZkBlobCompressionProof.json | 1 + ...f78a3d277a3-getZkBlobCompressionProof.json | 1 + ...7c78b0490c0-getZkBlobCompressionProof.json | 1 + ...5fd11137414-getZkBlobCompressionProof.json | 1 + ...e6d395671cb-getZkBlobCompressionProof.json | 1 + ...954a8aac47b-getZkBlobCompressionProof.json | 1 + ...b97b4a0933b-getZkBlobCompressionProof.json | 1 + ...429def3f4f3-getZkBlobCompressionProof.json | 1 + ...ae8cd4a4bd8-getZkBlobCompressionProof.json | 1 + ...4536f90c5ab-getZkBlobCompressionProof.json | 1 + ...a30545f4b1e-getZkBlobCompressionProof.json | 1 + ...8e2d36944d4-getZkBlobCompressionProof.json | 1 + ...23d309801e0-getZkBlobCompressionProof.json | 1 + ...59b2795408b-getZkBlobCompressionProof.json | 1 + ...8f05e8c1624-getZkBlobCompressionProof.json | 1 + ...e6b5d92d2d7-getZkBlobCompressionProof.json | 1 + ...3f2eeb674ba-getZkBlobCompressionProof.json | 1 + ...344df3df752-getZkBlobCompressionProof.json | 1 + ...6c63d8c7e8d-getZkBlobCompressionProof.json | 1 + ...0c25237e75f-getZkBlobCompressionProof.json | 1 + ...f19fa0976bd-getZkBlobCompressionProof.json | 1 + ...c4fe86ef6f1-getZkBlobCompressionProof.json | 1 + ...971d548c2c8-getZkBlobCompressionProof.json | 1 + ...78fa0d7c79a-getZkBlobCompressionProof.json | 1 + ...a6759c939f0-getZkBlobCompressionProof.json | 1 + ...dbcea57068c-getZkBlobCompressionProof.json | 1 + ...2aaf6b10ca2-getZkBlobCompressionProof.json | 1 + ...784c17326b6-getZkBlobCompressionProof.json | 1 + ...517af8000d5-getZkBlobCompressionProof.json | 1 + ...15ed22d2885-getZkBlobCompressionProof.json | 1 + ...4621d071568-getZkBlobCompressionProof.json | 1 + ...33bab50a987-getZkBlobCompressionProof.json | 1 + ...3ca02872792-getZkBlobCompressionProof.json | 1 + ...7293014817b-getZkBlobCompressionProof.json | 1 + ...8afa6848660260ba-getZkAggregatedProof.json | 60 + .../hardhat/common/helpers/dataGeneration.ts | 33 + contracts/test/hardhat/rollup/LineaRollup.ts | 183 +++ docker/compose.yml | 2 +- docs/audits.md | 8 +- .../tests-config/accounts/account-manager.ts | 90 +- .../kotlin/build/linea/jvm/ResourcesUtil.kt | 13 +- .../build/linea/jvm/ResourcesUtilTest.kt | 32 +- .../linea/blob/GoNativeBlobCompressor.kt | 2 +- .../linea/blob/GoNativeBlobDecompressor.kt | 12 +- pnpm-lock.yaml | 1206 +++++++++------ prover/cmd/prover/cmd/setup.go | 22 +- prover/cmd/prover/main.go | 17 +- .../transerval_hash_bench_test.go | 56 + prover/go.mod | 4 +- prover/go.sum | 4 +- .../compiler/dummy/dummy_prover_level.go | 43 - .../zkevm/prover/publicInput/public_input.go | 38 +- prover/zkevm/zkevm.go | 29 +- 75 files changed, 3087 insertions(+), 858 deletions(-) delete mode 100644 contracts/docs/api/bridging/token/utils/StorageFiller39.mdx create mode 100644 contracts/src/verifiers/PlonkVerifierSepoliaFull.sol create mode 100644 contracts/test/foundry/LineaRollup.t.sol create mode 100644 contracts/test/hardhat/_testData/betaV1/7027059-7027404-bcv0.0-ccv0.0-f35234dd6ca6f59ef4ce2f12629b46889ce5d7d315a6f6e8b280c720328a7a5f-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7027405-7027679-bcv0.0-ccv0.0-117d8a20a28a432735db922bcdb46ceffcb879a1858f54cf0d6c1d7214f06b7a-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7027680-7028156-bcv0.0-ccv0.0-3b6ad9785d10dcf9d7a009054c91bf12e08ecdc28b9d3350a88e6f78a3d277a3-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7028157-7028656-bcv0.0-ccv0.0-fb8f197551bc5a471638f05fdc2b538f62fbfb5677e4724a5958d7c78b0490c0-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7028657-7029167-bcv0.0-ccv0.0-10ec011c96199be5cff9dc9211cafb645cb36463c4544a94c68825fd11137414-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7029168-7029694-bcv0.0-ccv0.0-ce8f71dae3a557895a9cd61d61f6b9d13c6afc382c201e2f2f087e6d395671cb-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7029695-7030131-bcv0.0-ccv0.0-a833fa555f8ceab3af11bfc2ccb6c96e3028a3148058e57e7b28c954a8aac47b-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7030132-7030601-bcv0.0-ccv0.0-faa9ec608c0829293fec06099ad4df8752f3452e0a76559530a9bb97b4a0933b-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7030602-7031170-bcv0.0-ccv0.0-e6c94fa4172eb5e243681289aff4f1ee85b430efc9228c76dc860429def3f4f3-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7031171-7031698-bcv0.0-ccv0.0-4507d3b41564a8d33c5c161f9789fcdd7f1a80120af524b9360f5ae8cd4a4bd8-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7031699-7032250-bcv0.0-ccv0.0-97920f348ce63054c8e1f8e13032c25413887b3955c4996322e214536f90c5ab-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7032251-7032782-bcv0.0-ccv0.0-4e76d551e1c4a036aba4c2e12d73bcac413c69fcba7447fd85d8da30545f4b1e-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7032783-7033310-bcv0.0-ccv0.0-91a7de3637e6a17379a01b5288cccafa6056f46e77a7e6ad3b8398e2d36944d4-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7033311-7033901-bcv0.0-ccv0.0-8821db3c1317f9f4eda63eb05250460a4dd596f027bc99bea578523d309801e0-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7033902-7034408-bcv0.0-ccv0.0-42fff36c167a293d859f8c24df241acbb7e6df120b543d78306bf59b2795408b-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7034409-7034992-bcv0.0-ccv0.0-d7f4f287dc31f3d5de856e1cfb29defd21d018cbd554660ec6de18f05e8c1624-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7034993-7035542-bcv0.0-ccv0.0-7c70da82273905425810a217c1cc2b42aae0e57892b3ef4b1572ce6b5d92d2d7-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7035543-7036246-bcv0.0-ccv0.0-b46e7b3d9851c708cfbbe49042e5dd445954bea50b49d85f64fd23f2eeb674ba-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7036247-7036667-bcv0.0-ccv0.0-58d0398616dd0791b95d08da761e17f6e31c7b0c0713b8c57b26c344df3df752-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7036668-7037005-bcv0.0-ccv0.0-9a8cde645ac7a147aeeb6649817daf62b1c37b8c4c3fe9b6a98c66c63d8c7e8d-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7037006-7037387-bcv0.0-ccv0.0-deb38648b5052f6e9b752e3d1a32e9469a27f1e325f82e23c4fa60c25237e75f-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7037388-7037688-bcv0.0-ccv0.0-012b30abf341a0f07a4d9570bd6c0807b2c4f026e31aedd225036f19fa0976bd-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7037689-7038050-bcv0.0-ccv0.0-575afbfd09729da3e74b033c7f95350c4aa3382eced91e0fa7bd4c4fe86ef6f1-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7038051-7038452-bcv0.0-ccv0.0-1f3cf2d5c4f28cf19a95c20dcbf0e2f5555f987b7888a97bffbe7971d548c2c8-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7038453-7038794-bcv0.0-ccv0.0-d0569772a2576404182a1b572d214e355fd5c8f53849bf4320b3d78fa0d7c79a-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7038795-7039119-bcv0.0-ccv0.0-a2e40246a4fca6f33900d6ee8418005621517a8e646f45c0b6ae1a6759c939f0-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7039120-7039526-bcv0.0-ccv0.0-e6d7fcc56d5915581b5fe62f0cf46e978db7c2771dc02a9f45d0fdbcea57068c-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7039527-7039846-bcv0.0-ccv0.0-7ef7c243058241c81322143509e14eff7f694e518a056f8de831a2aaf6b10ca2-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7039847-7040221-bcv0.0-ccv0.0-54d26ced2341a22eb232d8e7615ab4d603bd36df46364f6e095c8784c17326b6-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7040222-7040694-bcv0.0-ccv0.0-dfe80906db55131a07c76ef7b5878e846d400ff6efa0172f70cea517af8000d5-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7040695-7041007-bcv0.0-ccv0.0-335ddd518e2159ed984c2a767d8a090658dede8c330485d2b35e315ed22d2885-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7041008-7041411-bcv0.0-ccv0.0-7ef2206b083819d0da849404a4067ef68909a083db438cda83eb44621d071568-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7041412-7041712-bcv0.0-ccv0.0-d211f1fe8b249e054b1c1f85311b5369ed6074dd7444549102a5233bab50a987-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7041713-7042084-bcv0.0-ccv0.0-1525c1f407c2d7f82b5d04c127b97da07cddc39558104fcb59ed23ca02872792-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/7042085-7042723-bcv0.0-ccv0.0-7a136069d307ccefc5b6717ea36f57cb2b84a46252f5187eb33b97293014817b-getZkBlobCompressionProof.json create mode 100644 contracts/test/hardhat/_testData/betaV1/proof/7027059-7042723-d2221f5035e3dcbbc46e8a6130fef34fdec33c252b7d31fb8afa6848660260ba-getZkAggregatedProof.json create mode 100644 prover/crypto/ringsis/ringsis_64_16/transerval_hash_bench_test.go diff --git a/.github/workflows/finalized-tag-updater-github-release.yml b/.github/workflows/finalized-tag-updater-github-release.yml index c0c63a20d..f208ab32e 100644 --- a/.github/workflows/finalized-tag-updater-github-release.yml +++ b/.github/workflows/finalized-tag-updater-github-release.yml @@ -1,11 +1,5 @@ name: Github Release for Finalized-Tag-Updater Besu Plugin on: - workflow_call: - inputs: - version: - required: true - type: string - workflow_dispatch: inputs: version: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e85df5799..ebc8e990b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,6 @@ jobs: prover: ${{ steps.filter.outputs.prover }} traces-api-facade: ${{ steps.filter.outputs.traces-api-facade }} transaction-exclusion-api: ${{ steps.filter.outputs.transaction-exclusion-api }} - finalized-tag-updater: ${{ steps.filter.outputs.finalized-tag-updater }} has-changes-requiring-build: ${{ steps.filter-out.outputs.has-changes-requiring-build }} steps: - name: Checkout @@ -105,14 +104,6 @@ jobs: - 'build.gradle' - 'gradle.properties' - 'settings.gradle' - finalized-tag-updater: - - 'jvm-libs/linea/core/long-running-service/**' - - 'jvm-libs/linea/web3j-extensions/**' - - 'jvm-libs/extensions/kotlin/**' - - 'jvm-libs/extensions/futures/**' - - 'finalized-tag-updater/**' - - '.github/workflows/main.yml' - - '.github/workflows/finalized-tag-updater-github-release.yml' - name: Filter out commit changes uses: dorny/paths-filter@v3 id: filter-out @@ -174,15 +165,6 @@ jobs: transaction_exclusion_api_image_tagged: ${{ needs.check-and-tag-images.outputs.image_tagged_transaction_exclusion_api }} secrets: inherit - # Comment out the auto build and release step below as the plugin release should be - # by manual Github action for versioning control - # finalized-tag-updater-jar-build-release: - # needs: [ filter-commit-changes ] - # if: ${{ always() && needs.filter-commit-changes.outputs.finalized-tag-updater == 'true' }} - # uses: ./.github/workflows/finalized-tag-updater-github-release.yml - # with: - # version: '0.0.1' - testing: needs: [ store-image-name-and-tags, filter-commit-changes, check-and-tag-images ] if: ${{ always() && needs.filter-commit-changes.outputs.has-changes-requiring-build == 'true' }} diff --git a/bridge-ui/package.json b/bridge-ui/package.json index 06af155cc..6712a0161 100644 --- a/bridge-ui/package.json +++ b/bridge-ui/package.json @@ -22,10 +22,11 @@ "dependencies": { "@consensys/linea-sdk": "0.3.0", "@headlessui/react": "2.1.9", - "@tanstack/react-query": "5.59.3", + "@tanstack/react-query": "5.62.16", "@wagmi/connectors": "5.1.15", - "@wagmi/core": "2.13.8", - "@web3modal/wagmi": "5.1.11", + "@wagmi/core": "2.16.3", + "@reown/appkit": "1.6.3", + "@reown/appkit-adapter-wagmi": "1.6.3", "clsx": "^2.1.1", "compare-versions": "6.1.1", "date-fns": "4.1.0", @@ -44,8 +45,8 @@ "sharp": "0.33.5", "swiper": "11.1.14", "tailwind-merge": "^2.5.3", - "viem": "2.21.19", - "wagmi": "2.12.17", + "viem": "2.22.4", + "wagmi": "2.14.6", "zustand": "4.5.4" }, "devDependencies": { diff --git a/bridge-ui/src/components/ConnectButton.tsx b/bridge-ui/src/components/ConnectButton.tsx index cf046d622..1c20f7494 100644 --- a/bridge-ui/src/components/ConnectButton.tsx +++ b/bridge-ui/src/components/ConnectButton.tsx @@ -1,4 +1,4 @@ -import { useWeb3Modal } from "@web3modal/wagmi/react"; +import { useAppKit } from "@reown/appkit/react"; import { cn } from "@/utils/cn"; import { Button } from "./ui"; @@ -7,7 +7,7 @@ type ConnectButtonProps = { }; export default function ConnectButton({ fullWidth }: ConnectButtonProps) { - const { open } = useWeb3Modal(); + const { open } = useAppKit(); return (