Rubyscore_Profile

Rubyscore_Profile is an SBT ERC721-based smart contract for claiming and managing user names. Users can claim unique names represented by ERC721 tokens.

OPERATOR_ROLE

bytes32 OPERATOR_ROLE

getIdByName

function getIdByName(string name) external pure returns (uint256)

See {IRubyscore_Profile}

getBaseURI

function getBaseURI() external view returns (string)

See {IRubyscore_Profile}

getBaseExtension

function getBaseExtension() external view returns (string)

See {IRubyscore_Profile}

checkName

function checkName(string name) external view returns (bool, uint256)

See {IRubyscore_Profile}

getPremiumPrice

function getPremiumPrice() external view returns (uint256)

See {IRubyscore_Profile}

getPremiumStatus

function getPremiumStatus(address userAddress) external view returns (bool)

See {IRubyscore_Profile}

getOwnerByName

function getOwnerByName(string name) external view returns (address)

See {IRubyscore_Profile}

getNameByOwner

function getNameByOwner(address userAddress) external view returns (string)

See {IRubyscore_Profile}

getNameById

function getNameById(uint256 id) external view returns (string)

See {IRubyscore_Profile}

getIdByOwner

function getIdByOwner(address userAddress) public view returns (uint256)

See {IRubyscore_Profile}

tokenURI

function tokenURI(uint256 tokenId) public view virtual returns (string)

See {IRubyscore_Profile}

hasName

function hasName(address _user) public view returns (bool)

See {IRubyscore_Profile}

supportsInterface

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

See {IRubyscore_Profile}

constructor

constructor(address admin, address operator) public

Constructor to initialize the contract with admin and operator addresses.

Parameters

updateBaseURI

function updateBaseURI(string newBaseURI) external

See {IRubyscore_Profile}

updateBaseExtension

function updateBaseExtension(string newBaseExtension) external

See {IRubyscore_Profile}

updatePremiumPrice

function updatePremiumPrice(uint256 newPremiumPrice) external

See {IRubyscore_Profile}

claimName

function claimName(string name) external payable returns (uint256 tokenId)

See {IRubyscore_Profile}

withdraw

function withdraw() external

See {IRubyscore_Profile}

_transfer

function _transfer(address, address, uint256) internal pure

Internal ERC721 transfer function override to prevent external transfers.

from The address to transfer from. to The address to transfer to. tokenId The ID of the token being transferred.

_convertNameToId

function _convertNameToId(string str) internal pure returns (uint256)

Converts a name string to a unique identifier (ID).

Parameters

Return Values

_convertStringToUint256

function _convertStringToUint256(string str) internal pure returns (uint256)

Converts a string to a unique uint256 value.

Parameters

Return Values

_normalizeName

function _normalizeName(string str) internal pure returns (string, bool)

Normalizes a given name string by converting it to lowercase and validating its length and characters.

Parameters

Return Values

_checkValidCharacters

function _checkValidCharacters(uint8 bCharacter) internal pure returns (bool)

Checks if a given character is valid within a name.

Parameters

Return Values

strLength

function strLength(string s) internal pure returns (uint256)

Returns the length of a given string

Parameters

Return Values

Last updated