Skip to main content

VaultFactory

Git Source

Methods

blacklist

function blacklist(uint64 version) external nonpayable

Blacklist a version of entities.

The given version will still be deployable.

Parameters

NameTypeDescription
versionuint64version to blacklist

blacklisted

function blacklisted(uint64 version) external view returns (bool value)

Get if a version is blacklisted (e.g., in case of invalid implementation).

The given version is still deployable.

Parameters

NameTypeDescription
versionuint64version to check

Returns

NameTypeDescription
boolwhether the version is blacklisted

create

function create(uint64 version, address owner, bytes data) external nonpayable returns (address entity)

Create a new entity at the factory.

CREATE2 salt is constructed from the given parameters.

Parameters

NameTypeDescription
versionuint64entity's version to use
owneraddressinitial owner of the entity
databytesinitial data for the entity creation

Returns

NameTypeDescription
entityaddressaddress of the entity

entity

function entity(uint256 index) external view returns (address)

Get an entity given its index.

Parameters

NameTypeDescription
indexuint256index of the entity to get

Returns

NameTypeDescription
addressaddress of the entity

implementation

function implementation(uint64 version) external view returns (address)

Get the implementation for a given version.

Reverts when an invalid version.

Parameters

NameTypeDescription
versionuint64version to get the implementation for

Returns

NameTypeDescription
addressaddress of the implementation

isEntity

function isEntity(address entity) external view returns (bool)

Get if a given address is an entity.

Parameters

NameTypeDescription
entityaddressaddress to check

Returns

NameTypeDescription
boolif the given address is an entity

lastVersion

function lastVersion() external view returns (uint64)

Get the last available version.

If zero, no implementations are whitelisted.

Returns

NameTypeDescription
uint64version of the last implementation

migrate

function migrate(address entity, uint64 newVersion, bytes data) external nonpayable

Migrate a given entity to a given newer version.

Only the entity's owner can call this function.

Parameters

NameTypeDescription
entityaddressaddress of the entity to migrate
newVersionuint64new version to migrate to
databytessome data to reinitialize the contract with

owner

function owner() external view returns (address)

Returns the address of the current owner.

Returns

NameTypeDescription
address

renounceOwnership

function renounceOwnership() external nonpayable

Leaves the contract without owner. It will not be possible to call onlyOwner functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.

totalEntities

function totalEntities() external view returns (uint256)

Get a total number of entities.

Returns

NameTypeDescription
uint256total number of entities added

transferOwnership

function transferOwnership(address newOwner) external nonpayable

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

Parameters

NameTypeDescription
newOwneraddress

whitelist

function whitelist(address implementation) external nonpayable

Whitelist a new implementation for entities.

Parameters

NameTypeDescription
implementationaddressaddress of the new implementation

Events

AddEntity

event AddEntity(address indexed entity)

Emitted when an entity is added.

Parameters

NameTypeDescription
entity indexedaddressaddress of the added entity

Blacklist

event Blacklist(uint64 indexed version)

Emitted when a version is blacklisted (e.g., in case of invalid implementation).

The given version is still deployable.

Parameters

NameTypeDescription
version indexeduint64version that was blacklisted

Migrate

event Migrate(address indexed entity, uint64 newVersion)

Emitted when an entity is migrated to a new version.

Parameters

NameTypeDescription
entity indexedaddressaddress of the entity
newVersionuint64new version of the entity

OwnershipTransferred

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

NameTypeDescription
previousOwner indexedaddress
newOwner indexedaddress

Whitelist

event Whitelist(address indexed implementation)

Emitted when a new implementation is whitelisted.

Parameters

NameTypeDescription
implementation indexedaddressaddress of the new implementation