Skip to content

Commit 27731f5

Browse files
jackchumapauldowmanaliershGarmashAlexsmartcontracts
authored
feat: add op contracts (v6.0.0-rc.2) (#189)
* Increase MAX_GAS_LIMIT to a new value that's safe with MT Cannon (#15864) * refactor(test): improve SystemConfig test structure and documentation (#15791) - consolidate test initialization into a single SystemConfig_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - convert @dev to @notice tags where appropriate - ensure comment lines stay within 100 character limit * refactor(test): improve ETHLockbox test structure and documentation (#15780) - consolidate test initialization into a single ETHLockbox_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - convert @dev to @notice tags where appropriate - ensure comment lines stay within 100 character limit - rename test_initialization_succeeds to test_initialize_succeeds * feat: verify that all contracts in src directory have interfaces (#15302) * feat: add src contract interface verification check * test: add tests for src contract interface verification * Update main.go * Update main_test.go * simplify code * Update main.go * fix: remove old foundry bug hack (#15983) Removes an old hack that was needed because of a bug in foundry. * op-fetcher: query for EthLockboxProxy address (#15976) * feat: remove Specs.t.sol (#16012) Removes Specs.t.sol in favor of an authentication review step as part of the source code review step for each release that includes changes to the smart contracts. * fix: as many typos as possible (#16029) * fix: as many typos as possible * fix: even more typos * refactor(test): improve OptimismPortal2 test structure and documentation (#15724) * refactor(test): improve OptimismPortal2 test structure and documentation - consolidate test initialization into a single OptimismPortal2_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - convert @dev to @notice tags where appropriate - ensure comment lines stay within 100 character limit * style(test): add line breaks to OptimismPortal2 tests for readability * fix: updated constructor arg parsing in VerifyOPCM (#16034) * fix: updated constructor arg parsing in VerifyOPCM Updates VerifyOPCM to do custom constructor arg parsing because the Etherscan endpoint for constructor args has changed. * fix: typo in function name * refactor(test): cleanup of L1 test structure and documentation (#15903) * refactor(test): improve L1CrossDomainMessenger test structure and documentation - consolidate test initialization into a single L1CrossDomainMessenger_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - convert @dev to @notice tags where appropriate - ensure comment lines stay within 100 character limit - remove duplicated ForgeArtifacts and StorageSlot imports - add virtual modifier to setup function * refactor(test): rename L1CrossDomainMessenger_Test to L1CrossDomainMessenger_Unclassified_Test * refactor(test): improve L1StandardBridge test structure and documentation - consolidate test initialization into a single L1StandardBridge_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into L1StandardBridge_Unclassified_Test - rename setUp to _setupPauseBridge as a helper function for paused state tests - refactor test function names to follow naming convention - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * refactor(test): improve ResourceMetering test structure and documentation - consolidate test initialization into a single ResourceMetering_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - refactor test function names to follow naming convention - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * refactor(test): improve OPContractManager test structure and documentation - consolidate test initialization into a single OPContractManager_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - refactor test function names to follow naming convention - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * fix(test): restore correct implementation of test_pause_callsSuperchainConfig_succeeds * fix(test): cleanup L1CrossDomainMessenger and restore OPContractManager test - Remove obsolete systemConfig assertion in L1CrossDomainMessenger test - Restore test_verifyOpcmCorrectness_succeeds in OPContractManager test suite * fix(test): fix failing upgrade tests in OPContractsManager and L1CrossDomainMessenger - Remove skipIfNotOpFork conditions in OPContractsManager upgrade tests - Add runUpgrade13UpgradeAndChecks calls in OPContractsManager upgrade tests - Add systemConfig assertion in L1CrossDomainMessenger upgrade test * refactor(test): improve StandardValidator test structure and documentation (#16068) * refactor(test): improve StandardValidator test structure and documentation - organize test functions by component being validated - separate core validation tests and general override tests into their own contracts - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * Update packages/contracts-bedrock/test/L1/StandardValidator.t.sol Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * feat: Simplify op-deployer scripts: Switch from legacy to the new scripts for DeploySuperchain & DeployImplementations [17/N] (#15551) * step 1: Delete old scripts & tests; Remove the "2" from the file names & contract names of the new scripts * step 2: Update the downstream scripts * step 3: Delete the old opcm script wrappers; Remove the "2" from the filenames & types of the new wrappers * step 4.1: Create OPCM scripts struct in pipeline and ad it to Env struct. This step might not be necessary anymore * step 4.2: Adjust the pipeline scripts to use the new scripts * step 4.3: Adjust op-chain-ops * step 4.4: Adjust bootstrap scripts. In this case there is only one deployment per CLI target so the Scripts struct needs to be created for every CLI target * step 5: Skip the regression tests so that we can publish the new contract artifacts, after which the tests need to be updated and regression tests unskipped * rebase: Remove unused imports * fix: Misrebase * fix: Misrebase * fix: Misrebase * fix test --------- Co-authored-by: Matthew Slipper <me@matthewslipper.com> * cannon: Support Go 1.24 (#15737) * Add go 1.24 testdata * Stop generating 32-bit test programs * Add new state version and feature flag * Update ProgramPath helper to accept a new GoTarget parameter * Add program test that targets the getrandom syscall * Update test references to hello.elf * Update InstrumentedState tests to run across vms * Use t.Fatal instead of panic when contract deployment fails * Update state version constraints in MIPS64.sol * Bump MIPS64.sol contract version * Update random test to read data a few different ways * Fix int parsing base - we're handling decimal values not hex values * Reduce logging from mips test util * Implement getrandom syscall and add tests * Rework bit math * Rework reproducible-prestate to build for current and next Go versions * Add testdata for the new state version * Fix MIPS64 compilation error * Update publish-cannon-prestates to publish cannon-next version * Update cannon-prestate-interop vm type * Update common program tests to target correct go version * Fix lint error * Update noop, supported syscall tests * Update valid versions in solidity tests * Rename variable for clarity * Use splitmix64 algorithm for random data generation * Run semver-lock * Update documentation comment * Fix parameter name * Tweak version comments * Copy interop elf file * Cut unused helper method * Make splitmix an independent function * Cut unused build-all target * Add some print statements to debug timeout * Cut debug log, tweak if statement * Build interop and interopNext absolute prestates * Fix reproducible-prestate whitespace * e2e: Switch interop prestate variant based on allocType * Run super_test across available vm types * Re-run semver-lock to fix merge conflict * Add go mod tidy changes * Bump MIPS64 version * Revert "Run super_test across available vm types" This reverts commit f9898462f50e2a9fe2afe65c780061492dfa92ea. * Update a few e2e super tests to run across all vms * Add some debug printlns * Revert "Add some debug printlns" This reverts commit 0074cb0d53b77f56c6c9af5c71a221c3aa292a38. * Extend slow test timeout * Don't group getrandom with noop syscalls * Rework op-program analysis to run inside of docker This allows us to run the analysis using different versions of Go. * Suppress detached head warnings * Cut seemingly unnecessary dependencies * Set up docker in circleci * Address todo - get vm-compat task running correctly * Run go-lint-fix * refactor(test): cleanup of /universal tests structure and documentation (#15973) * refactor(test): improve ReinitializableBase test documentation - rename test contract to ReinitializableBase_InitVersion_Test - add @title and @notice tags to test contract * refactor(test): improve ExtendedPause test documentation - add @title and @notice tags to test contract - convert @dev tags to @notice in function comments * refactor(test): improve SafeSend test documentation - rename SafeSendTest to SafeSend_Constructor_Test - add @title and @notice tags to test contract * refactor(test): improve OptimismMintableERC20 test structure and documentation - consolidate test initialization into a single OptimismMintableERC20_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function into OptimismMintableERC20_Unclassified_Test - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve StandardBridge test structure and documentation - consolidate test initialization into a single StandardBridge_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve OptimismMintableERC20Factory test structure and documentation - consolidate test initialization into a single OptimismMintableERC20Factory_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function into OptimismMintableERC20Factory_Unclassified_Test - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve Proxy test structure and documentation - consolidate test initialization into a single Proxy_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function into Proxy_Unclassified_Test - refactor test function names to follow naming convention - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve ProxyAdmin test structure and documentation - consolidate test initialization into a single ProxyAdmin_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or that test multiple functions into ProxyAdmin_Unclassified_Test - refactor test function names to follow naming convention - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): move _calculateTokenAddress helper function to TestInit contract in OptimismMintableERC20Factory * refactor(test): improve CrossDomainMessenger test structure and documentation - consolidate test initialization into a single CrossDomainMessenger_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * op-deployer: Update L2 genesis generation to check fork instead of useInterop flag (#16095) * op-deployer: Update L2 genesis generation to check fork instead of useInterop flag * op-deployer: Only add CrossL2Inbox to genesis when there are multiple chains in the dependency set. * op-e2e: Actually support the interop fork in interop tests. Interop fork is before Jovian. * Remove unused import. * Update tests to expect interop before jovian * Adds mips checks to StandardValidator (#16170) * Adds mipsVersion checks to StandardValidator * Add IMIPS64 interface * Add ISemver to StandardValidator * fmt * fixup IMIPS64 * Update semver lock * fix natspec on semver * fix interface again A * fix SV iface * Add SV to allowed files * fix SV iface * fix SV iface * refactor(test): cleanup of L2 test structure and documentation (#15901) * refactor(test): improve OperatorFeeVault test documentation - rename test contract to OperatorFeeVault_Constructor_Test - add @title and @notice tags to test contract - convert @dev tag to @notice * refactor(test): improve L1FeeVault test documentation - rename test contract to L1FeeVault_Constructor_Test - add @title and @notice tags to test contract - convert @dev tag to @notice * refactor(test): improve BaseFeeVault test documentation - rename test contract to BaseFeeVault_Constructor_Test - add @title and @notice tags to test contract - convert @dev tag to @notice * refactor(test): improve OptimismSuperchainERC20Beacon test structure and documentation - rename OptimismSuperchainERC20BeaconTest to OptimismSuperchainERC20Beacon_TestInit - move implementation test into dedicated OptimismSuperchainERC20Beacon_Implementation_Test contract - improve test contract documentation with more specific @title and @notice tags * refactor(test): improve WETH test structure and documentation - organize individual test functions into separate contracts - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate * refactor(test): improve OptimismMintableERC721Factory test structure and documentation - consolidate test initialization into a single OptimismMintableERC721Factory_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - add function-level @notice comments describing expected behavior under test - ensure comment lines stay within 100 character limit * refactor(test): improve OptimismSuperchainERC20Factory test structure and documentation - consolidate test initialization into a single OptimismSuperchainERC20Factory_TestInit contract - organize individual test functions into separate contract inheriting from TestInit - add @title and @notice tags to all test contracts * docs(test): improve test documentation clarity - ensure comment lines stay within 100 character limit in OptimismSuperchainERC20Beacon test - Update WETH test functions descriptions to explicitly mention default values * refactor(test): improve L2ToL1MessagePasser test structure and documentation - organize individual test functions into separate contracts - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate * refactor(test): improve ExecutingMessageEmitted test structure and documentation - consolidate test initialization into a single ExecutingMessageEmitted_TestInit contract - rename ExecutingMessageEmittedTest to ExecutingMessageEmitted_Test - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve Predeploys test structure and documentation - consolidate test initialization into a single Predeploys_TestInit contract - rename PredeploysTest and PredeploysInteropTest to Predeploys_Test and Predeploys_Interop_Test - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve OptimismMintableERC721 test structure and documentation - consolidate test initialization into a single OptimismMintableERC721_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function into OptimismMintableERC721_Unclassified_Test - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - add function-level @notice comments describing expected behavior under test - ensure comment lines stay within 100 character limit * refactor(test): improve SuperchainERC20 test structure and documentation - consolidate test initialization into a single SuperchainERC20_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve SuperchainETHBridge test structure and documentation - consolidate test initialization into a single SuperchainETHBridge_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve ETHLiquidity test structure and documentation - consolidate test initialization into a single ETHLiquidity_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve SuperchainTokenBridge test structure and documentation - consolidate test initialization into a single SuperchainTokenBridge_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve L1Block test structure and documentation - consolidate test initialization into a single L1Block_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - add function-level @notice comments describing expected behavior under test - ensure comment lines stay within 100 character limit * refactor(test): improve CrossL2Inbox test structure and documentation - consolidate test initialization into a single CrossL2Inbox_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - add @notice tag to test function comments - ensure comment lines stay within 100 character limit * refactor(test): improve L2StandardBridgeInterop test structure and documentation - consolidate test initialization into a single L2StandardBridgeInterop_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve L2ERC721Bridge test structure and documentation - consolidate test initialization into a single L2ERC721Bridge_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function into L2ERC721Bridge_Unclassified_Test - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * refactor(test): improve OptimismSuperchainERC20 test structure and documentation - consolidate test initialization into a single OptimismSuperchainERC20_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function into OptimismSuperchainERC20_Unclassified_Test - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve L2CrossDomainMessenger test structure and documentation - consolidate test initialization into a single L2CrossDomainMessenger_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function into L2CrossDomainMessenger_Unclassified_Test - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve L2ToL2CrossDomainMessenger test structure and documentation - consolidate test initialization into a single L2ToL2CrossDomainMessenger_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): standardize test initialization contract documentation - Update test initialization contract naming format to use _TestInit suffix - Add backticks around contract names in documentation comments - Fix duplicated notice tag in OptimismMintableERC721.t.sol - Fix contract naming convention in ExecutingMessageEmitted.t.sol * revert(test): remove refactor of files not belonging to L2 cleanup scope - remove Predeploys.t.sol refactor - remove ExecutingMessageEmmited.t.sol refactor * refactor(test): improve CrossDomainOwnable test structure and documentation - consolidate test initialization into a single CrossDomainOwnable_TestInit contract - organize tests into logical groups based on functionality (AccessControl and PortalIntegration) - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * refactor(test): improve CrossDomainOwnable2 test structure and documentation - consolidate test initialization into a single CrossDomainOwnable2_TestInit contract - organize tests into logical groups (RevertConditions and SuccessConditions) - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * refactor(test): improve CrossDomainOwnable3 test structure and documentation - consolidate test initialization into a single CrossDomainOwnable3_TestInit contract - organize tests into logical groups (BasicFunctionality, TransferOwnership, and CrossDomainAccess) - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * refactor(test): improve L2StandardBridge test structure and documentation - consolidate test initialization into a single L2StandardBridge_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function into L2StandardBridge_Unclassified_Test - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * refactor(test): improve SequencerFeeVault test structure and documentation - consolidate test initialization into a single SequencerFeeVault_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * fix(test): adds assumeNotForgeAddress to prevent Forge addresses as targets in L2ToL2CrossDomainMessenger tests * refactor(test): improve AssetReceiver test structure and documentation - rena test Initializer contract to AssetReceiver_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - refactor test function names to follow naming convention - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * Revert "refactor(test): improve AssetReceiver test structure and documentation" This reverts commit dd4a5a3473c8a7c006034521534728c23e9135f9. * feat: add toRpcHexString function to dispute helper (#16192) Adds another helper function to the DisputeMonitorHelper contract so we can use it in Hexagate monitoring. * fix: correct leading zero handling in helper (#16195) * maint: simplify interface check script (#15986) * maint: simplify interface check script Some simplifications to the interface check script, script was doing some extra work and we could cut down on the number of skipped contracts. * fix: old test * Update contracts versioning guidance (#16203) * refactor(test): cleanup /periphery test structure and documentation (#16149) * refactor(test): improve CheckTrue test structure and documentation - consolidate test initialization into CheckTrue_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into CheckTrue_Unclassified_Test - refactor test function names to follow naming convention - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): improve Transactor test structure and documentation - rename Initializer contract to Transactor_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to test contracts * refactor(test): improve TransferOnion test structure and documentation - consolidate test initialization into TransferOnion_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into TransferOnion_Unclassified_Test - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): improve AssetReceiver test structure and documentation - rena test Initializer contract to AssetReceiver_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - refactor test function names to follow naming convention - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): improve AdminFaucetAuthModule test structure and documentation - consolidate test initialization into AdminFaucetAuthModule_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - refactor test function names to follow naming convention - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): improve CheckSecrets test structure and documentation - consolidate test initialization into CheckSecrets_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into CheckSecrets_Unclassified_Test - reorder test functions to match the order of definitions in the base contract - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): improve CheckBalanceLow test structure and documentation - consolidate test initialization into CheckBalanceLow_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into CheckBalanceLow_Unclassified_Test - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): improve DisputeMonitorHelper test structure and documentation - reorder test functions to match the order of definitions in the base contract - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): improve Faucet test structure and documentation - rename test initialization contract to Faucet_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - refactor test function names to follow naming convention - reorder test functions to match the order of definitions in the base contract - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): improve Drippie test structure and documentation - consolidate test initialization into Drippie_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - refactor test function names to follow naming convention - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * Update packages/contracts-bedrock/test/periphery/drippie/Drippie.t.sol Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * Update packages/contracts-bedrock/test/periphery/AssetReceiver.t.sol Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * refactor(test): add title and notice tag to withdrawERC721 contract in AssetReceiver test file * fix(test): apply forge fmt to resolve formatting issues in periphery tests --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * refactor(test): improve EventLogger test structure and documentation (#16194) * rename test initializer to EventLogger_TestInit contract * organize individual test functions into separate contracts inheriting from TestInit * add @title and @notice tags to test contracts * refactor(test): improve AddressAliasHelper test documentation (#16201) - group tests not directly tied to a base contract function or are testing multiple functions into AddressAliasHelper_Unclassified_Test - add @title and @notice tags to test contract * refactor(test): cleanup /safe test structure and documentation (#16164) * refactor(test): improve SafeSigners test structure and documentation - consolidate test initialization into SafeSigners_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - refactor test function names to follow naming convention - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * refactor(test): improve LivenessGuard test structure and documentation - rename Getter test contract to Safe_Test contract - group tests not directly tied to a base contract function or are testing multiple functions into LivenessGuard_Unclassified_Test - refactor test function names to follow naming convention - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * refactor(test): improve DeputyPauseModule test structure and documentation - group tests not directly tied to a base contract function or are testing multiple functions into DeputyPauseModule_Unclassified_Test - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): improve LivenessModule test structure and documentation - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into LivenessModule_Unclassified_Test - merge LivenessModule_RemoveOwners_Test, LivenessModule_RemoveOwners_TestFail and LivenessModule_RemoveOwnersFuzz_Test contracts into a single contract - merge LivenessModule_CanRemove_Test and LivenessModule_CanRemove_TestFail contracts into a single contract - simplify fuzz test setup by removing unnecessary variable prefixes and override logic - reorder test functions to match the order of definitions in the base contract - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * refactor(test): cleanup /governance test structure and documentation (#16177) * refactor(test): improve GovernanceToken test structure and documentation - consolidate test initialization into GovernanceToken_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into GovernanceToken_Unclassified_Test - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * refactor(test): improve MintManager test documentation - rename Initializer contract to MintManager_TestInit contract - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * refactor(test): cleanup /legacy test structure and documentation (#16207) * refactor(test): improve LegacyMessagePasser test structure and documentation - rename test contract to LegacyMessagePasser_PassMessageToL1_Test - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate * refactor(test): improve L1BlockNumber test structure and documentation - consolidate test initialization into L1BlockNumber_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - reorder test functions to match the order of definitions in the base contract - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate * refactor(test): improve LegacyMintableERC20 test structure and documentation - consolidate test initialization into LegacyMintableERC20_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to test contracts * refactor(test): improve ResolvedDelegateProxy test structure and documentation - consolidate test initialization into ResolvedDelegateProxy_TestInit contract - rename test contract to ResolvedDelegateProxy_Fallback_Test - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate * refactor(test): improve DeployerWhitelist test structure and documentation - consolidate test initialization into DeployerWhitelist_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - reorder test functions to match the order of definitions in the base contract - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * refactor(test): improve L1ChugSplashProxy test structure and documentation - consolidate test initialization into L1ChugSplashProxy_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into L1ChugSplashProxy_Unclassified_Test - reorder test functions to match the order of definitions in the base contract - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): improve VerifyOPCM test documentation (#16210) - add @title and @notice tags to test contracts * refactor(test): cleanup /cannon test structure and documentation (#16211) * refactor(test): improve MIPS64 test structure and documentation - consolidate test initialization into MIPS64_TestInit contract - group tests not directly tied to a base contract function or are testing multiple functions into MIPS64_Unclassified_Test - add @title and @notice tags to test contracts * refactor(test): improve MIPS64Memory test structure and documentation - consolidate test initialization into MIPS64Memory_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - refactor test function names to follow naming convention - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * refactor(test): cleanup of /dispute test structure and documentation (#16088) * refactor(test): improve DelayedWETH test structure and documentation - consolidate test initialization into a single DelayedWETH_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * refactor(test): improve LibPosition test structure and documentation - consolidate test initialization into a single LibPosition_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function into LibPosition_Unclassified_Test - refactor test function names to follow naming convention - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve AnchorStateRegistry test structure and documentation - rename AnchorStateRegistry_Init contract AnchorStateRegistry_TestInit - reorder test contract based in the order of the base file - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * remove dangling functions (#15997) * refactor(test): improve PreimageOracle test structure and documentation (#16323) - consolidate test initialization into PreimageOracle_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into PreimageOracle_Unclassified_Test - refactor test function names to follow naming convention - reorder test functions to match the order of definitions in the base contract - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): improve EOA test structure and documentation (#16319) - consolidate test initialization into EOA_TestInit contract - rename test contract to EOA_isSenderEOA_Test to follow the naming convention - add @title and @notice tags to test contract * refactor(test): cleanup of misplaced test files (pending relocation) (#16324) * refactor(test): improve L2Genesis test structure and documentation - consolidate test initialization into L2Genesis_TestInit contract - organize individual test function into separate contracts inheriting from TestInit - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): improve Predeploys test structure and documentation - consolidate test initialization into Predeploys_TestInit contract - organize individual test function into separate contract inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into Predeploys_Unclassified_Test and Predeploys_Unclassified_Test - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * refactor(test): improve Preinstalls test structure and documentation - consolidate test initialization into Preinstalls_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into Preinstalls_Unclassified_Test - refactor test function names to follow naming convention - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * refactor(test): improve WETH98 test structure and documentation - consolidate test initialization into WETH98_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): improve DeployUtils test structure and documentation - consolidate test initialization into DeployUtils_TestInit contract - rename test contract to DeployUtils_AssertUniqueAddresses_Test to follow naming convention - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): continue cleanup of /dispute test suite (#16287) * refactor(test): improve PermissionedDisputeGame test structure and documentation - consolidate test initialization into PermissionedDisputeGame_TestInit contract - rename init parameters name to avoid shadowing with the state variables - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into PermissionedDisputeGame_Unclassified_Test - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * refactor(test): improve SuperPermissionedDisputeGame test structure and documentation - consolidate test initialization into SuperPermissionedDisputeGame_TestInit contract - rename init parameters name to avoid shadowing with the state variables - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into SuperPermissionedDisputeGame_Unclassified_Test - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * refactor(test): improve SuperFaultDisputeGame test structure and documentation - consolidate test initialization into SuperFaultDisputeGame_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - change TestInit import and constants name in invariant test file - group tests not directly tied to a base contract function or are testing multiple functions into SuperFaultDisputeGame_Unclassified_Test - refactor test function names to follow naming convention - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * refactor(test): improve LibGameId test documentation - refactor contract and test function names to follow naming convention - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * refactor(test): improve LibClock test documentation - refactor contract and test function names to follow naming convention - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * fix: correct test init structure * refactor(test): improve FaultDisputeGame test structure and documentation - consolidate test initialization into FaultDisputeGame_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - change TestInit import and constants name in invariant and AnchorStateRegistry test files - group tests not directly tied to a base contract function or are testing multiple functions into FaultDisputeGame_Unclassified_Test - refactor test function names to follow naming convention - reorder test functions to match the order of definitions in the base contract - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit * fix: bump coverage to 2xlarge * refactor(test): improve DisputeGameFactory test structure and documentation - rename test initialization contract to DisputeGameFactory_TestInit contract - change TestInit contract import in several files through the tests suite - group tests not directly tied to a base contract function or are testing multiple functions into DisputeGameFactory_Unclassified_Test - add @title and @notice tags to test contracts - convert @dev tags to @notice where appropriate - ensure comment stay within 100 character limit --------- Co-authored-by: Kelvin Fichter <kelvinfichter@gmail.com> * refactor(test): cleanup of /libraries test structure and documentation (#16103) * refactor(test): improve Constants test structure and documentation - rename test contract to Constants_Constants_Test to follow naming convention - add @title and @notice tags to test contract * refactor(test): improve StaticConfig test structure and documentation - consolidate test initialization into a single StaticConfig_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - refactor test function names to follow naming convention - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * refactor(test): improve DeployUtils test structure and documentation - consolidate test initialization into a single DeployUtils_TestInit contract - organize individual test functions into separate contract inheriting from TestInit - add @title and @notice tags to test contract - ensure comment lines stay within 100 character limit * refactor(test): improve GasPayingToken test structure and documentation - consolidate test initialization into a single GasPayingToken_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function into GasPayingToken_Unclassified_Test - refactor test function names to follow naming convention - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * refactor(test): improve Hashing test structure and documentation - add @title and @notice tags to all test contracts - reorder test functions to match the order of definitions in the base contract * refactor(test): improve TransientContext test structure and documentation - consolidate test initialization into a single TransientContext_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function into TransientContext_Unclassified_Test - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve SafeCall test structure and documentation - consolidate test initialization into a single SafeCall_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - refactor test function names to follow naming convention - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * refactor(test): improve Blueprint test structure and documentation - consolidate test initialization into a single Blueprint_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into Blueprint_Unclassified_Test - refactor test function names to follow naming convention - reorder test functions to match the order of definitions in the base contract - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve RLPWriter test documentation - add @title and @notice tags to all test contracts - add function-level @notice comments describing expected behavior under test - ensure comment lines stay within 100 character limit * refactor(test): improve RLPReader test documentation - add @title and @notice tags to all test contracts - add function-level @notice comments describing expected behavior under test - ensure comment lines stay within 100 character limit * refactor(test): improve Encoding test structure and documentation - consolidate test initialization into a single Encoding_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - group tests not directly tied to a base contract function or are testing multiple functions into Encoding_Unclassified_Test - add @title and @notice tags to all test contracts - convert @dev tags to @notice where appropriate - ensure comment lines stay within 100 character limit * refactor(test): improve Bytes test structure and documentation - consolidate test initialization into a single Bytes_TestInit contract - organize individual test functions into separate contracts inheriting from TestInit - add @title and @notice tags to all test contracts - ensure comment lines stay within 100 character limit * refactor(test): improve MerkleTrie test structure and documentation - consolidate test initialization into MerkleTrie_TestInit contract - change visibility of rehashOtherElements function from private to internal - add @title and @notice tags to test contracts - ensure comment stay within 100 character limit * refactor(test): revert Constants test contract name to original * fix: VerifyOPCM support tuple arguments (#16320) * Allow arbitrary gas amounts in DeployOPChain (#16365) * Allow arbitrary gas amounts in DeployOPChain * Update packages/contracts-bedrock/scripts/deploy/DeployOPChain.s.sol * chore(files): relocate misplaced test files to appropriate folders (#16357) * chore(files): relocate misplaced test files to appropriate folders - Move ExecutingMessageEmitted.t.sol → integration - Move L2Genesis.t.sol → scripts - Move Predeploy.t.sol, Preinstalls.t.sol → libraries - Move WETH98.t.sol → universal - Move DeployOwnership.t.sol → scripts - Move Initializable.t.sol → integration * chore(test): move Initializable.t.sol back to vendor/ * fix(semgrep): update WETH98 test file exclude path in rules * cannon: Return EAGAIN error when writing to a EventFd file descriptor (#16341) * cannon: Go impl now returns EAGAIN error when writing to a EventFd file descriptor * cannon: Solidity impl now returns EAGAIN error when writing to a EventFd file descriptor * cannon: Update tests. * contracts: Update expected mipsVersion * contracts: Update version of StandardValidator.sol * cannon: Switch to using v1 as a flag. * cannon: Fix error return method for unknown file descriptors. * cannon: Fix registers used to return error values for sys calls (#16346) * cannon: Use 100 for event fd instead of -1. Plus other review feedback. * cannon: Add eventfd2 syscall go program tests (#16370) * cannon: Update expected file descriptor --------- Co-authored-by: mbaxter <meredith@oplabs.co> * cannon: Enforce the non-block flag for eventfd syscalls (#16384) * Enforce non-block flag for eventfd syscalls * Run semver-lock * Update StandardValidator mipsVersion * emit Released event in setRC function (#16395) * emit Released event in setRC function * emit the event with the _isRC boolean * feat: refactor sent messages mapping (#16402) * feat: refactor sent messages mapping * fix: update L2ToL2CrossDomainMessenger mapping * chore: update sentMessages interface --------- Co-authored-by: AgusDuha <81362284+agusduha@users.noreply.github.com> * feat(test-validation): extend validation script to enforce test structure conventions (#16543) * chore(test-validation): add full test-artifact validation framework * Introduces `scripts/checks/test-validation/` (migrated from `test-names/`) * `main.go`, helpers, and unit tests * **New rules** * **Path rule** – test files must live under `test/**` and mirror a source file under `src/**` * **Contract-vs-file rule** – contract name in the compilation target must match the test file basename (`Foo.t.sol` → `Foo_*`) * **Naming-pattern rule** – allows only: * `<Contract>_TestInit` * `<Contract>_<Function>_Test` (function must exist in ABI) * `<Contract>_Uncategorized_Test` / `_Unclassified_Test` * `<Contract>_<Descriptor>_Harness` or `<Contract>_Harness` * **Function-existence rule** – verifies constructor / receive / fallback / selector names where required * Adds central **exclusion list** for legacy or vendor test paths so the validator can ship without failing CI * Refactors code into small, documented helpers (`validateTestName`, `validateTestStructure`, `checkSrcPath`, etc.) * Updates `justfile` with `just test-validation` target * Provides extensive inline docs to ease future rule additions * docs(test-validation): add detailed comments explaining exclusion reasons - Add comprehensive documentation for each exclusion category - Explain SRC validation exclusions for non-standard naming conventions - Document contract name validation exclusions for mismatched names - Clarify function name validation exclusions for lookup failures - Describe test pattern validation exclusions for non-standard patterns - Include inline comments for each excluded path with specific reasons * cannon: Update getrandom syscall to clear memory reservations (#16529) * Handle memory reservations * Run semver-lock * Add helper for memory reservation tests * Tweak reservation cases - make sure we have 64-bit variants * Move test logic out of helper file * Fix memory tracking * Cleanup - rename parameters * Test memory reservation changes in sysrandom tests * Rename helper * Fix type syntax * Update solidity to more closely match go formatting * Update StandardValidator * Run semver-lock * Group TrackMemAccess call with GetWord * feat: OPCM.migrate calldata generator script (#16532) * feat: OPCM.migrate calldata generator script * support dynamic opChainConfig lengths * add example calldata json in deploy-config * sanity check for zero values * forge fmt * remove example opcm generate config * check l1 cross domain messenger assertion (#16470) * remove checkL1CrossDomainMessenger assertion * fix unused imports * keep CHECK-L1XDM-10 and CHECK-L1XDM-70 * keep impl checks, add proxyAdmin check, remove unnecessary assertions in deployOPChain and deployImplementations * fix add proxyAdmin check * fix proxyAdmin check, add tests for it * rm duplicate assertions * rm duplicate assertions * fix comment of checkProxyAdminCallFails function * rm checkProxyAdminCallFails function from deploy script * rm unused import * fix(tests): align test contracts with new validation script rules (#16561) * fix(tests): align test contracts with new validation script rules - Renamed test contracts to match expected naming patterns (e.g., <Contract>_<Function>_Test) - Updated function names to align with contract names and validation expectations - Merged standalone test contracts into primary test contracts to reduce fragmentation - Refined test setup logic by introducing shared helper functions - Removed test files from exclusion list in validation script now that they conform - Adjusted comments in the validation script to reflect current file status * fix(test): fix SystemConfig test contract naming - Rename SystemConfig_Uncategorized_Test to SystemConfig_SuperchainConfig_Test to follow proper naming conventions * fix(test): update test files to pass validation script (#16590) - Rename helper contracts in DelayedWETH.t.sol to follow naming conventions - Rename FakeClone harness in DisputeGameFactory.t.sol to follow naming conventions - Consolidate DelayedWETH_WithdrawFrom_Test into DelayedWETH_Withdraw_Test - Differentiate merged test functions with descriptive prefixes - Remove 3 entries from validation script exclusion list * fix(test): update L1 folder tests to pass validation script (#16596) - Rename TestERC721 → L1ERC721Bridge_TestERC721_Harness to follow standard pattern - Rename L1ERC721Bridge_Pause_Test → L1ERC721Bridge_Paused_Test to match function name - Rename L1ERC721Bridge_Test → L1ERC721Bridge_Uncategorized_Test for consistency - Rename Encoding_Harness → L1CrossDomainMessenger_Encoding_Harness for standard naming - Merge L1CrossDomainMessenger_ReinitReentryTest into L1CrossDomainMessenger_Uncategorized_Test - Rename L1CrossDomainMessenger_Unclassified_Test → L1CrossDomainMessenger_Uncategorized_Test - Remove L1ERC721Bridge.t.sol and L1CrossDomainMessenger.t.sol from validation exclusions * fix: use abi.encodeCall for updatePrestate and addGameType + fix params (#16581) * fix: use abi.encodeCall for updatePrestate and addGameType and fix parameters * fix: unignore opcm from rule * fix: bump semver to correct degree * chore: update semver-lock * fix(test): update L2 folder tests to pass validation script (#16607) - Rename ValidateMessageRelayer → CrossL2Inbox_ValidateMessageRelayer_Harness to follow standard pattern - Rename TestERC721 → L2ERC721Bridge_TestERC721_Harness for standard naming - Rename TestMintableERC721 → L2ERC721Bridge_TestMintableERC721_Harness for standard naming - Rename NonCompliantERC721 → L2ERC721Bridge_NonCompliantERC721_Harness for standard naming - Rename L2ERC721Bridge_Test_Constructor → L2ERC721Bridge_Constructor_Test to match function name - Rename L2ERC721Bridge_Unclassified_Test → L2ERC721Bridge_Uncategorized_Test for consistency - Rename L2ToL2CrossDomainMessengerWithModifiableTransientStorage → L2ToL2CrossDomainMessenger_WithModifiableTransientStorage_Harness for standard naming - Remove CrossL2Inbox.t.sol, L2ERC721Bridge.t.sol, and L2ToL2CrossDomainMessenger.t.sol from validation exclusions * fix(test): update universal folder tests to pass validation script (#16610) - Rename ExternalRelay → CrossDomainMessenger_ExternalRelay_Harness to follow standard pattern - Rename SimpleStorage → Proxy_SimpleStorage_Harness for standard naming - Rename Clasher → Proxy_Clasher_Harness for standard naming - Update all references to renamed contracts in CrossDomainMessenger.t.sol, Proxy.t.sol, and ProxyAdmin.t.sol - Remove CrossDomainMessenger.t.sol and Proxy.t.sol from validation exclusions * integrate Standard Validator into OPCM (#16237) * integrate Standard Validator into OPCM * fixes * fixes * fixes * impl fixes * impl fixes * rm fn overload, add validateWithOverride to opcm * rm fn overload, add validateWithOverride to opcm * file name change, test fixes etc * fixes * rm semver * fixes * fix ci failures * fix semver lock * fix semver lock * try fix go tests * try fix go tests * try fix go tests * try fix go tests * try fix semver * try fix semver * try fix semver * try fix semver * update optimism-package commit * try fix semver * rename opcmvalidator to opcmstandardvalidator * rename opcmvalidator to opcmstandardvalidator * fix ci * fix validator upgrade tests, comments * fix validator upgrade tests, comments * fix validator upgrade tests * fix validator upgrade tests * fix validator upgrade tests * fix base and unichain upgrade tests * fixes * fixes * fixes * fixes * add comments for opcm validate functions * docs(style-guide): update test conventions & validation workflow (#16614) * docs: enhance smart contract testing style guide - add detailed naming rules with strict formatting requirements for test functions - expand contract naming conventions with specific patterns for different test types - include new sections on test file organization and naming exceptions - update validation script reference from tsx to just command - clarify organizing principles for better test structure - add legacy notice for deprecated _TestFail suffix * docs(style-guide): simplify test organization guidelines - Remove "non-trivial state changing" qualifier from function testing guideline - Eliminate redundant bullet point about grouping tests by per-function contracts * fix(test): update legacy, periphery, safe, and L2 folder tests to pass validation script (#16613) - Rename Owner → L1ChugSplashProxy_Owner_Harness to follow standard pattern - Rename Implementation → L1ChugSplashProxy_Implementation_Harness for standard naming - Rename SimpleImplementation → ResolvedDelegateProxy_SimpleImplementation_Harness for standard naming - Rename TestDrippie → Drippie_Test_Harness for standard naming - Rename WrappedGuard → LivenessGuard_WrappedGuard_Harness for standard naming - Consolidate L2StandardBridgeInterop_Convert_LegacyToSuper_Test and L2StandardBridgeInterop_Convert_SuperToLegacy_Test into L2StandardBridgeInterop_Convert_Test - Update test function names to include context (legacyToSuper/superToLegacy) for disambiguation - Remove L1ChugSplashProxy.t.sol, ResolvedDelegateProxy.t.sol, Drippie.t.sol, LivenessGuard.t.sol, and L2StandardBridgeInterop.t.sol from validation exclusions - Remove entire "PATHS EXCLUDED FROM TEST PATTERN VALIDATION" section as all issues resolved - Remove redundant library exclusions already covered by broader folder exclusion * refactor: remove duplicated struct (#16621) * docs: Remove outdated TOC entry (#16635) * fix edge case in unsed imports check script (#16693) * fix edge case in unsed imports check script * fix another edge case * add tests * refactor(test): improve SuperchainConfig test coverage and quality (#16675) - Add missing public getter tests (guardian, pauseTimestamps, version) - Convert hardcoded tests to fuzz tests for broader coverage - Add time-based pause expiration boundary testing - Enhance existing tests with proper parameter naming - Add comprehensive edge case validation * refactor(test-validation): remove unnecessary path exclusions (#16730) • Remove test/kontrol/ - directory contains no *.t.sol files • Remove test/setup/ directory exclusion and add specific test/setup/DeployVariations.t.sol file • Remove test/L1/StandardValidator.t.sol - file renamed to OPContractsManagerStandardValidator.t.sol which is already excluded • Directory exclusions were redundant since validation script only processes *.t.sol files * more deploy checks cleanup for mips, preimage oracle, eth lockbox, asr, delayedweth (#16749) * more deploy checks cleanup for mips, preimage oracle, eth lockbox, asr, delayedweth * fixes * remove unnecessary l1standardbridge assertions (#16715) * remove unnecessary l1standardbridge assertions * remove redundant declaration * fixes * fixes * remove unnecessary dispute game factory assertions (#16717) * remove unnecessary dispute game factory assertions * remove unnecessary dispute game factory assertions * fixes * remove unnecessary/duplicate system config assertions (#16585) * remove unnecessary/duplicate system config assertions * try fix ci * fix tests failing * try fix go test failure * finally fix go tests ... ? * ci: increase contracts build machine size * fix * reduce verbosity and code repitition --------- Co-authored-by: Maurelian <maurelian@protonmail.ch> * remove unnecessary l1erc721bridge assertions (#16716) * remove unnecessary l1erc721bridge assertions * fixes * fix unused import * remove unnecessary optimism mintable erc20 factory assertions (#16719) * remove unnecessary optimism mintable erc20 factory assertions * fixes * refactor(test): improve L1 bridges test coverage and quality with AI assistance [Prompt v0.7.0] (#16772) * refactor(test): enhance L1StandardBridge test coverage with fuzz tests and edge cases - Add fuzz tests for depositETHTo with random recipients and amounts - Add fuzz tests for depositERC20 with various amounts and gas limits - Add fuzz tests for access control with random unauthorized addresses - Add edge case test for depositERC20To with zero amount - Fix naming convention from Unclassified to Uncategorized - Improve test documentation with concise parameter descriptions * refactor(test): enh…
1 parent f87cacb commit 27731f5

829 files changed

Lines changed: 164484 additions & 665 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
OP_COMMIT=3056348b21a07e584225310bbc27f1adce5ca2a9
21
BASE_MAINNET_URL=https://mainnet.base.org

.github/workflows/test.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,29 @@ jobs:
2828
with:
2929
version: stable
3030

31-
- name: Show Forge version
32-
run: |
33-
forge --version
31+
- name: Install Go
32+
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
33+
with:
34+
go-version-file: scripts/go-ffi/go.mod
35+
cache-dependency-path: scripts/go-ffi/go.sum
3436

35-
- name: Run Forge fmt
36-
run: |
37-
forge fmt --check
38-
id: fmt
37+
- name: Install just
38+
run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
39+
40+
- name: Show Forge version
41+
run: forge --version
3942

4043
- name: Install dependencies
41-
run: |
42-
make deps
44+
run: make deps
45+
46+
- name: Run Forge fmt check
47+
run: just lint-check
48+
id: fmt
4349

4450
- name: Run Forge build
45-
run: |
46-
forge build --sizes
51+
run: just forge-build
4752
id: build
4853

4954
- name: Run Forge tests
50-
run: |
51-
forge test -vvv
55+
run: just test
5256
id: test

.gitignore

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,48 @@
1-
lib/**
2-
cache/***
3-
out/**
1+
# Artifacts and Cache
2+
artifacts
3+
forge-artifacts
4+
cache
5+
broadcast
6+
kout-proofs
7+
test/kontrol/logs
8+
out
9+
lib
410

5-
.gitmodules
11+
# Metrics
12+
coverage.out
13+
.resource-metering.csv
614

15+
# Testing State
16+
.testdata
17+
kontrol_prove_report.xml
18+
19+
# Scripts
20+
scripts/go-ffi/go-ffi
21+
scripts/go-ffi/go-ffi-cannon64
22+
23+
# Environment Variables
24+
.envrc
25+
!.envrc.example
26+
27+
# Deployments
28+
deployments/900
29+
deployments/901
30+
deployments/hardhat
31+
deployments/getting-started
32+
deployments/*/.deploy
33+
deployments/1337
34+
deployments/31337-deploy.json
35+
deployments/kontrol.json
36+
deployments/kontrol.jsonReversed
37+
deployments/kontrol-fp.json
38+
deployments/kontrol-fp.jsonReversed
39+
deployments/1-deploy.json
40+
41+
# Getting Started guide deploy config
42+
deploy-config/getting-started.json
43+
44+
# IDE
745
/.idea/
46+
47+
# OS
848
.DS_Store

CLAUDE.md

Lines changed: 97 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -4,67 +4,100 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
This repository contains Solidity smart contracts and deployment scripts for Base, an Ethereum L2 using Optimism's bedrock architecture. The codebase includes revenue sharing contracts, smart escrow functionality, fee vault fixes, multisig deployment utilities, and challenger contracts.
8-
9-
## Environment Setup
10-
11-
Before working with this codebase:
12-
1. Ensure you have an `.env` file with `OP_COMMIT` variable set (required for dependency management)
13-
2. Run `make deps` to install all dependencies including Optimism contracts at the specified commit
14-
15-
## Common Commands
16-
17-
### Development Commands
18-
- `make deps` - Install all dependencies (foundry, OpenZeppelin, Optimism contracts)
19-
- `make test` - Run all tests with verbose output and FFI enabled
20-
- `forge build` - Build all contracts
21-
- `make bindings` - Generate Go bindings for BalanceTracker and FeeDisburser contracts
22-
23-
### Setup Commands
24-
- `make install-foundry` - Install Foundry toolkit (if not already installed)
25-
- `make clean-lib` - Clean lib directory
26-
27-
## Architecture Overview
28-
29-
### Core Contract Categories
30-
31-
1. **Revenue Share System** (`src/revenue-share/`)
32-
- `BalanceTracker.sol` - Manages funding of system addresses and profit distribution
33-
- `FeeDisburser.sol` - Handles fee disbursement logic
34-
35-
2. **Smart Escrow** (`src/smart-escrow/`)
36-
- `SmartEscrow.sol` - Vesting contract for OP token payments with termination capabilities
37-
38-
3. **Fee Vault Fixes** (`src/fee-vault-fixes/`)
39-
- `FeeVault.sol` - Enhanced fee vault implementation
40-
41-
4. **Challenger System** (`src/`)
42-
- `Challenger1of2.sol` - Deprecated 1-of-2 challenger contract (pre-fault proofs)
43-
44-
5. **Multisig Utilities** (`script/universal/`)
45-
- Complete multisig deployment and management system with nested and double-nested capabilities
46-
- Includes signature handling, simulation, and deployment scripts
47-
48-
### Test Structure
49-
- Tests mirror the `src/` directory structure
50-
- Uses Foundry's testing framework with FFI enabled
51-
- Common test utilities in `test/CommonTest.t.sol`
52-
- Mock contracts available in `test/*/mocks/` directories
53-
54-
### Dependencies
55-
- Built on Foundry with Solidity 0.8.15
56-
- Uses OpenZeppelin contracts v4.9.3 for core functionality
57-
- Integrates with Optimism bedrock contracts (version specified by OP_COMMIT)
58-
- Includes Solmate and Solady for additional utilities
59-
60-
### Contract Deployment
61-
- L1 and L2 deployment scripts in `script/deploy/`
62-
- Test deployment scripts for both layers
63-
- Universal deployment utilities for cross-chain operations
64-
65-
## Important Notes
66-
67-
- This repository primarily extends Optimism's bedrock contracts rather than replacing them
68-
- The OP_COMMIT environment variable controls which version of Optimism contracts to use
69-
- Contracts use 999999 optimizer runs for maximum gas efficiency
70-
- All contracts target Solidity 0.8.15 for consistency
7+
Base contracts repository — an Optimism Bedrock-based L2 blockchain. Contains Solidity smart contracts for Base's L1 and L2 infrastructure, built on top of Optimism's contracts-bedrock (op-contracts/v6.0.0-rc.2). Uses Foundry (Forge) as the build/test framework.
8+
9+
## Build & Development Commands
10+
11+
All commands use `just` (justfile) unless noted. The Makefile handles initial setup only.
12+
13+
### Setup
14+
```bash
15+
make install-foundry # Install Foundry toolchain
16+
make deps # Install all Solidity dependencies (forge install + manual clones)
17+
just build-go-ffi # Build the Go FFI tool (required before running tests)
18+
```
19+
20+
### Building
21+
```bash
22+
just build # Production build (runs lint-fix first, optimizer_runs=999999)
23+
just build-dev # Fast dev build (FOUNDRY_PROFILE=lite, no optimization)
24+
just build-source # Build src/ only (skip tests and scripts)
25+
```
26+
27+
### Testing
28+
```bash
29+
just test # Run all tests (builds go-ffi first)
30+
just test-dev # Fast dev tests (lite profile, 8 fuzz runs)
31+
just test -- --match-test "test_myFunction" # Run a single test by name
32+
just test -- --match-contract "MyContract" # Run tests in a specific contract
33+
just test -- --match-path "test/L1/*" # Run tests matching a path
34+
just test-rerun # Re-run only failed tests with verbose output
35+
just test-upgrade # Fork tests against mainnet/sepolia (requires ETH_RPC_URL)
36+
just coverage # Coverage report
37+
```
38+
39+
### Linting & Formatting
40+
```bash
41+
just lint # Format + check (forge fmt)
42+
just lint-check # Check only (no auto-fix)
43+
forge fmt # Direct format command
44+
```
45+
Line length: 120 chars. Multiline function headers: all params on separate lines.
46+
47+
### Pre-PR Workflow
48+
```bash
49+
just pre-pr # Full workflow: build-dev, lint, build-source, all checks
50+
just pre-pr --clean # Same but cleans build artifacts first
51+
just check # Run all validation checks without building
52+
```
53+
54+
### Snapshots & Semver
55+
```bash
56+
just snapshots # Regenerate ABI/storage snapshots and semver-lock
57+
just snapshots-check # Verify snapshots are up to date
58+
```
59+
60+
## Architecture
61+
62+
### Contract Structure (src/)
63+
- **L1/**: Ethereum mainnet contracts — `OPContractsManager.sol` (central upgrade manager), `OptimismPortal2.sol` (proof finalization), `SystemConfig.sol`, `SuperchainConfig.sol`
64+
- **L2/**: L2 contracts — `L1Block.sol`, `L2StandardBridge.sol`, `CrossL2Inbox.sol`, `SuperchainERC20.sol`
65+
- **dispute/**: Fault proof game contracts with v1, v2, and zk variants
66+
- **cannon/**: Cannon VM contracts (MIPS-based fault proof execution)
67+
- **universal/**: Cross-chain utilities (bridges, messengers)
68+
- **libraries/**: Shared libraries — `Constants.sol`, `Predeploys.sol` (canonical L2 addresses), `Preinstalls.sol`
69+
- **periphery/**: Non-core contracts (drippie, faucet, monitoring)
70+
- **safe/**: Safe multisig extensions
71+
- **governance/**, **recovery/**, **revenue-share/**, **smart-escrow/**: Domain-specific contracts
72+
73+
### Interfaces (interfaces/)
74+
Separate directory for contract interfaces, mirroring the src/ structure. Go checks (`scripts/checks/interfaces`) validate that interfaces match their implementations.
75+
76+
### Test Structure (test/)
77+
- Mirrors `src/` directory layout
78+
- `CommonTest.t.sol`: Base test class with standard accounts (alice, bob, admin, deployer)
79+
- `test/setup/Setup.sol`: Full system deployment setup using `Deploy.s.sol`
80+
- `test/setup/FeatureFlags.sol`: Development feature gating for tests
81+
- `test/mocks/`: 20+ mock contracts
82+
- `test/invariants/`: Property-based invariant tests
83+
- `test/kontrol/`: K framework formal verification proofs
84+
- FFI enabled: tests can call external programs via `scripts/go-ffi/`
85+
86+
### Deployment (scripts/)
87+
- `scripts/deploy/Deploy.s.sol`: Main deployment script
88+
- Input/Output pattern (`BaseDeployIO.sol`): Modular deployment composition
89+
- `deploy-config/`: JSON configs per network (mainnet.json, sepolia.json, hardhat.json)
90+
- `scripts/L2Genesis.s.sol`: L2 genesis state generation
91+
92+
## Key Patterns
93+
94+
- **Proxy pattern**: EIP-1967 transparent proxies for upgradeability
95+
- **Compilation restrictions**: Dispute game contracts and OPContractsManager use 5000 optimizer runs (not 999999) due to size constraints. The `lite` profile mirrors these restrictions with 0 runs.
96+
- **Foundry profiles**: `default` (production), `lite` (dev), `ci` (128 fuzz runs), `ciheavy` (20000 fuzz runs)
97+
- **Semver tracking**: Contracts use semantic versioning tracked in `snapshots/semver-lock.json`
98+
- **Storage spacers**: Validated by `scripts/checks/spacers` to prevent storage layout conflicts in upgradeable contracts
99+
- **Solidity version**: 0.8.15 for main contracts, some use ^0.8.0
100+
101+
## CI
102+
103+
GitHub Actions runs on PR: `forge fmt --check``make deps``forge build --sizes``forge test -vvv` with `FOUNDRY_PROFILE=ci`.

Makefile

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include .env
1+
-include .env
22

33
##
44
# Solidity Setup / Testing
@@ -9,13 +9,24 @@ install-foundry:
99
~/.foundry/bin/foundryup
1010

1111
.PHONY: deps
12-
deps: clean-lib checkout-op-commit
13-
forge install --no-git github.com/foundry-rs/forge-std \
14-
github.com/OpenZeppelin/openzeppelin-contracts@v4.9.3 \
15-
github.com/OpenZeppelin/openzeppelin-contracts-upgradeable@v4.7.3 \
16-
github.com/rari-capital/solmate@8f9b23f8838670afda0fd8983f2c41e8037ae6bc \
17-
github.com/Vectorized/solady@862a0afd3e66917f50e987e91886b9b90c4018a1 \
18-
github.com/safe-global/safe-smart-account@v1.4.1-3
12+
deps: clean-lib
13+
forge install --no-git \
14+
github.com/foundry-rs/forge-std@6853b9ec7df5dc0c213b05ae67785ad4f4baa0ea \
15+
github.com/runtimeverification/kontrol-cheatcodes@2c48ae1ab44228c199dca29414c0b4b18a3434e6 \
16+
github.com/ethereum-optimism/lib-keccak@3b1e7bbb4cc23e9228097cfebe42aedaf3b8f2b9 \
17+
github.com/OpenZeppelin/openzeppelin-contracts@ecd2ca2cd7cac116f7a37d0e474bbb3d7d5e1c4d \
18+
github.com/OpenZeppelin/openzeppelin-contracts-upgradeable@0a2cb9a445c365870ed7a8ab461b12acf3e27d63 \
19+
github.com/transmissions11/solmate@8f9b23f8838670afda0fd8983f2c41e8037ae6bc \
20+
github.com/safe-global/safe-contracts@bf943f80fec5ac647159d26161446ac5d716a294 \
21+
github.com/Vectorized/solady@502cc1ea718e6fa73b380635ee0868b0740595f0
22+
forge install --no-git \
23+
github.com/ethereum-optimism/superchain-registry@84bce73573f130008d84bae6e924163bab589a11
24+
@# openzeppelin-contracts-v5 and solady-v0.0.245 use the same orgs as their
25+
@# counterparts but are pinned to different commits, so we clone them manually.
26+
git clone --no-checkout https://github.com/OpenZeppelin/openzeppelin-contracts.git lib/openzeppelin-contracts-v5 && \
27+
cd lib/openzeppelin-contracts-v5 && git checkout dbb6104ce834628e473d2173bbc9d47f81a9eec3
28+
git clone --no-checkout https://github.com/Vectorized/solady.git lib/solady-v0.0.245 && \
29+
cd lib/solady-v0.0.245 && git checkout e0ef35adb0ccd1032794731a995cb599bba7b537
1930

2031
.PHONY: test
2132
test:
@@ -25,22 +36,11 @@ test:
2536
clean-lib:
2637
rm -rf lib
2738

28-
.PHONY: checkout-op-commit
29-
checkout-op-commit:
30-
[ -n "$(OP_COMMIT)" ] || (echo "OP_COMMIT must be set in .env" && exit 1)
31-
rm -rf lib/optimism
32-
mkdir -p lib/optimism
33-
cd lib/optimism; \
34-
git init; \
35-
git remote add origin https://github.com/ethereum-optimism/optimism.git; \
36-
git fetch --depth=1 origin $(OP_COMMIT); \
37-
git reset --hard FETCH_HEAD
38-
3939
.PHONY: bindings
4040
bindings:
4141
go install github.com/ethereum/go-ethereum/cmd/abigen@v1.15.8
4242
forge build
4343
mkdir -p bindings
4444
abigen --abi out/BalanceTracker.sol/BalanceTracker.abi.json --pkg bindings --type BalanceTracker --out bindings/balance_tracker.go
4545
abigen --abi out/FeeDisburser.sol/FeeDisburser.abi.json --pkg bindings --type FeeDisburser --out bindings/fee_disburser.go
46-
cd bindings && go mod tidy
46+
cd bindings && go mod tidy

book/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
book

book/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Optimism
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

book/book.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[book]
2+
authors = ["Optimism Contributors"]
3+
language = "en"
4+
multilingual = false
5+
src = "src"
6+
title = "OP Stack Smart Contracts"
7+
8+
[output.html]
9+
site-url = "/contracts-bedrock/"
10+
git-repository-url = "https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts-bedrock/book"
11+
edit-url-template = "https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts-bedrock/book/{path}"
12+
additional-css = ["custom.css"]
13+
additional-js = ["mermaid.min.js", "mermaid-init.js"]
14+
15+
[preprocessor]
16+
17+
[preprocessor.mermaid]
18+
command = "mdbook-mermaid"

book/custom.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.content main {
2+
max-width: 85%;
3+
margin-left: auto;
4+
margin-right: auto;
5+
}

0 commit comments

Comments
 (0)