IDistributor Interface#

Defines the standard functions for a distributor contract.

Notice

If you want to use IRepository for versioned distributions, use IVersionDistributor interface.

DistributionNotFound#

Error indicating that the distribution with the specified ID was not found.

error DistributionNotFound(bytes32 id)
Input Type Description
id bytes32 The unique identifier of the distribution that was not found.

DistributionExists#

Error indicating that a distribution with the specified ID already exists.

error DistributionExists(bytes32 id)
Input Type Description
id bytes32 The unique identifier of the distribution that already exists.

InitializerNotFound#

Error indicating that the initializer for the distribution was not found.

error InitializerNotFound(bytes32 id)
Input Type Description
id bytes32 The unique identifier of the distribution that was not found.

InvalidInstance#

Error indicating that the instance is invalid.

error InvalidInstance(address instance)
Input Type Description
instance address The address of the instance that is considered invalid.

Instantiated#

Event emitted when a new distribution is instantiated.

event Instantiated(bytes32 distributionId, uint256 instanceId, bytes argsHash, address[] instances)
Input Type Description
distributionId bytes32 The unique identifier of the distribution.
instanceId uint256 The unique identifier of the instance.
argsHash bytes The hash of the arguments used to instantiate the distribution.
instances address[] The addresses of the instances that were created.

Notice

It MUST emit when IDistributor#instantiate is called.

DistributionRemoved#

Event emitted when a distribution is removed.

event DistributionRemoved(bytes32 id)
Input Type Description
id bytes32 The unique identifier of the distribution that was removed.

Notice

It MUST emit when IDistributor#removedistribution is called.

DistributionAdded#

Event emitted when a distribution is added.

event DistributionAdded(bytes32 id, address initializer)
Input Type Description
id bytes32 The unique identifier of the distribution that was added.
initializer address The address of the initializer that was added.

Notice

It MUST emit when IDistributor#adddistribution is called.

getDistributions#

Retrieves the unique identifiers of all distributions.

function getDistributions() external view returns (bytes32[] distributorIds)
Output Type Description
distributorIds bytes32[] An array of unique identifiers of all distributions.

getDistributionURI#

Retrieves the URI of the distribution.

function getDistributionURI(bytes32 distributorId) external view returns (string)
Input Type Description
distributorId bytes32 The unique identifier of the distribution.
Output
0 string uri The URI of the distribution.

instantiate#

Instantiates a new instance with the given distributor ID and arguments.

function instantiate(bytes32 distributorId, bytes args) external returns (address[], bytes32 distributionName, uint256 distributionVersion)
Input Type Description
distributorId bytes32 The unique identifier of the distributor.
args bytes The arguments to be used for instantiation.
Output
0 address[] instances The addresses of the instances that were created.
distributionName bytes32 The name of the distribution.
distributionVersion uint256 The version of the distribution.

Notice

It MUST emit Instantiated event.

addDistribution#

function addDistribution(bytes32 distributorId, address initializer) external

removeDistribution#

function removeDistribution(bytes32 distributorId) external

getDistributionId#

function getDistributionId(address instance) external view returns (bytes32)

getInstanceId#

function getInstanceId(address instance) external view returns (uint256)