Skip to main content

IContractPublisher

Methods

getAllPublishedContracts

function getAllPublishedContracts(address publisher) external view returns (struct IContractPublisher.CustomContractInstance[] published)

Returns the latest version of all contracts published by a publisher.

Parameters

NameTypeDescription
publisheraddressThe address of the publisher.

Returns

NameTypeDescription
publishedIContractPublisher.CustomContractInstance[]An array of all contracts published by the publisher.

getPublishedContract

function getPublishedContract(address publisher, string contractId) external view returns (struct IContractPublisher.CustomContractInstance published)

Returns the latest version of a contract published by a publisher.

Parameters

NameTypeDescription
publisheraddressThe address of the publisher.
contractIdstringThe identifier for a published contract (that can have multiple verisons).

Returns

NameTypeDescription
publishedIContractPublisher.CustomContractInstanceThe desired contract published by the publisher.

getPublishedContractVersions

function getPublishedContractVersions(address publisher, string contractId) external view returns (struct IContractPublisher.CustomContractInstance[] published)

Returns all versions of a published contract.

Parameters

NameTypeDescription
publisheraddressThe address of the publisher.
contractIdstringThe identifier for a published contract (that can have multiple verisons).

Returns

NameTypeDescription
publishedIContractPublisher.CustomContractInstance[]The desired contracts published by the publisher.

getPublishedUriFromCompilerUri

function getPublishedUriFromCompilerUri(string compilerMetadataUri) external view returns (string[] publishedMetadataUris)

Retrieve the published metadata URI from a compiler metadata URI.

Parameters

NameTypeDescription
compilerMetadataUristringundefined

Returns

NameTypeDescription
publishedMetadataUrisstring[]undefined

getPublisherProfileUri

function getPublisherProfileUri(address publisher) external view returns (string uri)

Get the publisher profile uri for a given publisher.

Parameters

NameTypeDescription
publisheraddressundefined

Returns

NameTypeDescription
uristringundefined

publishContract

function publishContract(address publisher, string contractId, string publishMetadataUri, string compilerMetadataUri, bytes32 bytecodeHash, address implementation) external nonpayable

Let's an account publish a contract.

Parameters

NameTypeDescription
publisheraddressThe address of the publisher.
contractIdstringThe identifier for a published contract (that can have multiple verisons).
publishMetadataUristringThe IPFS URI of the publish metadata.
compilerMetadataUristringThe IPFS URI of the compiler metadata.
bytecodeHashbytes32The keccak256 hash of the contract bytecode.
implementationaddress(Optional) An implementation address that proxy contracts / clones can point to. Default value if such an implementation does not exist - address(0);

setPublisherProfileUri

function setPublisherProfileUri(address publisher, string uri) external nonpayable

Lets an account set its publisher profile uri

Parameters

NameTypeDescription
publisheraddressundefined
uristringundefined

unpublishContract

function unpublishContract(address publisher, string contractId) external nonpayable

Lets a publisher unpublish a contract and all its versions.

Parameters

NameTypeDescription
publisheraddressThe address of the publisher.
contractIdstringThe identifier for a published contract (that can have multiple verisons).

Events

ContractPublished

event ContractPublished(address indexed operator, address indexed publisher, IContractPublisher.CustomContractInstance publishedContract)

Emitted when a contract is published.

Parameters

NameTypeDescription
operator indexedaddressundefined
publisher indexedaddressundefined
publishedContractIContractPublisher.CustomContractInstanceundefined

ContractUnpublished

event ContractUnpublished(address indexed operator, address indexed publisher, string indexed contractId)

Emitted when a contract is unpublished.

Parameters

NameTypeDescription
operator indexedaddressundefined
publisher indexedaddressundefined
contractId indexedstringundefined

Paused

event Paused(bool isPaused)

Emitted when the registry is paused.

Parameters

NameTypeDescription
isPausedboolundefined

PublisherProfileUpdated

event PublisherProfileUpdated(address indexed publisher, string prevURI, string newURI)

Emitted when a publisher updates their profile URI.

Parameters

NameTypeDescription
publisher indexedaddressundefined
prevURIstringundefined
newURIstringundefined