Skip to content

Commit

Permalink
maint: add interfaces for legacy contracts
Browse files Browse the repository at this point in the history
Adds interfaces for the contracts inside of /legacy. Interfaces
are not included for ResolvedDelegateProxy (does not have external
functions) or for LegacyMintableERC20 (interface already exists
inside of another file).
  • Loading branch information
smartcontracts committed Aug 28, 2024
1 parent ebdae42 commit 1c3f455
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title IAddressManager
/// @notice Interface for AddressManager.
interface IAddressManager {
/// @notice Emitted when an address is modified in the registry.
/// @param name String name being set in the registry.
/// @param newAddress Address set for the given name.
/// @param oldAddress Address that was previously set for the given name.
event AddressSet(string indexed name, address newAddress, address oldAddress);

/// @notice Changes the address associated with a particular name.
/// @param _name String name to associate an address with.
/// @param _address Address to associate with the name.
function setAddress(string memory _name, address _address) external;

/// @notice Retrieves the address associated with a given name.
/// @param _name Name to retrieve an address for.
/// @return Address associated with the given name.
function getAddress(string memory _name) external view returns (address);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// 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 is ISemver {
/// @notice Emitted when the owner of this contract changes.
/// @param oldOwner Address of the previous owner.
/// @param newOwner Address of the new owner.
event OwnerChanged(address oldOwner, address newOwner);

/// @notice Emitted when the whitelist status of a deployer changes.
/// @param deployer Address of the deployer.
/// @param whitelisted Boolean indicating whether the deployer is whitelisted.
event WhitelistStatusChanged(address deployer, bool whitelisted);

/// @notice Emitted when the whitelist is disabled.
/// @param oldOwner Address of the final owner of the whitelist.
event WhitelistDisabled(address oldOwner);

/// @notice Address of the owner of this contract. Note that when this address is set to
/// address(0), the whitelist is disabled.
function owner() external view returns (address);

/// @notice Mapping of deployer addresses to boolean whitelist status.
function whitelist(address _deployer) external view returns (bool);

/// @notice Adds or removes an address from the deployment whitelist.
/// @param _deployer Address to update permissions for.
/// @param _isWhitelisted Whether or not the address is whitelisted.
function setWhitelistedDeployer(address _deployer, bool _isWhitelisted) external;

/// @notice Updates the owner of this contract.
/// @param _owner Address of the new owner.
function setOwner(address _owner) external;

/// @notice Permanently enables arbitrary contract deployment and deletes the owner.
function enableArbitraryContractDeployment() external;

/// @notice Checks whether an address is allowed to deploy contracts.
/// @param _deployer Address to check.
/// @return Whether or not the address can deploy contracts.
function isDeployerAllowed(address _deployer) external view returns (bool);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// 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 {
/// @notice Retrieves the latest L1 block number.
/// @return Latest L1 block number.
function getL1BlockNumber() external view returns (uint256);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title IL1ChugSplashProxy
/// @notice Interface for the L1ChugSplashProxy contract.
interface IL1ChugSplashProxy {
/// @notice Sets the code that should be running behind this proxy.
/// @param _code New contract code to run inside this contract.
function setCode(bytes memory _code) external;

/// @notice Modifies some storage slot within the proxy contract. Gives us a lot of power to
/// perform upgrades in a more transparent way. Only callable by the owner.
/// @param _key Storage key to modify.
/// @param _value New value for the storage key.
function setStorage(bytes32 _key, bytes32 _value) external;

/// @notice Changes the owner of the proxy contract. Only callable by the owner.
/// @param _owner New owner of the proxy contract.
function setOwner(address _owner) external;

/// @notice Queries the owner of the proxy contract. Can only be called by the owner OR by
/// making an eth_call and setting the "from" address to address(0).
/// @return Owner address.
function getOwner() external returns (address);

/// @notice Queries the implementation address. Can only be called by the owner OR by making an
/// eth_call and setting the "from" address to address(0).
/// @return Implementation address.
function getImplementation() external returns (address);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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 {
/// @notice Mapping of sent message hashes to boolean status.
function sentMessages(bytes32 _messageHash) external view returns (bool);

/// @notice Passes a message to L1.
/// @param _message Message to pass to L1.
function passMessageToL1(bytes memory _message) external;
}

0 comments on commit 1c3f455

Please sign in to comment.