NEW

Chainlink Data Streams have officially launched on mainnet. Sign up for early access.

Back

Operator Factory

The factory design pattern is a well know programming pattern: Rather than compiling and creating instances of a contract yourself, the factory does it for you. As explained in the operator guide, the OperatorFactory contract comes with these benefits:

API Reference

Methods

typeAndVersion

function typeAndVersion() external pure virtual returns (string)

The type and version of this contract.

Return values
NameTypeDescription
stringType and version string

deployNewOperator

function deployNewOperator() external returns (address)

Creates a new operator contract with the msg.sender as owner. Emits OperatorCreated event.

deployNewOperatorAndForwarder

function deployNewOperatorAndForwarder() external returns (address, address)

Creates a new operator contract with the msg.sender as the owner and a new forwarder with the operator as the owner. Emits:

deployNewForwarder

function deployNewForwarder() external returns (address)

Creates a new forwarder contract with the msg.sender as owner. Emits AuthorizedForwarderCreated event.

deployNewForwarderAndTransferOwnership

function deployNewForwarderAndTransferOwnership(address to, bytes message) external returns (address)

Creates a new forwarder contract with the msg.sender as owner. Emits AuthorizedForwarderCreated event.

created

function created(address query) external view returns (bool)

Indicates whether this factory deployed an address.

Events

OperatorCreated

event OperatorCreated(address operator, address owner, address sender)

AuthorizedForwarderCreated

event AuthorizedForwarderCreated(address forwarder, address owner, address sender)

Stay updated on the latest Chainlink news