IRubyscore_Achievement

IRubyscore_Achievement is an interface for Rubyscore_Achievement contract

MintParams

struct MintParams {
  address userAddress;
  uint256 userNonce;
  uint256[] nftIds;
}

BaseURISet

event BaseURISet(string newBaseURI)

Emitted when the base URI for token metadata is updated.

This event is triggered when the contract operator updates the base URI for retrieving metadata associated with tokens. The 'newBaseURI' parameter represents the updated base URI.

Parameters

NameTypeDescription

newBaseURI

string

The new base URI that will be used to construct token metadata URIs.

Minted

event Minted(address userAddress, uint256 userNonce, uint256[] nftIds)

Emitted when NFTs are minted for a user.

This event is emitted when new NFTs are created and assigned to a user. It includes the user's address, nonce, and the IDs of the minted NFTs for transparency.

Parameters

NameTypeDescription

userAddress

address

The address of the user receiving the NFTs.

userNonce

uint256

The user's nonce used to prevent replay attacks.

nftIds

uint256[]

An array of NFT IDs that were minted.

TokenURISet

event TokenURISet(uint256 tokenId, string newTokenURI)

Emitted when the URI for a specific token is updated.

This event is emitted when the URI for a token is modified, providing transparency when metadata URIs are changed for specific tokens.

Parameters

NameTypeDescription

tokenId

uint256

The ID of the token for which the URI is updated.

newTokenURI

string

The new URI assigned to the token.

TokenUnlockSet

event TokenUnlockSet(uint256 tokenId, bool lock)

Emitted when the transfer lock status for a token is updated.

This event is emitted when the transfer lock status of a specific token is modified. It provides transparency regarding whether a token can be transferred or not.

Parameters

NameTypeDescription

tokenId

uint256

The ID of the token for which the transfer lock status changes.

lock

bool

The new transfer lock status (true for locked, false for unlocked).

PriceUpdated

event PriceUpdated(uint256 newPrice)

Emitted when the price for a token mint is updated.

This event is emitted when the price for mint a token is modified.

Parameters

NameTypeDescription

newPrice

uint256

The new price for mint.

name

function name() external view returns (string)

Get token name.

Return Values

NameTypeDescription

[0]

string

Token name.

symbol

function symbol() external view returns (string)

Get token symbol.

Return Values

NameTypeDescription

[0]

string

Token symbol.

uri

function uri(uint256 tokenId) external view returns (string)

Get the URI of a token.

Parameters

NameTypeDescription

tokenId

uint256

The ID of the token.

Return Values

NameTypeDescription

[0]

string

The URI of the token.

getTransferStatus

function getTransferStatus(uint256 tokenId) external view returns (bool)

Get the transfer status of a token.

Parameters

NameTypeDescription

tokenId

uint256

The ID of the token.

Return Values

NameTypeDescription

[0]

bool

Whether the token's transfer is unlocked (true) or restricted (false).

getUserNonce

function getUserNonce(address userAddress) external view returns (uint256)

Get the user's nonce associated with their address.

Parameters

NameTypeDescription

userAddress

address

The address of the user.

Return Values

NameTypeDescription

[0]

uint256

The user's nonce.

tokenURI

function tokenURI(uint256 tokenId) external view returns (string)

Get the token URI for a given tokenId.

Diblicate for uri() method

Parameters

NameTypeDescription

tokenId

uint256

The ID of the token.

Return Values

NameTypeDescription

[0]

string

The URI of the token.

setTokenURI

function setTokenURI(uint256 tokenId, string newTokenURI) external

Set the URI for a token.

Requires the MINTER_ROLE.

Parameters

NameTypeDescription

tokenId

uint256

The ID of the token.

newTokenURI

string

The new URI to set for the token.

setBatchTokenURI

function setBatchTokenURI(uint256[] tokenIds, string[] newTokenURIs) external

Set the URIs for multiple tokens in a batch.

Requires the MINTER_ROLE. Requires that the tokenIds and newTokenURIs arrays have the same length.

Parameters

NameTypeDescription

tokenIds

uint256[]

An array of token IDs to set URIs for.

newTokenURIs

string[]

An array of new URIs to set for the tokens.

setBaseURI

function setBaseURI(string newBaseURI) external

Set the base URI for all tokens.

Requires the OPERATOR_ROLE.

Parameters

NameTypeDescription

newBaseURI

string

The new base URI to set.

safeMint

function safeMint(struct IRubyscore_Achievement.MintParams mintParams, bytes operatorSignature) external payable

Safely mints NFTs for a user based on provided parameters and a valid minter signature.

This function safely mints NFTs for a user while ensuring the validity of the operator's signature. It requires that the provided NFT IDs are valid and that the operator has the MINTER_ROLE. User nonces are used to prevent replay attacks. Multiple NFTs can be minted in a batch or a single NFT can be minted based on the number of NFT IDs provided. Emits the 'Minted' event to indicate the successful minting of NFTs.

Parameters

NameTypeDescription

mintParams

struct IRubyscore_Achievement.MintParams

The struct containing user address, user nonce, and NFT IDs to mint.

operatorSignature

bytes

The ECDSA signature of the data, validating the operator's role.

Withdrawed

event Withdrawed(uint256 amount)

setTransferUnlock

function setTransferUnlock(uint256 tokenId, bool lock) external

Sets the transfer lock status for a specific token ID.

This function can only be called by an operator with the OPERATOR_ROLE. It allows operators to control the transferability of specific tokens. Emits the 'tokenUnlockSet' event to indicate the change in transfer lock status.

Parameters

NameTypeDescription

tokenId

uint256

The ID of the token to set the transfer lock status for.

lock

bool

The boolean value to determine whether transfers of this token are locked or unlocked.

supportsInterface

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

Check if a given interface is supported by this contract.

Parameters

NameTypeDescription

interfaceId

bytes4

The interface identifier to check for support.

Return Values

NameTypeDescription

[0]

bool

Whether the contract supports the specified interface.

Last updated