• Mark Tyneway's avatar
    contracts-bedrock: L2 contracts reinit · 6730a05c
    Mark Tyneway authored
    Ensures that the L2 contracts cannot be reinitialized by
    making their storage value for `_initialze` match the value
    that is hardcoded in the contract. Since the call to `initialize()`
    never actually runs in the L2 genesis generation, we only have
    contract over setting state. Trying to call `reinitialize` again
    with the same value will cause it to revert.
    
    Also remove the unnecessary argument to the `L2ERC721Bridge`. This
    was noticed by trail of bits during the audit. It adds extra assurance
    that the `initialize` functions take no arguments on L2, meaning that
    even if they could be reinitialized, nothing horrible could happen.
    Note that this is very application specific and would result in nothing
    horrible happening based on how the optimism contracts are designed.
    We should stil not allow for contracts to be reinitialized.
    
    In the far future, we will move towards removing the concept of
    `initialize` completely by breaking storage layout migrations
    into their own upgrade step.
    6730a05c
l2standardbridge_more.go 23.9 KB