Skip to main content

SlasherFactory

Git Source

Methods

blacklist

function blacklist(uint64 type_) external nonpayable

Blacklist a type of entity.

The given type will still be deployable.

Parameters

NameTypeDescription
type_uint64type to blacklist

blacklisted

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

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

The given type is still deployable.

Parameters

NameTypeDescription
type_uint64type to check

Returns

NameTypeDescription
boolwhether the type is blacklisted

create

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

Create a new entity at the factory.

CREATE2 salt is constructed from the given parameters.

Parameters

NameTypeDescription
type_uint64type's implementation to use
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 type_) external view returns (address)

Get the implementation for a given type.

Parameters

NameTypeDescription
type_uint64position to get the implementation at

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

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

totalTypes

function totalTypes() external view returns (uint64)

Get the total number of whitelisted types.

Returns

NameTypeDescription
uint64total number of types

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 type of entity.

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 type_)

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

The given type is still deployable.

Parameters

NameTypeDescription
type_ indexeduint64type that was blacklisted

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 type is whitelisted.

Parameters

NameTypeDescription
implementation indexedaddressaddress of the new implementation