github.com/ethereum-optimism/optimism@v1.7.2/packages/contracts-bedrock/invariant-docs/OptimismPortal2.md (about)

     1  # `OptimismPortal2` Invariants
     2  
     3  ## Deposits of any value should always succeed unless `_to` = `address(0)` or `_isCreation` = `true`.
     4  **Test:** [`OptimismPortal2.t.sol#L160`](../test/invariants/OptimismPortal2.t.sol#L160)
     5  
     6  All deposits, barring creation transactions and transactions sent to `address(0)`, should always succeed. 
     7  
     8  ## `finalizeWithdrawalTransaction` should revert if the proof maturity period has not elapsed.
     9  **Test:** [`OptimismPortal2.t.sol#L182`](../test/invariants/OptimismPortal2.t.sol#L182)
    10  
    11  A withdrawal that has been proven should not be able to be finalized until after the proof maturity period has elapsed. 
    12  
    13  ## `finalizeWithdrawalTransaction` should revert if the withdrawal has already been finalized.
    14  **Test:** [`OptimismPortal2.t.sol#L211`](../test/invariants/OptimismPortal2.t.sol#L211)
    15  
    16  Ensures that there is no chain of calls that can be made that allows a withdrawal to be finalized twice. 
    17  
    18  ## A withdrawal should **always** be able to be finalized `PROOF_MATURITY_DELAY_SECONDS` after it was successfully proven, if the game has resolved and passed the air-gap.
    19  **Test:** [`OptimismPortal2.t.sol#L239`](../test/invariants/OptimismPortal2.t.sol#L239)
    20  
    21  This invariant asserts that there is no chain of calls that can be made that will prevent a withdrawal from being finalized exactly `PROOF_MATURITY_DELAY_SECONDS` after it was successfully proven and the game has resolved and passed the air-gap.