Initializable
Author: mortimr @ Kiln
This contracts helps upgradeable contracts handle an internal version value to prevent initializer replays.
Unstructured Storage Friendly
State Variables
$version
The version number in storage.
Slot: keccak256(bytes("initializable.version"))) - 1
types.Uint256 internal constant $version =
types.Uint256.wrap(0xc4c7f1ccb588f39a9aa57be6cfd798d73912e27b44cfa18e1a5eba7b34e81a76);
Functions
init
The modifier to use on initializers.
Do not provide _version dynamically, make sure the value is hard-coded each time the modifier is used.
modifier init(uint256 _version);
Parameters
| Name | Type | Description |
|---|---|---|
_version | uint256 | The version to initialize |
Events
Initialized
The version has been initialized.
event Initialized(uint256 version, bytes cdata);
Errors
AlreadyInitialized
The init modifier has already been called on the given version number.
error AlreadyInitialized(uint256 version, uint256 currentVersion);