Skip to main content

MarketplaceV3

thirdweb.com

Methods

DEFAULT_ADMIN_ROLE

function DEFAULT_ADMIN_ROLE() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32undefined

_getPluginForFunction

function _getPluginForFunction(bytes4 _selector) external view returns (address)

View address of the plugged-in functionality contract for a given function signature.

Parameters

NameTypeDescription
_selectorbytes4undefined

Returns

NameTypeDescription
_0addressundefined

addPlugin

function addPlugin(IPluginMap.Plugin _plugin) external nonpayable

Parameters

NameTypeDescription
_pluginIPluginMap.Pluginundefined

contractType

function contractType() external pure returns (bytes32)

Returns the type of the contract.

Returns

NameTypeDescription
_0bytes32undefined

contractURI

function contractURI() external view returns (string)

Returns the metadata URI of the contract.

Returns

NameTypeDescription
_0stringundefined

contractVersion

function contractVersion() external pure returns (uint8)

Returns the version of the contract.

Returns

NameTypeDescription
_0uint8undefined

getAllFunctionsOfPlugin

function getAllFunctionsOfPlugin(address _pluginAddress) external view returns (bytes4[] registered)

View all funtionality as list of function signatures.

Parameters

NameTypeDescription
_pluginAddressaddressundefined

Returns

NameTypeDescription
registeredbytes4[]undefined

getAllPlugins

function getAllPlugins() external view returns (struct IPluginMap.Plugin[] registered)

View all funtionality existing on the contract.

Returns

NameTypeDescription
registeredIPluginMap.Plugin[]undefined

getPlatformFeeInfo

function getPlatformFeeInfo() external view returns (address, uint16)

Returns the platform fee recipient and bps.

Returns

NameTypeDescription
_0addressundefined
_1uint16undefined

getPluginForFunction

function getPluginForFunction(bytes4 _selector) external view returns (address)

View address of the plugged-in functionality contract for a given function signature.

Parameters

NameTypeDescription
_selectorbytes4undefined

Returns

NameTypeDescription
_0addressundefined

getRoleAdmin

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

Returns the admin role that controls the specified role.

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

Parameters

NameTypeDescription
rolebytes32keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")

Returns

NameTypeDescription
_0bytes32undefined

getRoleMember

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

Returns the role-member from a list of members for a role, at a given index.

Returns member who has role, at index of role-members list. See struct {RoleMembers}, and mapping {roleMembers}

Parameters

NameTypeDescription
rolebytes32keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
indexuint256Index in list of current members for the role.

Returns

NameTypeDescription
memberaddressAddress of account that has role

getRoleMemberCount

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

Returns total number of accounts that have a role.

Returns count of accounts that have role. See struct {RoleMembers}, and mapping {roleMembers}

Parameters

NameTypeDescription
rolebytes32keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")

Returns

NameTypeDescription
countuint256Total number of accounts that have role

grantRole

function grantRole(bytes32 role, address account) external nonpayable

Grants a role to an account, if not previously granted.

Caller must have admin role for the role. Emits {RoleGranted Event}.

Parameters

NameTypeDescription
rolebytes32keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
accountaddressAddress of the account to which the role is being granted.

hasRole

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

Checks whether an account has a particular role.

Returns true if account has been granted role.

Parameters

NameTypeDescription
rolebytes32keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
accountaddressAddress of the account for which the role is being checked.

Returns

NameTypeDescription
_0boolundefined

hasRoleWithSwitch

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

Checks whether an account has a particular role; role restrictions can be swtiched on and off.

Returns true if account has been granted role. Role restrictions can be swtiched on and off: - If address(0) has ROLE, then the ROLE restrictions don't apply. - If address(0) does not have ROLE, then the ROLE restrictions will apply.

Parameters

NameTypeDescription
rolebytes32keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
accountaddressAddress of the account for which the role is being checked.

Returns

NameTypeDescription
_0boolundefined

initialize

function initialize(address _defaultAdmin, string _contractURI, address[] _trustedForwarders, address _platformFeeRecipient, uint16 _platformFeeBps) external nonpayable

Initiliazes the contract, like a constructor.

Parameters

NameTypeDescription
_defaultAdminaddressundefined
_contractURIstringundefined
_trustedForwardersaddress[]undefined
_platformFeeRecipientaddressundefined
_platformFeeBpsuint16undefined

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.

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

Parameters

NameTypeDescription
databytes[]The bytes data that makes up the batch of function calls to execute.

Returns

NameTypeDescription
resultsbytes[]The bytes data that makes up the result of the batch of function calls executed.

onERC1155BatchReceived

function onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) external nonpayable returns (bytes4)

Parameters

NameTypeDescription
_0addressundefined
_1addressundefined
_2uint256[]undefined
_3uint256[]undefined
_4bytesundefined

Returns

NameTypeDescription
_0bytes4undefined

onERC1155Received

function onERC1155Received(address, address, uint256, uint256, bytes) external nonpayable returns (bytes4)

Parameters

NameTypeDescription
_0addressundefined
_1addressundefined
_2uint256undefined
_3uint256undefined
_4bytesundefined

Returns

NameTypeDescription
_0bytes4undefined

onERC721Received

function onERC721Received(address, address, uint256, bytes) external pure returns (bytes4)

Parameters

NameTypeDescription
_0addressundefined
_1addressundefined
_2uint256undefined
_3bytesundefined

Returns

NameTypeDescription
_0bytes4undefined

pluginMap

function pluginMap() external view returns (address)

Returns

NameTypeDescription
_0addressundefined

removePlugin

function removePlugin(bytes4 _selector) external nonpayable

Remove existing functionality from the contract.

Parameters

NameTypeDescription
_selectorbytes4undefined

renounceRole

function renounceRole(bytes32 role, address account) external nonpayable

Revokes role from the account.

Caller must have the role, with caller being the same as account. Emits {RoleRevoked Event}.

Parameters

NameTypeDescription
rolebytes32keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
accountaddressAddress of the account from which the role is being revoked.

revokeRole

function revokeRole(bytes32 role, address account) external nonpayable

Revokes role from an account.

Caller must have admin role for the role. Emits {RoleRevoked Event}.

Parameters

NameTypeDescription
rolebytes32keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")
accountaddressAddress of the account from which the role is being revoked.

setContractURI

function setContractURI(string _uri) external nonpayable

Lets a contract admin set the URI for contract-level metadata.

Caller should be authorized to setup contractURI, e.g. contract admin. See {_canSetContractURI}. Emits {ContractURIUpdated Event}.

Parameters

NameTypeDescription
_uristringkeccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")

setPlatformFeeInfo

function setPlatformFeeInfo(address _platformFeeRecipient, uint256 _platformFeeBps) external nonpayable

Updates the platform fee recipient and bps.

Caller should be authorized to set platform fee info. See {_canSetPlatformFeeInfo}. Emits {PlatformFeeInfoUpdated Event}; See {_setupPlatformFeeInfo}.

Parameters

NameTypeDescription
_platformFeeRecipientaddressAddress to be set as new platformFeeRecipient.
_platformFeeBpsuint256Updated platformFeeBps.

supportsInterface

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

Parameters

NameTypeDescription
interfaceIdbytes4undefined

Returns

NameTypeDescription
_0boolundefined

updatePlugin

function updatePlugin(IPluginMap.Plugin _plugin) external nonpayable

Parameters

NameTypeDescription
_pluginIPluginMap.Pluginundefined

Events

ContractURIUpdated

event ContractURIUpdated(string prevURI, string newURI)

Parameters

NameTypeDescription
prevURIstringundefined
newURIstringundefined

PlatformFeeInfoUpdated

event PlatformFeeInfoUpdated(address indexed platformFeeRecipient, uint256 platformFeeBps)

Parameters

NameTypeDescription
platformFeeRecipient indexedaddressundefined
platformFeeBpsuint256undefined

PluginAdded

event PluginAdded(bytes4 indexed functionSelector, address indexed pluginAddress)

Parameters

NameTypeDescription
functionSelector indexedbytes4undefined
pluginAddress indexedaddressundefined

PluginRemoved

event PluginRemoved(bytes4 indexed functionSelector, address indexed pluginAddress)

Parameters

NameTypeDescription
functionSelector indexedbytes4undefined
pluginAddress indexedaddressundefined

PluginSet

event PluginSet(bytes4 indexed functionSelector, string indexed functionSignature, address indexed pluginAddress)

Parameters

NameTypeDescription
functionSelector indexedbytes4undefined
functionSignature indexedstringundefined
pluginAddress indexedaddressundefined

PluginUpdated

event PluginUpdated(bytes4 indexed functionSelector, address indexed oldPluginAddress, address indexed newPluginAddress)

Parameters

NameTypeDescription
functionSelector indexedbytes4undefined
oldPluginAddress indexedaddressundefined
newPluginAddress indexedaddressundefined

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