Skip to main content

VersionedImplementationRepository

VersionedImplementationRepository

_byVersion

mapping(bytes => address) _byVersion

abi encoded version -> implementation address we use bytes here so only a single storage slot is used

getByVersion

function getByVersion(uint8[3] version) external view returns (address)

get an implementation by a version tag

Parameters

NameTypeDescription
versionuint8[3][major, minor, patch] version tag

Return Values

NameTypeDescription
[0]addressimplementation associated with the given version tag

hasVersion

function hasVersion(uint8[3] version) external view returns (bool)

check if a version exists

Parameters

NameTypeDescription
versionuint8[3][major, minor, patch] version tag

Return Values

NameTypeDescription
[0]booltrue if the version is registered

_append

function _append(address implementation, uint256 lineageId) internal

Set an implementation to the current implementation

Parameters

NameTypeDescription
implementationaddressimplementation to set as current implementation
lineageIduint256id of lineage to append to

_createLineage

function _createLineage(address implementation) internal returns (uint256)

_remove

function _remove(address toRemove, address previous) internal

_insertVersion

function _insertVersion(uint8[3] version, address impl) internal

_removeVersion

function _removeVersion(uint8[3] version) internal

_hasVersion

function _hasVersion(uint8[3] version) internal view returns (bool)

VersionAdded

event VersionAdded(uint8[3] version, address impl)

VersionRemoved

event VersionRemoved(uint8[3] version, address impl)