ImplementationDirectory
contract ImplementationDirectory
is ImplementationProvider, ZOSLibOwnable
Implementation provider that stores contract implementations in a mapping.
Index
Reference
Events
Frozen
event Frozen()
Emitted when the implementation directory is frozen.
ImplementationChanged
event ImplementationChanged(string contractName, address implementation)
Emitted when the implementation of a contract is changed.
- Parameters:
contractName
- Name of the contract.implementation
- Address of the added implementation.
Modifiers
whenNotFrozen
modifier whenNotFrozen()
Modifier that allows functions to be called only before the contract is frozen.
Functions
freeze
function freeze() public
Makes the directory irreversibly immutable. It can only be called once, by the owner.
- Modifiers:
- onlyOwner whenNotFrozen
getImplementation
function getImplementation(string contractName) public view returns (address)
Returns the implementation address of a contract.
- Parameters:
contractName
- Name of the contract.- Returns:
- Address of the implementation.
setImplementation
function setImplementation(string contractName, address implementation) public
Sets the address of the implementation of a contract in the directory.
- Modifiers:
- onlyOwner whenNotFrozen
- Parameters:
contractName
- Name of the contract.implementation
- Address of the implementation.
unsetImplementation
function unsetImplementation(string contractName) public
Removes the address of a contract implementation from the directory.
- Modifiers:
- onlyOwner whenNotFrozen
- Parameters:
contractName
- Name of the contract.