Skip to main content

ContractPublisher

Methods

DEFAULT_ADMIN_ROLE

function DEFAULT_ADMIN_ROLE() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32undefined

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
_publisheraddressundefined

Returns

NameTypeDescription
publishedIContractPublisher.CustomContractInstance[]undefined

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
_publisheraddressundefined
_contractIdstringundefined

Returns

NameTypeDescription
publishedIContractPublisher.CustomContractInstanceundefined

getPublishedContractVersions

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

Returns all versions of a published contract.

Parameters

NameTypeDescription
_publisheraddressundefined
_contractIdstringundefined

Returns

NameTypeDescription
publishedIContractPublisher.CustomContractInstance[]undefined

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

getRoleAdmin

function getRoleAdmin(bytes32 role) external view returns (bytes32)

Returns the admin role that controls role. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.

Parameters

NameTypeDescription
rolebytes32undefined

Returns

NameTypeDescription
_0bytes32undefined

getRoleMember

function getRoleMember(bytes32 role, uint256 index) external view returns (address)

Returns one of the accounts that have role. index must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296 for more information.

Parameters

NameTypeDescription
rolebytes32undefined
indexuint256undefined

Returns

NameTypeDescription
_0addressundefined

getRoleMemberCount

function getRoleMemberCount(bytes32 role) external view returns (uint256)

Returns the number of accounts that have role. Can be used together with {getRoleMember} to enumerate all bearers of a role.

Parameters

NameTypeDescription
rolebytes32undefined

Returns

NameTypeDescription
_0uint256undefined

grantRole

function grantRole(bytes32 role, address account) external nonpayable

Grants role to account. If account had not been already granted role, emits a {RoleGranted} event. Requirements: - the caller must have role's admin role.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

hasRole

function hasRole(bytes32 role, address account) external view returns (bool)

Returns true if account has been granted role.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

Returns

NameTypeDescription
_0boolundefined

isPaused

function isPaused() external view returns (bool)

Whether the contract publisher is paused.

Returns

NameTypeDescription
_0boolundefined

isTrustedForwarder

function isTrustedForwarder(address forwarder) external view returns (bool)

Parameters

NameTypeDescription
forwarderaddressundefined

Returns

NameTypeDescription
_0boolundefined

multicall

function multicall(bytes[] data) external nonpayable returns (bytes[] results)

Receives and executes a batch of function calls on this contract.

Parameters

NameTypeDescription
databytes[]undefined

Returns

NameTypeDescription
resultsbytes[]undefined

prevPublisher

function prevPublisher() external view returns (contract IContractPublisher)

Returns

NameTypeDescription
_0contract IContractPublisherundefined

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
_publisheraddressundefined
_contractIdstringundefined
_publishMetadataUristringundefined
_compilerMetadataUristringundefined
_bytecodeHashbytes32undefined
_implementationaddressundefined

renounceRole

function renounceRole(bytes32 role, address account) external nonpayable

Revokes role from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked role, emits a {RoleRevoked} event. Requirements: - the caller must be account.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

revokeRole

function revokeRole(bytes32 role, address account) external nonpayable

Revokes role from account. If account had been granted role, emits a {RoleRevoked} event. Requirements: - the caller must have role's admin role.

Parameters

NameTypeDescription
rolebytes32undefined
accountaddressundefined

setPause

function setPause(bool _pause) external nonpayable

Lets a contract admin pause the registry.

Parameters

NameTypeDescription
_pauseboolundefined

setPublisherProfileUri

function setPublisherProfileUri(address publisher, string uri) external nonpayable

Lets an account set its own publisher profile uri

Parameters

NameTypeDescription
publisheraddressundefined
uristringundefined

supportsInterface

function supportsInterface(bytes4 interfaceId) external view returns (bool)

See {IERC165-supportsInterface}.

Parameters

NameTypeDescription
interfaceIdbytes4undefined

Returns

NameTypeDescription
_0boolundefined

unpublishContract

function unpublishContract(address _publisher, string _contractId) external nonpayable

Lets a publisher unpublish a contract and all its versions.

Parameters

NameTypeDescription
_publisheraddressundefined
_contractIdstringundefined

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

RoleAdminChanged

event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)

Parameters

NameTypeDescription
role indexedbytes32undefined
previousAdminRole indexedbytes32undefined
newAdminRole indexedbytes32undefined

RoleGranted

event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)

Parameters

NameTypeDescription
role indexedbytes32undefined
account indexedaddressundefined
sender indexedaddressundefined

RoleRevoked

event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)

Parameters

NameTypeDescription
role indexedbytes32undefined
account indexedaddressundefined
sender indexedaddressundefined