Ready To Use
Utils
Implementation Base

RMRKImplementationBase

RMRK team

RMRKImplementationBase

Smart contract of the RMRK minting utils module.

This smart contract includes the top-level utilities for managing minting and implements Ownable by default.

Methods

contractURI

function contractURI() external view returns (string contractURI_)

Used to retrieve the metadata URI of the collection.

Returns

NameTypeDescription
contractURI_stringstring The metadata URI of the collection

getRoyaltyPercentage

function getRoyaltyPercentage() external view returns (uint256 royaltyPercentageBps)

Used to retrieve the specified royalty percentage.

Returns

NameTypeDescription
royaltyPercentageBpsuint256The royalty percentage expressed in the basis points

getRoyaltyRecipient

function getRoyaltyRecipient() external view returns (address recipient)

Used to retrieve the recipient of royalties.

Returns

NameTypeDescription
recipientaddressAddress of the recipient of royalties

isContributor

function isContributor(address contributor) external view returns (bool isContributor_)

Used to check if the address is one of the contributors.

Parameters

NameTypeDescription
contributoraddressAddress of the contributor whose status we are checking

Returns

NameTypeDescription
isContributor_boolBoolean value indicating whether the address is a contributor or not

manageContributor

function manageContributor(address contributor, bool grantRole) external nonpayable

Adds or removes a contributor to the smart contract.

Can only be called by the owner.Emits ContributorUpdate event.

Parameters

NameTypeDescription
contributoraddressAddress of the contributor's account
grantRoleboolA boolean value signifying whether the contributor role is being granted (true) or revoked (false)

maxSupply

function maxSupply() external view returns (uint256 maxSupply_)

Used to retrieve the maximum supply of the collection.

Returns

NameTypeDescription
maxSupply_uint256The maximum supply of tokens in the collection

name

function name() external view returns (string name_)

Used to retrieve the collection name.

Returns

NameTypeDescription
name_stringName of the collection

owner

function owner() external view returns (address owner_)

Returns the address of the current owner.

Returns

NameTypeDescription
owner_addressAddress of the current owner

renounceOwnership

function renounceOwnership() external nonpayable

Leaves the contract without owner. Functions using the onlyOwner modifier will be disabled.

Can only be called by the current owner.Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

royaltyInfo

function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount)

Used to retrieve the information about who shall receive royalties of a sale of the specified token and how much they will be.

Parameters

NameTypeDescription
tokenIduint256ID of the token for which the royalty info is being retrieved
salePriceuint256Price of the token sale

Returns

NameTypeDescription
receiveraddressThe beneficiary receiving royalties of the sale
royaltyAmountuint256The value of the royalties recieved by the receiver from the sale

symbol

function symbol() external view returns (string symbol_)

Used to retrieve the collection symbol.

Returns

NameTypeDescription
symbol_stringSymbol of the collection

totalAssets

function totalAssets() external view returns (uint256 totalAssets_)

Used to retrieve the total number of assets.

Returns

NameTypeDescription
totalAssets_uint256The total number of assets

totalSupply

function totalSupply() external view returns (uint256 totalSupply_)

Used to retrieve the total supply of the tokens in a collection.

Returns

NameTypeDescription
totalSupply_uint256The number of tokens in a collection

transferOwnership

function transferOwnership(address newOwner) external nonpayable

Transfers ownership of the contract to a new owner.

Can only be called by the current owner.

Parameters

NameTypeDescription
newOwneraddressAddress of the new owner's account

updateRoyaltyRecipient

function updateRoyaltyRecipient(address newRoyaltyRecipient) external nonpayable

Used to update recipient of royalties.

Custom access control has to be implemented to ensure that only the intended actors can update the beneficiary.

Parameters

NameTypeDescription
newRoyaltyRecipientaddressAddress of the new recipient of royalties

Events

ContributorUpdate

event ContributorUpdate(address indexed contributor, bool isContributor)

Event that signifies that an address was granted contributor role or that the permission has been revoked.

This can only be triggered by a current owner, so there is no need to include that information in the event.

Parameters

NameTypeDescription
contributor indexedaddressAddress of the account that had contributor role status updated
isContributorboolA boolean value signifying whether the role has been granted (true) or revoked (false)

OwnershipTransferred

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Used to anounce the transfer of ownership.

Parameters

NameTypeDescription
previousOwner indexedaddressAddress of the account that transferred their ownership role
newOwner indexedaddressAddress of the account receiving the ownership role

Errors

RMRKNewContributorIsZeroAddress

error RMRKNewContributorIsZeroAddress()

Attempting to assign a 0x0 address as a contributor

RMRKNewOwnerIsZeroAddress

error RMRKNewOwnerIsZeroAddress()

Attempting to transfer the ownership to the 0x0 address

RMRKNotOwner

error RMRKNotOwner()

Attempting to interact with a management function without being the smart contract's owner

RMRKRoyaltiesTooHigh

error RMRKRoyaltiesTooHigh()

Attempting to set the royalties to a value higher than 100% (10000 in basis points)