Core
Modular
Emotable
Emotes Repository

RMRKEmotesRepository

RMRK team

RMRKEmotesRepository

Smart contract of the RMRK Emotes repository.

Methods

DOMAIN_SEPARATOR

function DOMAIN_SEPARATOR() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32undefined

bulkEmote

function bulkEmote(address[] collections, uint256[] tokenIds, string[] emojis, bool[] states) external nonpayable

Used to emote or undo an emote on multiple tokens.

Does nothing if attempting to set a pre-existent state.MUST emit the Emoted event is the state of the emote is changed.MUST revert if the lengths of the collections, tokenIds, emojis and states arrays are not equal.

Parameters

NameTypeDescription
collectionsaddress[]An array of addresses of the collections containing the tokens being emoted at
tokenIdsuint256[]An array of IDs of the tokens being emoted
emojisstring[]An array of unicode identifiers of the emojis
statesbool[]An array of boolean values signifying whether to emote (true) or undo (false) emote

bulkEmoteCountOf

function bulkEmoteCountOf(address[] collections, uint256[] tokenIds, string[] emojis) external view returns (uint256[])

Used to get the number of emotes for a specific emoji on a set of tokens.

Parameters

NameTypeDescription
collectionsaddress[]An array of addresses of the collections containing the tokens being checked for emoji count
tokenIdsuint256[]An array of IDs of the tokens to check for emoji count
emojisstring[]An array of unicode identifiers of the emojis

Returns

NameTypeDescription
_0uint256[]An array of numbers of emotes with the emoji on the tokens

bulkPrepareMessagesToPresignEmote

function bulkPrepareMessagesToPresignEmote(address[] collections, uint256[] tokenIds, string[] emojis, bool[] states, uint256[] deadlines) external view returns (bytes32[])

Used to get multiple messages to be signed by the emoter in order for the reaction to be submitted by someone else.

Parameters

NameTypeDescription
collectionsaddress[]An array of addresses of the collection smart contracts containing the tokens being emoted at
tokenIdsuint256[]An array of IDs of the tokens being emoted
emojisstring[]An array of unicode identifiers of the emojis
statesbool[]An array of boolean values signifying whether to emote (true) or undo (false) emote
deadlinesuint256[]An array of UNIX timestamps of the deadlines for the signatures to be submitted

Returns

NameTypeDescription
_0bytes32[]The array of messages to be signed by the emoter in order for the reaction to be submitted by someone else

bulkPresignedEmote

function bulkPresignedEmote(address[] emoters, address[] collections, uint256[] tokenIds, string[] emojis, bool[] states, uint256[] deadlines, uint8[] v, bytes32[] r, bytes32[] s) external nonpayable

Used to bulk emote or undo an emote on someone else's behalf.

Does nothing if attempting to set a pre-existent state.MUST emit the Emoted event is the state of the emote is changed.MUST revert if the lengths of the collections, tokenIds, emojis and states arrays are not equal.MUST revert if the deadline has passed.MUST revert if the recovered address is the zero address.

Parameters

NameTypeDescription
emotersaddress[]An array of addresses of the accounts that presigned the emotes
collectionsaddress[]An array of addresses of the collections containing the tokens being emoted at
tokenIdsuint256[]An array of IDs of the tokens being emoted
emojisstring[]An array of unicode identifiers of the emojis
statesbool[]An array of boolean values signifying whether to emote (true) or undo (false) emote
deadlinesuint256[]UNIX timestamp of the deadline for the signature to be submitted
vuint8[]An array of v values of an ECDSA signatures of the messages obtained via prepareMessageToPresignEmote
rbytes32[]An array of r values of an ECDSA signatures of the messages obtained via prepareMessageToPresignEmote
sbytes32[]An array of s values of an ECDSA signatures of the messages obtained via prepareMessageToPresignEmote

emote

function emote(address collection, uint256 tokenId, string emoji, bool state) external nonpayable

Used to emote or undo an emote on a token.

Does nothing if attempting to set a pre-existent state.MUST emit the Emoted event is the state of the emote is changed.

Parameters

NameTypeDescription
collectionaddressAddress of the collection containing the token being emoted at
tokenIduint256ID of the token being emoted
emojistringUnicode identifier of the emoji
stateboolBoolean value signifying whether to emote (true) or undo (false) emote

emoteCountOf

function emoteCountOf(address collection, uint256 tokenId, string emoji) external view returns (uint256)

Used to get the number of emotes for a specific emoji on a token.

Parameters

NameTypeDescription
collectionaddressAddress of the collection containing the token being checked for emoji count
tokenIduint256ID of the token to check for emoji count
emojistringUnicode identifier of the emoji

Returns

NameTypeDescription
_0uint256Number of emotes with the emoji on the token

hasEmoterUsedEmote

function hasEmoterUsedEmote(address emoter, address collection, uint256 tokenId, string emoji) external view returns (bool)

Used to get the information on whether the specified address has used a specific emoji on a specific token.

Parameters

NameTypeDescription
emoteraddressAddress of the account we are checking for a reaction to a token
collectionaddressAddress of the collection smart contract containing the token being checked for emoji reaction
tokenIduint256ID of the token being checked for emoji reaction
emojistringThe ASCII emoji code being checked for reaction

Returns

NameTypeDescription
_0boolA boolean value indicating whether the emoter has used the emoji on the token (true) or not (false)

haveEmotersUsedEmotes

function haveEmotersUsedEmotes(address[] emoters, address[] collections, uint256[] tokenIds, string[] emojis) external view returns (bool[])

Used to get the information on whether the specified addresses have used specific emojis on specific tokens.

Parameters

NameTypeDescription
emotersaddress[]An array of addresses of the accounts we are checking for reactions to tokens
collectionsaddress[]An array of addresses of the collection smart contracts containing the tokens being checked for emoji reactions
tokenIdsuint256[]An array of IDs of the tokens being checked for emoji reactions
emojisstring[]An array of the ASCII emoji codes being checked for reactions

Returns

NameTypeDescription
_0bool[]An array of boolean values indicating whether the emoters has used the emojis on the tokens (true) or not (false)

prepareMessageToPresignEmote

function prepareMessageToPresignEmote(address collection, uint256 tokenId, string emoji, bool state, uint256 deadline) external view returns (bytes32)

Used to get the message to be signed by the emoter in order for the reaction to be submitted by someone else.

Parameters

NameTypeDescription
collectionaddressThe address of the collection smart contract containing the token being emoted at
tokenIduint256ID of the token being emoted
emojistringUnicode identifier of the emoji
stateboolBoolean value signifying whether to emote (true) or undo (false) emote
deadlineuint256UNIX timestamp of the deadline for the signature to be submitted

Returns

NameTypeDescription
_0bytes32The message to be signed by the emoter in order for the reaction to be submitted by someone else

presignedEmote

function presignedEmote(address emoter, address collection, uint256 tokenId, string emoji, bool state, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable

Used to emote or undo an emote on someone else's behalf.

Does nothing if attempting to set a pre-existent state.MUST emit the Emoted event is the state of the emote is changed.MUST revert if the lengths of the collections, tokenIds, emojis and states arrays are not equal.MUST revert if the deadline has passed.MUST revert if the recovered address is the zero address.

Parameters

NameTypeDescription
emoteraddressThe address that presigned the emote
collectionaddressThe address of the collection smart contract containing the token being emoted at
tokenIduint256IDs of the token being emoted
emojistringUnicode identifier of the emoji
stateboolBoolean value signifying whether to emote (true) or undo (false) emote
deadlineuint256UNIX timestamp of the deadline for the signature to be submitted
vuint8v value of an ECDSA signature of the message obtained via prepareMessageToPresignEmote
rbytes32r value of an ECDSA signature of the message obtained via prepareMessageToPresignEmote
sbytes32s value of an ECDSA signature of the message obtained via prepareMessageToPresignEmote

supportsInterface

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

Returns true if this contract implements the interface defined by interfaceId. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP (opens in a new tab) section] to learn more about how these ids are created. This function call must use less than 30 000 gas.

Parameters

NameTypeDescription
interfaceIdbytes4undefined

Returns

NameTypeDescription
_0boolundefined

Events

Emoted

event Emoted(address indexed emoter, address indexed collection, uint256 indexed tokenId, string emoji, bool on)

Used to notify listeners that the token with the specified ID has been emoted to or that the reaction has been revoked.

The event MUST only be emitted if the state of the emote is changed.

Parameters

NameTypeDescription
emoter indexedaddressAddress of the account that emoted or revoked the reaction to the token
collection indexedaddressAddress of the collection smart contract containing the token being emoted to or having the reaction revoked
tokenId indexeduint256ID of the token
emojistringUnicode identifier of the emoji
onboolBoolean value signifying whether the token was emoted to (true) or if the reaction has been revoked (false)

Errors

BulkParametersOfUnequalLength

error BulkParametersOfUnequalLength()

ExpiredPresignedEmote

error ExpiredPresignedEmote()

InvalidSignature

error InvalidSignature()