diff --git a/packages/contracts-bedrock/justfile b/packages/contracts-bedrock/justfile index c55cb3d38151..45cdd14cfae0 100644 --- a/packages/contracts-bedrock/justfile +++ b/packages/contracts-bedrock/justfile @@ -41,7 +41,7 @@ gas-snapshot-no-build: forge snapshot --match-contract GasBenchMark statediff: - ./scripts/statediff.sh && git diff --exit-code + ./scripts/utils/statediff.sh && git diff --exit-code gas-snapshot: build-go-ffi gas-snapshot-no-build @@ -65,7 +65,7 @@ snapshots-check: ./scripts/checks/check-snapshots.sh semver-lock: - forge script scripts/SemverLock.s.sol + forge script scripts/autogen/SemverLock.s.sol validate-deploy-configs: ./scripts/checks/check-deploy-configs.sh diff --git a/packages/contracts-bedrock/scripts/Artifacts.s.sol b/packages/contracts-bedrock/scripts/Artifacts.s.sol index 4a788608788a..5b4bef26ec1c 100644 --- a/packages/contracts-bedrock/scripts/Artifacts.s.sol +++ b/packages/contracts-bedrock/scripts/Artifacts.s.sol @@ -4,13 +4,13 @@ pragma solidity ^0.8.0; import { console2 as console } from "forge-std/console2.sol"; import { stdJson } from "forge-std/StdJson.sol"; import { Vm } from "forge-std/Vm.sol"; -import { Executables } from "scripts/Executables.sol"; +import { Executables } from "scripts/libraries/Executables.sol"; import { Predeploys } from "src/libraries/Predeploys.sol"; -import { Config } from "scripts/Config.sol"; -import { StorageSlot } from "scripts/ForgeArtifacts.sol"; +import { Config } from "scripts/libraries/Config.sol"; +import { StorageSlot } from "scripts/libraries/ForgeArtifacts.sol"; import { EIP1967Helper } from "test/mocks/EIP1967Helper.sol"; import { LibString } from "@solady/utils/LibString.sol"; -import { ForgeArtifacts } from "scripts/ForgeArtifacts.sol"; +import { ForgeArtifacts } from "scripts/libraries/ForgeArtifacts.sol"; import { IAddressManager } from "scripts/interfaces/IAddressManager.sol"; import { Process } from "scripts/libraries/Process.sol"; diff --git a/packages/contracts-bedrock/scripts/L2Genesis.s.sol b/packages/contracts-bedrock/scripts/L2Genesis.s.sol index cad18b0b02bd..e15459166999 100644 --- a/packages/contracts-bedrock/scripts/L2Genesis.s.sol +++ b/packages/contracts-bedrock/scripts/L2Genesis.s.sol @@ -5,7 +5,7 @@ import { Script } from "forge-std/Script.sol"; import { console2 as console } from "forge-std/console2.sol"; import { Deployer } from "scripts/deploy/Deployer.sol"; -import { Config, OutputMode, OutputModeUtils, Fork, ForkUtils, LATEST_FORK } from "scripts/Config.sol"; +import { Config, OutputMode, OutputModeUtils, Fork, ForkUtils, LATEST_FORK } from "scripts/libraries/Config.sol"; import { Artifacts } from "scripts/Artifacts.s.sol"; import { DeployConfig } from "scripts/deploy/DeployConfig.s.sol"; import { Predeploys } from "src/libraries/Predeploys.sol"; diff --git a/packages/contracts-bedrock/scripts/SemverLock.s.sol b/packages/contracts-bedrock/scripts/autogen/SemverLock.s.sol similarity index 100% rename from packages/contracts-bedrock/scripts/SemverLock.s.sol rename to packages/contracts-bedrock/scripts/autogen/SemverLock.s.sol diff --git a/packages/contracts-bedrock/scripts/ChainAssertions.sol b/packages/contracts-bedrock/scripts/deploy/ChainAssertions.sol similarity index 99% rename from packages/contracts-bedrock/scripts/ChainAssertions.sol rename to packages/contracts-bedrock/scripts/deploy/ChainAssertions.sol index b0245fc09fbb..cac489c93e78 100644 --- a/packages/contracts-bedrock/scripts/ChainAssertions.sol +++ b/packages/contracts-bedrock/scripts/deploy/ChainAssertions.sol @@ -19,7 +19,7 @@ import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol"; import { OptimismMintableERC20Factory } from "src/universal/OptimismMintableERC20Factory.sol"; import { L1ERC721Bridge } from "src/L1/L1ERC721Bridge.sol"; import { Predeploys } from "src/libraries/Predeploys.sol"; -import { Types } from "scripts/Types.sol"; +import { Types } from "scripts/libraries/Types.sol"; import { Vm } from "forge-std/Vm.sol"; import { ISystemConfigV0 } from "scripts/interfaces/ISystemConfigV0.sol"; import { console2 as console } from "forge-std/console2.sol"; diff --git a/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol b/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol index 19816f94aa0c..73abe8956a24 100644 --- a/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/Deploy.s.sol @@ -44,18 +44,18 @@ import { L1ERC721Bridge } from "src/L1/L1ERC721Bridge.sol"; import { ProtocolVersions, ProtocolVersion } from "src/L1/ProtocolVersions.sol"; import { StorageSetter } from "src/universal/StorageSetter.sol"; import { Predeploys } from "src/libraries/Predeploys.sol"; -import { Chains } from "scripts/Chains.sol"; -import { Config } from "scripts/Config.sol"; +import { Chains } from "scripts/libraries/Chains.sol"; +import { Config } from "scripts/libraries/Config.sol"; import { IBigStepper } from "src/dispute/interfaces/IBigStepper.sol"; import { IPreimageOracle } from "src/cannon/interfaces/IPreimageOracle.sol"; import { AlphabetVM } from "test/mocks/AlphabetVM.sol"; import "src/dispute/lib/Types.sol"; -import { ChainAssertions } from "scripts/ChainAssertions.sol"; -import { Types } from "scripts/Types.sol"; +import { ChainAssertions } from "scripts/deploy/ChainAssertions.sol"; +import { Types } from "scripts/libraries/Types.sol"; import { LibStateDiff } from "scripts/libraries/LibStateDiff.sol"; import { EIP1967Helper } from "test/mocks/EIP1967Helper.sol"; -import { ForgeArtifacts } from "scripts/ForgeArtifacts.sol"; +import { ForgeArtifacts } from "scripts/libraries/ForgeArtifacts.sol"; import { Process } from "scripts/libraries/Process.sol"; /// @title Deploy diff --git a/packages/contracts-bedrock/scripts/deploy/DeployConfig.s.sol b/packages/contracts-bedrock/scripts/deploy/DeployConfig.s.sol index 76d4ad43ee83..d720986fcdd5 100644 --- a/packages/contracts-bedrock/scripts/deploy/DeployConfig.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/DeployConfig.s.sol @@ -4,10 +4,10 @@ pragma solidity 0.8.15; import { Script } from "forge-std/Script.sol"; import { console2 as console } from "forge-std/console2.sol"; import { stdJson } from "forge-std/StdJson.sol"; -import { Executables } from "scripts/Executables.sol"; +import { Executables } from "scripts/libraries/Executables.sol"; import { Process } from "scripts/libraries/Process.sol"; -import { Chains } from "scripts/Chains.sol"; -import { Config, Fork, ForkUtils } from "scripts/Config.sol"; +import { Chains } from "scripts/libraries/Chains.sol"; +import { Config, Fork, ForkUtils } from "scripts/libraries/Config.sol"; /// @title DeployConfig /// @notice Represents the configuration required to deploy the system. It is expected diff --git a/packages/contracts-bedrock/scripts/deploy/Deployer.sol b/packages/contracts-bedrock/scripts/deploy/Deployer.sol index 2a861ba34608..36de8dd440fc 100644 --- a/packages/contracts-bedrock/scripts/deploy/Deployer.sol +++ b/packages/contracts-bedrock/scripts/deploy/Deployer.sol @@ -3,9 +3,9 @@ pragma solidity ^0.8.0; import { Script } from "forge-std/Script.sol"; import { Artifacts } from "scripts/Artifacts.s.sol"; -import { Config } from "scripts/Config.sol"; +import { Config } from "scripts/libraries/Config.sol"; import { DeployConfig } from "scripts/deploy/DeployConfig.s.sol"; -import { Executables } from "scripts/Executables.sol"; +import { Executables } from "scripts/libraries/Executables.sol"; import { console } from "forge-std/console.sol"; /// @title Deployer diff --git a/packages/contracts-bedrock/scripts/FaultDisputeGameViz.s.sol b/packages/contracts-bedrock/scripts/fpac/viz/FaultDisputeGameViz.s.sol similarity index 100% rename from packages/contracts-bedrock/scripts/FaultDisputeGameViz.s.sol rename to packages/contracts-bedrock/scripts/fpac/viz/FaultDisputeGameViz.s.sol diff --git a/packages/contracts-bedrock/scripts/dag-viz.py b/packages/contracts-bedrock/scripts/fpac/viz/dag-viz.py similarity index 100% rename from packages/contracts-bedrock/scripts/dag-viz.py rename to packages/contracts-bedrock/scripts/fpac/viz/dag-viz.py diff --git a/packages/contracts-bedrock/scripts/visualize.sh b/packages/contracts-bedrock/scripts/fpac/viz/visualize.sh similarity index 82% rename from packages/contracts-bedrock/scripts/visualize.sh rename to packages/contracts-bedrock/scripts/fpac/viz/visualize.sh index 4fb3078ebe70..f0ecf872aa2e 100644 --- a/packages/contracts-bedrock/scripts/visualize.sh +++ b/packages/contracts-bedrock/scripts/fpac/viz/visualize.sh @@ -8,6 +8,6 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" DIR="${DIR%/*}" cd "$DIR" -forge script scripts/FaultDisputeGameViz.s.sol \ +forge script scripts/fpac/viz/FaultDisputeGameViz.s.sol \ --sig "remote(address)" "$FAULT_GAME_ADDRESS" \ --fork-url "$RPC" diff --git a/packages/contracts-bedrock/scripts/Chains.sol b/packages/contracts-bedrock/scripts/libraries/Chains.sol similarity index 100% rename from packages/contracts-bedrock/scripts/Chains.sol rename to packages/contracts-bedrock/scripts/libraries/Chains.sol diff --git a/packages/contracts-bedrock/scripts/Config.sol b/packages/contracts-bedrock/scripts/libraries/Config.sol similarity index 100% rename from packages/contracts-bedrock/scripts/Config.sol rename to packages/contracts-bedrock/scripts/libraries/Config.sol diff --git a/packages/contracts-bedrock/scripts/Executables.sol b/packages/contracts-bedrock/scripts/libraries/Executables.sol similarity index 100% rename from packages/contracts-bedrock/scripts/Executables.sol rename to packages/contracts-bedrock/scripts/libraries/Executables.sol diff --git a/packages/contracts-bedrock/scripts/ForgeArtifacts.sol b/packages/contracts-bedrock/scripts/libraries/ForgeArtifacts.sol similarity index 99% rename from packages/contracts-bedrock/scripts/ForgeArtifacts.sol rename to packages/contracts-bedrock/scripts/libraries/ForgeArtifacts.sol index 9886f9cd9bc0..315ed6d0c530 100644 --- a/packages/contracts-bedrock/scripts/ForgeArtifacts.sol +++ b/packages/contracts-bedrock/scripts/libraries/ForgeArtifacts.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.0; import { Vm } from "forge-std/Vm.sol"; -import { Executables } from "scripts/Executables.sol"; import { stdJson } from "forge-std/StdJson.sol"; +import { Executables } from "scripts/libraries/Executables.sol"; import { Process } from "scripts/libraries/Process.sol"; /// @notice Contains information about a storage slot. Mirrors the layout of the storage diff --git a/packages/contracts-bedrock/scripts/Types.sol b/packages/contracts-bedrock/scripts/libraries/Types.sol similarity index 100% rename from packages/contracts-bedrock/scripts/Types.sol rename to packages/contracts-bedrock/scripts/libraries/Types.sol diff --git a/packages/contracts-bedrock/scripts/FeeVaultWithdrawal.s.sol b/packages/contracts-bedrock/scripts/ops/FeeVaultWithdrawal.s.sol similarity index 96% rename from packages/contracts-bedrock/scripts/FeeVaultWithdrawal.s.sol rename to packages/contracts-bedrock/scripts/ops/FeeVaultWithdrawal.s.sol index f16cc994a4a2..e19cd7e994bd 100644 --- a/packages/contracts-bedrock/scripts/FeeVaultWithdrawal.s.sol +++ b/packages/contracts-bedrock/scripts/ops/FeeVaultWithdrawal.s.sol @@ -3,9 +3,9 @@ pragma solidity 0.8.15; import { console } from "forge-std/console.sol"; import { Script } from "forge-std/Script.sol"; -import { Predeploys } from "../src/libraries/Predeploys.sol"; -import { FeeVault } from "../src/universal/FeeVault.sol"; import { IMulticall3 } from "forge-std/interfaces/IMulticall3.sol"; +import { Predeploys } from "src/libraries/Predeploys.sol"; +import { FeeVault } from "src/universal/FeeVault.sol"; /// @title FeeVaultWithdrawal /// @notice A script to make it very simple to withdraw from the fee vaults. diff --git a/packages/contracts-bedrock/scripts/periphery/deploy/DeployPeriphery.s.sol b/packages/contracts-bedrock/scripts/periphery/deploy/DeployPeriphery.s.sol index 834af21231f1..856104eb2734 100644 --- a/packages/contracts-bedrock/scripts/periphery/deploy/DeployPeriphery.s.sol +++ b/packages/contracts-bedrock/scripts/periphery/deploy/DeployPeriphery.s.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import { console2 as console } from "forge-std/console2.sol"; import { Script } from "forge-std/Script.sol"; -import { Config } from "scripts/Config.sol"; +import { Config } from "scripts/libraries/Config.sol"; import { Artifacts } from "scripts/Artifacts.s.sol"; import { PeripheryDeployConfig } from "scripts/periphery/deploy/PeripheryDeployConfig.s.sol"; diff --git a/packages/contracts-bedrock/scripts/periphery/drippie/ManageDrippie.s.sol b/packages/contracts-bedrock/scripts/periphery/drippie/ManageDrippie.s.sol index b41142ba8045..1ae5f9ab01a2 100644 --- a/packages/contracts-bedrock/scripts/periphery/drippie/ManageDrippie.s.sol +++ b/packages/contracts-bedrock/scripts/periphery/drippie/ManageDrippie.s.sol @@ -11,7 +11,7 @@ import { LibDataTypes as GelatoDataTypes } from "gelato/libraries/LibDataTypes.s import { LibTaskId as GelatoTaskId } from "gelato/libraries/LibTaskId.sol"; import { GelatoBytes } from "gelato/vendor/gelato/GelatoBytes.sol"; -import { Config } from "scripts/Config.sol"; +import { Config } from "scripts/libraries/Config.sol"; import { Artifacts } from "scripts/Artifacts.s.sol"; import { DrippieConfig } from "scripts/periphery/drippie/DrippieConfig.s.sol"; diff --git a/packages/contracts-bedrock/scripts/print-addresses.sh b/packages/contracts-bedrock/scripts/utils/print-addresses.sh similarity index 100% rename from packages/contracts-bedrock/scripts/print-addresses.sh rename to packages/contracts-bedrock/scripts/utils/print-addresses.sh diff --git a/packages/contracts-bedrock/scripts/restructure_tests.py b/packages/contracts-bedrock/scripts/utils/restructure_tests.py similarity index 100% rename from packages/contracts-bedrock/scripts/restructure_tests.py rename to packages/contracts-bedrock/scripts/utils/restructure_tests.py diff --git a/packages/contracts-bedrock/scripts/statediff.sh b/packages/contracts-bedrock/scripts/utils/statediff.sh similarity index 100% rename from packages/contracts-bedrock/scripts/statediff.sh rename to packages/contracts-bedrock/scripts/utils/statediff.sh diff --git a/packages/contracts-bedrock/test/L2/GasPriceOracle.t.sol b/packages/contracts-bedrock/test/L2/GasPriceOracle.t.sol index 21f7b98f666b..f81d96b040f4 100644 --- a/packages/contracts-bedrock/test/L2/GasPriceOracle.t.sol +++ b/packages/contracts-bedrock/test/L2/GasPriceOracle.t.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.15; // Testing utilities import { CommonTest } from "test/setup/CommonTest.sol"; -import { Fork } from "scripts/Config.sol"; +import { Fork } from "scripts/libraries/Config.sol"; // Libraries import { Encoding } from "src/libraries/Encoding.sol"; diff --git a/packages/contracts-bedrock/test/Predeploys.t.sol b/packages/contracts-bedrock/test/Predeploys.t.sol index df7c2e3229ed..d39eb8b0ff61 100644 --- a/packages/contracts-bedrock/test/Predeploys.t.sol +++ b/packages/contracts-bedrock/test/Predeploys.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.15; import { CommonTest } from "test/setup/CommonTest.sol"; -import { ForgeArtifacts } from "scripts/ForgeArtifacts.sol"; +import { ForgeArtifacts } from "scripts/libraries/ForgeArtifacts.sol"; import { EIP1967Helper } from "test/mocks/EIP1967Helper.sol"; import { Predeploys } from "src/libraries/Predeploys.sol"; diff --git a/packages/contracts-bedrock/test/Safe/DeputyGuardianModule.t.sol b/packages/contracts-bedrock/test/Safe/DeputyGuardianModule.t.sol index ba91387352a7..326024977382 100644 --- a/packages/contracts-bedrock/test/Safe/DeputyGuardianModule.t.sol +++ b/packages/contracts-bedrock/test/Safe/DeputyGuardianModule.t.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.15; import { CommonTest } from "test/setup/CommonTest.sol"; -import { ForgeArtifacts, Abi } from "scripts/ForgeArtifacts.sol"; +import { ForgeArtifacts, Abi } from "scripts/libraries/ForgeArtifacts.sol"; import { GnosisSafe as Safe } from "safe-contracts/GnosisSafe.sol"; import "test/safe-tools/SafeTestTools.sol"; diff --git a/packages/contracts-bedrock/test/Specs.t.sol b/packages/contracts-bedrock/test/Specs.t.sol index 466be3ab8449..4c87fb82e49d 100644 --- a/packages/contracts-bedrock/test/Specs.t.sol +++ b/packages/contracts-bedrock/test/Specs.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.15; import { CommonTest } from "test/setup/CommonTest.sol"; -import { Executables } from "scripts/Executables.sol"; +import { Executables } from "scripts/libraries/Executables.sol"; import { console2 as console } from "forge-std/console2.sol"; import { ProtocolVersions } from "src/L1/ProtocolVersions.sol"; import { OptimismPortal } from "src/L1/OptimismPortal.sol"; @@ -11,7 +11,7 @@ import { OptimismPortal2 } from "src/L1/OptimismPortal2.sol"; import { SystemConfig } from "src/L1/SystemConfig.sol"; import { DataAvailabilityChallenge } from "src/L1/DataAvailabilityChallenge.sol"; import { OPStackManager } from "src/L1/OPStackManager.sol"; -import { ForgeArtifacts, Abi, AbiEntry } from "scripts/ForgeArtifacts.sol"; +import { ForgeArtifacts, Abi, AbiEntry } from "scripts/libraries/ForgeArtifacts.sol"; /// @title Specification_Test /// @dev Specifies common security properties of entrypoints to L1 contracts, including authorization and diff --git a/packages/contracts-bedrock/test/setup/Setup.sol b/packages/contracts-bedrock/test/setup/Setup.sol index 537585d7105d..50052dfd14d3 100644 --- a/packages/contracts-bedrock/test/setup/Setup.sol +++ b/packages/contracts-bedrock/test/setup/Setup.sol @@ -26,9 +26,9 @@ import { AnchorStateRegistry } from "src/dispute/AnchorStateRegistry.sol"; import { L1CrossDomainMessenger } from "src/L1/L1CrossDomainMessenger.sol"; import { DeployConfig } from "scripts/deploy/DeployConfig.s.sol"; import { Deploy } from "scripts/deploy/Deploy.s.sol"; -import { Fork, LATEST_FORK } from "scripts/Config.sol"; +import { Fork, LATEST_FORK } from "scripts/libraries/Config.sol"; import { L2Genesis, L1Dependencies } from "scripts/L2Genesis.s.sol"; -import { OutputMode, Fork, ForkUtils } from "scripts/Config.sol"; +import { OutputMode, Fork, ForkUtils } from "scripts/libraries/Config.sol"; import { L2OutputOracle } from "src/L1/L2OutputOracle.sol"; import { ProtocolVersions } from "src/L1/ProtocolVersions.sol"; import { SystemConfig } from "src/L1/SystemConfig.sol"; @@ -36,7 +36,7 @@ import { L1StandardBridge } from "src/L1/L1StandardBridge.sol"; import { AddressManager } from "src/legacy/AddressManager.sol"; import { L1ERC721Bridge } from "src/L1/L1ERC721Bridge.sol"; import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol"; -import { Executables } from "scripts/Executables.sol"; +import { Executables } from "scripts/libraries/Executables.sol"; import { Vm } from "forge-std/Vm.sol"; import { SuperchainConfig } from "src/L1/SuperchainConfig.sol"; import { DataAvailabilityChallenge } from "src/L1/DataAvailabilityChallenge.sol"; diff --git a/packages/contracts-bedrock/test/vendor/Initializable.t.sol b/packages/contracts-bedrock/test/vendor/Initializable.t.sol index 05fff737bd6e..73177a36f1a5 100644 --- a/packages/contracts-bedrock/test/vendor/Initializable.t.sol +++ b/packages/contracts-bedrock/test/vendor/Initializable.t.sol @@ -2,14 +2,14 @@ pragma solidity 0.8.15; import { Bridge_Initializer } from "test/setup/Bridge_Initializer.sol"; -import { Executables } from "scripts/Executables.sol"; +import { Executables } from "scripts/libraries/Executables.sol"; import { CrossDomainMessenger } from "src/universal/CrossDomainMessenger.sol"; import { L2OutputOracle } from "src/L1/L2OutputOracle.sol"; import { SystemConfig } from "src/L1/SystemConfig.sol"; import { SuperchainConfig } from "src/L1/SuperchainConfig.sol"; import { ResourceMetering } from "src/L1/ResourceMetering.sol"; import { OptimismPortal } from "src/L1/OptimismPortal.sol"; -import { ForgeArtifacts } from "scripts/ForgeArtifacts.sol"; +import { ForgeArtifacts } from "scripts/libraries/ForgeArtifacts.sol"; import { Process } from "scripts/libraries/Process.sol"; import "src/L1/ProtocolVersions.sol"; import "src/dispute/lib/Types.sol";