• Mark Tyneway's avatar
    contracts-bedrock: CrossDomainOwnable · 85232179
    Mark Tyneway authored
    Adds 2 new contracts to the `L2` directory. Both contracts
    extend OZ `Ownable` such that the `onlyOwner` modifer logic is
    overwritten.
    
    `CrossDomainOwnable` is designed for ownership of contracts on L2
    when the communication goes directly through the `OptimismPortal`.
    This is not safe for when the communication goes through the
    `CrossDomainMessenger` system, as `msg.sender` would be the
    address of the `L2CrossDomainMessenger` and if that is the owner
    of the L2 contract then anybody going through the messenger system
    would have owner permissions on the contract.
    
    `CrossDomainOwnable2` is designed for ownership of contracts on L2
    when the communication goes through the messenger system. It checks
    for the L1 message sender value that is set in the
    `L2CrossDomainMessenger` contract.
    
    Both of these contracts include test coverage and are relatively simple.
    
    contracts-bedrock: review fixes
    
    contracts-bedrock: make the messenger value constant
    
    contracts: fix
    
    contracts-bedrock: update snapshot
    
    lint
    
    fix test
    85232179
CrossDomainOwnable.sol 1010 Bytes