ProxyAdmin
Table of Contents
Overview
Manages administrative operations for multiple proxy types, including ERC1967 Proxies, legacy ChugSplash Proxies, and ResolvedDelegate Proxies.
Definitions
ERC1967 Proxy
Standard transparent proxy following EIP-1967 specification with separate admin and implementation storage slots.
ChugSplash Proxy
Legacy proxy type used in earlier Optimism deployments with custom storage layout and upgrade mechanisms.
ResolvedDelegate Proxy
Legacy proxy type that resolves implementation addresses through an AddressManager contract using string-based name lookups.
Assumptions
N/A
Invariants
i01-001: Owner-Only Administrative Control
Only the contract owner can execute administrative operations including proxy upgrades, admin changes, proxy type configuration, and AddressManager modifications.
Impact
Severity: Critical
Violation would allow unauthorized parties to upgrade proxy implementations or change proxy administrators, enabling complete takeover of managed contracts and potential theft of all assets controlled by those proxies.
i01-002: Multi-Proxy Type Administration
The contract can successfully administrate all three proxy types (ERC1967, ChugSplash, and ResolvedDelegate) through their respective type-specific interfaces and storage layouts.
Impact
Severity: High
Failure to support any proxy type would prevent administration of legacy proxies during migrations, potentially leaving critical infrastructure without upgrade capabilities or administrative control.
Function Specification
constructor
Initializes the ProxyAdmin with an owner address.
Parameters:
_owner: Address that will have administrative control over the ProxyAdmin
Behavior:
- MUST transfer ownership to
_owner
setProxyType
Configures the proxy type for a given proxy address.
Parameters:
_address: Address of the proxy to configure_type: ProxyType enum value (ERC1967, CHUGSPLASH, or RESOLVED)
Behavior:
- MUST revert if caller is not the owner
- MUST store the proxy type in the
proxyTypemapping
setImplementationName
Sets the implementation name for a ResolvedDelegate Proxy.
Parameters:
_address: Address of the ResolvedDelegate proxy_name: String identifier used to resolve the implementation address via AddressManager
Behavior:
- MUST revert if caller is not the owner
- MUST store the implementation name in the
implementationNamemapping
setAddressManager
Configures the AddressManager contract used for ResolvedDelegate Proxy resolution.
Parameters:
_address: Address of the AddressManager contract
Behavior:
- MUST revert if caller is not the owner
- MUST store the AddressManager address
setAddress
Sets an address in the AddressManager contract.
Parameters:
_name: String identifier for the address_address: Address to associate with the name
Behavior:
- MUST revert if caller is not the owner
- MUST call
setAddresson the AddressManager contract
setUpgrading
Controls the upgrading status flag for ChugSplash Proxies.
Parameters:
_upgrading: Boolean indicating whether an upgrade is in progress
Behavior:
- MUST revert if caller is not the owner
- MUST set the internal
upgradingstate variable
isUpgrading
Returns the current upgrading status.
Behavior:
- MUST return the value of the
upgradingstate variable
getProxyImplementation
Retrieves the implementation address for a given proxy.
Parameters:
_proxy: Address of the proxy
Behavior:
- MUST return the implementation address by calling the appropriate interface method based on the proxy's configured type
- For ERC1967 proxies: MUST call
implementation()on the proxy - For CHUGSPLASH proxies: MUST call
getImplementation()on the proxy - For RESOLVED proxies: MUST query AddressManager using the stored implementation name
- MUST revert if the proxy type is not configured
getProxyAdmin
Retrieves the admin address for a given proxy.
Parameters:
_proxy: Address of the proxy
Behavior:
- MUST return the admin address by calling the appropriate interface method based on the proxy's configured type
- For ERC1967 proxies: MUST call
admin()on the proxy - For CHUGSPLASH proxies: MUST call
getOwner()on the proxy - For RESOLVED proxies: MUST return the owner of the AddressManager
- MUST revert if the proxy type is not configured
changeProxyAdmin
Updates the admin address for a given proxy.
Parameters:
_proxy: Address of the proxy to update_newAdmin: Address of the new admin
Behavior:
- MUST revert if caller is not the owner
- For ERC1967 proxies: MUST call
changeAdmin(_newAdmin)on the proxy - For CHUGSPLASH proxies: MUST call
setOwner(_newAdmin)on the proxy - For RESOLVED proxies: MUST call
transferOwnership(_newAdmin)on the AddressManager - MUST revert if the proxy type is not configured
upgrade
Changes a proxy's implementation contract.
Parameters:
_proxy: Address of the proxy to upgrade_implementation: Address of the new implementation
Behavior:
- MUST revert if caller is not the owner
- For ERC1967 proxies: MUST call
upgradeTo(_implementation)on the proxy - For CHUGSPLASH proxies: MUST write
_implementationto the PROXY_IMPLEMENTATION_ADDRESS storage slot - For RESOLVED proxies: MUST call
setAddresson AddressManager with the stored implementation name and new implementation address - MUST revert via assertion if proxy type is not one of the three defined types
upgradeAndCall
Changes a proxy's implementation and executes an initialization call.
Parameters:
_proxy: Address of the proxy to upgrade_implementation: Address of the new implementation_data: Calldata to execute on the proxy after upgrade
Behavior:
- MUST revert if caller is not the owner
- For ERC1967 proxies: MUST call
upgradeToAndCall(_implementation, _data)with forwarded msg.value - For CHUGSPLASH and RESOLVED proxies: MUST call
upgrade(_proxy, _implementation)then execute a call to_proxywith_dataand forwarded msg.value - MUST revert if the post-upgrade call fails
- MUST revert if the proxy type is not configured