ScaleyValleyCollection specification
ScaleyValleyCollection is a contract keeping all NFT information in it. This contract exists only on Ethereum network with bridge Hyp721 backings on other Valley-chains.
Storage mapping
kindSupply
mapping uint256
=> uint256
Maps kindId
to total amount
minted of this kind
Constants
AQUATIQUE_KIND
uint256
0x0000
β indentifier for Aquatique NFT kind
DRUID_KIND
uint256
0x0001
β indentifier for Druid NFT kind
ILLUMINATOR_KIND
uint256
0x0002
β indentifier for Illuminator NFT kind
HERMES_KIND
uint256
0x0003
β indentifier for Hermes NFT kind
MINTER_ROLE
bytes32
keccak256("MINTER_ROLE")
β only minter can mint
Methods
View state
getNFTKindSupply(uint256 kind)
β gives supply for kind
getKind(uint256 id)
β calculated kind
from id
using bitwise operators
isKind(uint256 id, uint256 kind)
βwhether id
is amongst kind
tokens
tokenURI(uint256 tokenId)
β appends tokenId
to baseURI
Changing state
mintKind(address to, uint256 kind)
β mints kind
token to user to
. It emits event Transfer
from address(0)
so backend services will see minted token id.
token id is defined as follows:
uint256 tokenId = (kindId << 16) | kindSupply[kindId]
Interactor must have MINTER_ROLE
.
setBaseURI(string memory newUri)
β set NFT's metadata URI. Only DEFAULT_ADMIN_ROLE
Last updated