diff --git a/packages/contracts-bedrock/foundry.toml b/packages/contracts-bedrock/foundry.toml index 9ae2d8a84845..90d897b87c85 100644 --- a/packages/contracts-bedrock/foundry.toml +++ b/packages/contracts-bedrock/foundry.toml @@ -65,10 +65,10 @@ bracket_spacing=true wrap_comments=true [invariant] -runs=1000 -depth=500 +runs=100000 +depth=4 fail_on_revert=false -shrink_run_limit=5000 +shrink_run_limit=500000 ################################################################ # PROFILE: CI # diff --git a/packages/contracts-bedrock/test/invariants/OptimismSuperchainERC20.t.sol b/packages/contracts-bedrock/test/invariants/OptimismSuperchainERC20.t.sol index ebcbb8de24d7..b789c185778f 100644 --- a/packages/contracts-bedrock/test/invariants/OptimismSuperchainERC20.t.sol +++ b/packages/contracts-bedrock/test/invariants/OptimismSuperchainERC20.t.sol @@ -11,7 +11,7 @@ import { EIP1967Helper } from "test/mocks/EIP1967Helper.sol"; import { Predeploys } from "src/libraries/Predeploys.sol"; import { OptimismSuperchainERC20 } from "src/L2/OptimismSuperchainERC20.sol"; import { IL2ToL2CrossDomainMessenger } from "src/L2/IL2ToL2CrossDomainMessenger.sol"; -import { ProtocolProperties } from "../properties/medusa/Protocol.properties.t.sol"; +import { ProtocolProperties } from "../properties/medusa/Protocol.t.sol"; import { MockL2ToL2CrossDomainMessenger } from "../properties/helpers/MockL2ToL2CrossDomainMessenger.t.sol"; contract MedusaAdaptooor is Test { @@ -42,10 +42,10 @@ contract MedusaAdaptooor is Test { totalSupply += OptimismSuperchainERC20(supertoken).totalSupply(); } } - console.log('trackedSupply :', trackedSupply); - console.log('totalSupply :', totalSupply); + console.log('trackedSupply :', trackedSupply); + console.log('totalSupply :', totalSupply); console.log('fundsInTransit :', fundsInTransit); - assert(trackedSupply == totalSupply + fundsInTransit); + assertEq(trackedSupply, totalSupply + fundsInTransit); } } @@ -75,6 +75,10 @@ contract MedusaAdaptooor is Test { assertEq(trackedSupply, totalSupply); } } + + function invariant_handlerAssertions() external { + assertFalse(properties.failed()); + } } /// @title OptimismSuperchainERC20_User diff --git a/packages/contracts-bedrock/test/properties/helpers/HalmosBase.sol b/packages/contracts-bedrock/test/properties/helpers/HalmosBase.sol index 28b1d301147c..75bfe2f7c9e1 100644 --- a/packages/contracts-bedrock/test/properties/helpers/HalmosBase.sol +++ b/packages/contracts-bedrock/test/properties/helpers/HalmosBase.sol @@ -5,7 +5,7 @@ import { Test } from "forge-std/Test.sol"; contract HalmosBase is Test { uint256 internal constant CURRENT_CHAIN_ID = 1; - uint256 internal constant ZERO_AMOUNT; + uint256 internal constant ZERO_AMOUNT = 0; address internal remoteToken = address(bytes20(keccak256("remoteToken"))); string internal name = "SuperchainERC20";