Skip to content

Commit

Permalink
maint: add interfaces for legacy contracts (ethereum-optimism#11625)
Browse files Browse the repository at this point in the history
Adds interfaces for the contracts inside of /legacy. Interface is
not included for the LegacyMintableERC20 contract because that
interface has already been defined elsewhere.
  • Loading branch information
smartcontracts authored Sep 4, 2024
1 parent f8b421b commit e0f6e1e
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/contracts-bedrock/scripts/Artifacts.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { StorageSlot } from "scripts/libraries/ForgeArtifacts.sol";
import { EIP1967Helper } from "test/mocks/EIP1967Helper.sol";
import { LibString } from "@solady/utils/LibString.sol";
import { ForgeArtifacts } from "scripts/libraries/ForgeArtifacts.sol";
import { IAddressManager } from "scripts/interfaces/IAddressManager.sol";
import { IAddressManager } from "src/legacy/interfaces/IAddressManager.sol";
import { Process } from "scripts/libraries/Process.sol";

/// @notice Represents a deployment. Is serialized to JSON as a key/value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ EXCLUDE_FILES=(
"ILegacyMintableERC20"
"MintableAndBurnable"
"IDisputeGameFactory"
"IAddressManager"
"IWETH"
"IDelayedWETH"
"IAnchorStateRegistry"
Expand Down
22 changes: 0 additions & 22 deletions packages/contracts-bedrock/scripts/interfaces/IAddressManager.sol

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { IOwnable } from "src/universal/interfaces/IOwnable.sol";

/// @title IAddressManager
/// @notice Interface for the AddressManager contract.
interface IAddressManager is IOwnable {
event AddressSet(string indexed name, address newAddress, address oldAddress);

function getAddress(string memory _name) external view returns (address);
function setAddress(string memory _name, address _address) external;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { ISemver } from "src/universal/ISemver.sol";

/// @title IDeployerWhitelist
/// @notice Interface for the DeployerWhitelist contract.
interface IDeployerWhitelist {
event OwnerChanged(address oldOwner, address newOwner);
event WhitelistDisabled(address oldOwner);
event WhitelistStatusChanged(address deployer, bool whitelisted);

function enableArbitraryContractDeployment() external;
function isDeployerAllowed(address _deployer) external view returns (bool);
function owner() external view returns (address);
function setOwner(address _owner) external;
function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) external;
function version() external view returns (string memory);
function whitelist(address) external view returns (bool);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { ISemver } from "src/universal/ISemver.sol";

/// @title IL1BlockNumber
/// @notice Interface for the L1BlockNumber contract.
interface IL1BlockNumber is ISemver {
fallback() external payable;

receive() external payable;

function getL1BlockNumber() external view returns (uint256);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title IL1ChugSplashProxy
/// @notice Interface for the L1ChugSplashProxy contract.
interface IL1ChugSplashProxy {
fallback() external payable;

receive() external payable;

function getImplementation() external returns (address);
function getOwner() external returns (address);
function setCode(bytes memory _code) external;
function setOwner(address _owner) external;
function setStorage(bytes32 _key, bytes32 _value) external;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { ISemver } from "src/universal/ISemver.sol";

/// @title ILegacyMessagePasser
/// @notice Interface for the LegacyMessagePasser contract.
interface ILegacyMessagePasser is ISemver {
function passMessageToL1(bytes memory _message) external;
function sentMessages(bytes32) external view returns (bool);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title IResolvedDelegateProxy
/// @notice Interface for the ResolvedDelegateProxy contract.
interface IResolvedDelegateProxy {
fallback() external payable;
}
12 changes: 12 additions & 0 deletions packages/contracts-bedrock/src/universal/interfaces/IOwnable.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title IOwnable
/// @notice Interface for Ownable.
interface IOwnable {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

function owner() external view returns (address);
function renounceOwnership() external;
function transferOwnership(address newOwner) external; // nosemgrep: sol-style-input-arg-fmt.
}

0 comments on commit e0f6e1e

Please sign in to comment.