Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2.7 KiB
Initializable
Initializable mixin for the upgradeable contracts.
Custom Errors
InvalidInitialization()
error InvalidInitialization()
The contract is already initialized.
NotInitializing()
error NotInitializing()
The contract is not initializing.
Events
Initialized(uint64)
event Initialized(uint64 version)
Triggered when the contract has been initialized.
Operations
_initializableSlot()
function _initializableSlot() internal pure virtual returns (bytes32)
Override to return a non-zero custom storage slot if required.
initializer()
modifier initializer() virtual
Guards an initializer function so that it can be invoked at most once.
You can guard a function with onlyInitializing such that it can be called
through a function guarded with initializer.
This is similar to reinitializer(1), except that in the context of a constructor,
an initializer guarded function can be invoked multiple times.
This can be useful during testing and is not expected to be used in production.
Emits an Initialized event.
reinitializer(uint64)
modifier reinitializer(uint64 version) virtual
Guards a reinitializer function so that it can be invoked at most once.
You can guard a function with onlyInitializing such that it can be called
through a function guarded with reinitializer.
Emits an Initialized event.
onlyInitializing()
modifier onlyInitializing() virtual
Guards a function such that it can only be called in the scope
of a function guarded with initializer or reinitializer.
_checkInitializing()
function _checkInitializing() internal view virtual
Reverts if the contract is not initializing.
_disableInitializers()
function _disableInitializers() internal virtual
Locks any future initializations by setting the initialized version to 2**64 - 1.
Calling this in the constructor will prevent the contract from being initialized
or reinitialized. It is recommended to use this to lock implementation contracts
that are designed to be called through proxies.
Emits an Initialized event the first time it is successfully called.
_getInitializedVersion()
function _getInitializedVersion()
internal
view
virtual
returns (uint64 version)
Returns the highest version that has been initialized.
_isInitializing()
function _isInitializing() internal view virtual returns (bool result)
Returns whether the contract is currently initializing.