Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: update contracts folder structure #420

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions contracts/contracts/tools/ProxyAdminReplica.sol

This file was deleted.

25 changes: 0 additions & 25 deletions contracts/docs/api/interfaces/l1/IPlonkVerifier.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion contracts/foundry.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[profile.default]
src = 'contracts'
src = 'src'
out = 'out'
libs = ['node_modules', 'lib']
cache_path = 'cache_forge'
Expand Down
3 changes: 2 additions & 1 deletion contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -154,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/",
},
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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 *;
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading
Loading