The NFT Sales is not only an investment opportunity. It is also a part of the game where users can help activate 10000 Kuni Saru NFTs to reconstruct the world of Aeprian.
Merkle tree in this repo is constructed in the same way with merkle tree js library with the following hash function:
const leaves = _map(data, token => utils.hashOneToken(token.id, token))
const tree = new MerkleTree(leaves, keccak256, {sort: true});
Where hashOneToken
is a function to hash 1 NFT data as the following pseudo-code:
id = tokenId of the Saru NFT.
attrNames = All of the Saru NFT's attribute names sorted alphabetically.
attrValues = All of the attribute values, in the corresponding order to attributeNames.
imageUrl = Url image of the main photo.
name = Name of the NFT.
return hash = keccak256(abiEncode(
id, attrNames, attrValues, imageUrl, name
))
Requirements:
- Node.js
- npm (Node.js package manager)
In order to get metadata, calculate, verification merkle root and proofs for all NFT data.
- Get all of the necessary NFT's data from Amakuni using your NFT's
tokenUri(id)
function. The team will publish the software to automatically and easily calculate the proof from the NFT Data. So people can verify the proof every time they want. If the proof is changed, they can report it to the team and the community. - Get
MERKLE_ROOT_PUBLIC
fromSale
contract. - set your current directory to the root directory of the repo.
npm install
to install all of the dependencies.npm run build
to install all of the dependencies.node build/app.js [MERKLE_ROOT_PUBLIC]
function to Get Metadata, calculate the merkle tree and merkle proof verification. If it returnsTrue
, the data is fine, otherwise it is not.