Skip to main content

MockContractPublisher

Methods​

getAllPublishedContracts​

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

Parameters​

NameTypeDescription
_0addressundefined

Returns​

NameTypeDescription
publishedIContractPublisher.CustomContractInstance[]undefined

getPublishedContract​

function getPublishedContract(address, string) external pure returns (struct IContractPublisher.CustomContractInstance published)

Parameters​

NameTypeDescription
_0addressundefined
_1stringundefined

Returns​

NameTypeDescription
publishedIContractPublisher.CustomContractInstanceundefined

getPublishedContractVersions​

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

Parameters​

NameTypeDescription
_0addressundefined
_1stringundefined

Returns​

NameTypeDescription
publishedIContractPublisher.CustomContractInstance[]undefined

getPublishedUriFromCompilerUri​

function getPublishedUriFromCompilerUri(string) external pure returns (string[] publishedMetadataUris)

Parameters​

NameTypeDescription
_0stringundefined

Returns​

NameTypeDescription
publishedMetadataUrisstring[]undefined

getPublisherProfileUri​

function getPublisherProfileUri(address) external pure returns (string uri)

Parameters​

NameTypeDescription
_0addressundefined

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 versions).
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, string) external nonpayable

Parameters​

NameTypeDescription
_0addressundefined
_1stringundefined

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 versions).

Events​

ContractPublished​

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

Parameters​

NameTypeDescription
operator indexedaddressundefined
publisher indexedaddressundefined
publishedContractIContractPublisher.CustomContractInstanceundefined

ContractUnpublished​

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

Parameters​

NameTypeDescription
operator indexedaddressundefined
publisher indexedaddressundefined
contractId indexedstringundefined

Paused​

event Paused(bool isPaused)

Parameters​

NameTypeDescription
isPausedboolundefined

PublisherProfileUpdated​

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

Parameters​

NameTypeDescription
publisher indexedaddressundefined
prevURIstringundefined
newURIstringundefined