DeployerWhitelist
Table of Contents
Overview
DeployerWhitelist is a legacy predeploy contract that was originally used to restrict contract deployment to whitelisted addresses during the initial phases of Optimism. The contract has been deprecated since the Bedrock upgrade and is no longer used by the Optimism system. It is maintained in state only for backwards compatibility.
Definitions
Whitelist Disabled State
The state where the whitelist is permanently disabled, indicated by the owner being set to address(0). In this
state, all addresses are allowed to deploy contracts according to the contract's logic, and the whitelist cannot be
re-enabled.
Assumptions
N/A
Invariants
i01-001: Whitelist Irreversibility
Once the whitelist enters the Whitelist Disabled State (owner is address(0)), it
cannot be re-enabled. The owner cannot be changed from address(0) to any other address.
Impact
Severity: Low
If this invariant were violated, a previously disabled whitelist could be re-enabled, potentially restricting contract deployment after it had been made permissionless. However, since this contract is deprecated and no longer used by the Optimism system, the practical impact is minimal.
Function Specification
setWhitelistedDeployer
Updates the whitelist status of a deployer address.
Parameters:
_deployer: The address whose whitelist status is being updated_isWhitelisted: Boolean indicating whether the address should be whitelisted
Behavior:
- MUST revert if caller is not the owner
- MUST set
whitelist[_deployer]to_isWhitelisted - MUST emit
WhitelistStatusChangedevent with_deployerand_isWhitelisted
setOwner
Transfers ownership of the contract to a new address.
Parameters:
_owner: The address of the new owner
Behavior:
- MUST revert if caller is not the current owner
- MUST revert if
_ownerisaddress(0) - MUST emit
OwnerChangedevent with the old owner and new owner addresses - MUST set
ownerto_owner
enableArbitraryContractDeployment
Permanently disables the whitelist by setting the owner to address(0), entering the
Whitelist Disabled State.
Behavior:
- MUST revert if caller is not the owner
- MUST emit
WhitelistDisabledevent with the current owner address - MUST set
ownertoaddress(0)
isDeployerAllowed
Checks whether an address is allowed to deploy contracts according to the whitelist logic.
Parameters:
_deployer: The address to check
Returns:
bool:trueif the whitelist is in Whitelist Disabled State OR if_deployeris whitelisted;falseotherwise