Treasureland
Search…
Treasureland NFT Standard
Table of Contents
NFT Standard Protocol 1.1
ERC1155 1.1.1
ERC721 1.1.2
Metadata 1.1.3
Royalty 1.2

1.1 NFT Standard Protocol

1
// 20210512153646 // https://meebits.larvalabs.com/meebit/7241
2
{ "name": "Meebit #7241", "description": "Meebit #7241",
3
"image": "http://meebits.larvalabs.com/meebitimages/characterimage?index=7241&type=full&imageType=jpg",
4
"attributes": [ { "trait_type": "Type", "value": "Human" },
5
{ "trait_type": "Hair Style", "value": "Pulled Back" },
6
{ "trait_type": "Hair Color", "value": "Auburn" },
7
{ "trait_type": "Shirt", "value": "Tee" },
8
{ "trait_type": "Shirt Color", "value": "Argyle" },
9
{ "trait_type": "Pants", "value": "Short Leggings" },
10
{ "trait_type": "Pants Color", "value": "Blue Camo" },
11
{ "trait_type": "Shoes", "value": "Skater" },
12
{ "trait_type": "Shoes Color", "value": "Black" } ] }
Copied!
1
"`javascript
2
/*
3
* bytes4(keccak256(‘balanceOf(address,uint256)’)) == 0x00fdd58e
4
* bytes4(keccak256(‘balanceOfBatch(address[],uint256[])’)) == 0x4e1273f4
5
* bytes4(keccak256(‘setApprovalForAll(address,bool)’)) == 0xa22cb465
6
* bytes4(keccak256(‘isApprovedForAll(address,address)’)) == 0xe985e9c5
7
* bytes4(keccak256(‘safeTransferFrom(address,address,uint256,uint256,bytes)’)) == 0xf242432a
8
* bytes4(keccak256(‘safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)’)) == 0x2eb2c2d6
9
*
10
* => 0x00fdd58e ^ 0x4e1273f4 ^ 0xa22cb465 ^
11
* 0xe985e9c5 ^ 0xf242432a ^ 0x2eb2c2d6 == 0xd9b67a26
12
*/
13
bytes4 private constant _INTERFACE_ID_ERC1155 = 0xd9b67a26;
14
/*
15
* bytes4(keccak256(‘uri(uint256)’)) == 0x0e89341c
16
*/
17
bytes4 private constant _INTERFACE_ID_ERC1155_METADATA_URI = 0x0e89341c;
18
"`
Copied!
One needs to register the above Interface in the ERC165 protocol

1.1.2 ERC721

ERC721NFT needs to comply with the IERC721 protocol standard and needs to implement the following protocol standards
1
// // 20210512153646 // https://meebits.larvalabs.com/meebit/7241
2
{ "name": "Meebit #7241", "description": "Meebit #7241",
3
"image": "http://meebits.larvalabs.com/meebitimages/characterimage?index=7241&type=full&imageType=jpg",
4
"attributes": [ { "trait_type": "Type", "value": "Human" },
5
{ "trait_type": "Hair Style", "value": "Pulled Back" },
6
{ "trait_type": "Hair Color", "value": "Auburn" },
7
{ "trait_type": "Shirt", "value": "Tee" },
8
{ "trait_type": "Shirt Color", "value": "Argyle" },
9
{ "trait_type": "Pants", "value": "Short Leggings" },
10
{ "trait_type": "Pants Color", "value": "Blue Camo" },
11
{ "trait_type": "Shoes", "value": "Skater" },
12
{ "trait_type": "Shoes Color", "value": "Black" } ] }
Copied!

1.1.1 ERC1155

1
/*
2
bytes4(keccak256(‘balanceOf(address)’)) == 0x70a08231
3
* bytes4(keccak256(‘ownerOf(uint256)’)) == 0x6352211e
4
bytes4(keccak256(‘approve(address,uint256)’)) == 0x09
5
bytes4(keccak256(‘getApproved(uint256)’)) == 0x081812
6
bytes4(keccak256(‘setApprovalForAll(address,bool)’))
7
bytes4(keccak256(‘isApprovedForAll(address,address)’)
8
bytes4(keccak256(‘transferFrom(address,address,uint25
9
bytes4(keccak256(‘safeTransferFrom(address,address,ui
10
bytes4(keccak256(‘safeTransferFrom(address,address,ui
11
*
12
* => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc
13
* 0xa22cb465 ^ 0xe985e9c5 ^ 0x23b872dd ^ 0x42842e0e
14
*/
15
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
16
/*
17
bytes4(keccak256(‘name()’)) == 0x06fdde03
18
* bytes4(keccak256(‘symbol()’)) == 0x95d89b41
19
bytes4(keccak256(‘tokenURI(uint256)’)) == 0xc87b56dd
20
*
21
* => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f
22
*/
23
bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b
24
/*
25
bytes4(keccak256(‘totalSupply()’)) == 0x18160ddd
26
bytes4(keccak256(‘tokenOfOwnerByIndex(address,uint256
27
bytes4(keccak256(‘tokenByIndex(uint256)’)) == 0x4f6cc
28
*
29
* => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63
30
*/
31
bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x
Copied!
One needs to register the above Interface in the ERC165 protocol
ERC1155NFT needs to comply with the IERC1155 protocol standard and implement the following protocol standards

1.1.3 metadata

Each NFT will have corresponding metadata URI that returns additional important information about the item, such as the item’s name, image, description, etc. To find this URI, we use the
tokenURI method in ERC721 and the URI method in ERC1155.
There’s quite a lot you can do with metadata — including adding rankings, boost, animations, dates, and much more! We think you’ll definitely want to explore it in full, so please see our dedicated metadata standards documentation for this piece of the tutorial.
TreasureLand supports metadata that is structured according to the official ERC721 metadata standard or the Enjin Metadata suggestions.
Additionally, we support several other properties that allow for multimedia attachments — including audio, video, and 3D models — plus interactive traits for your items, giving you all the sorting and filtering capabilities on the market.

Attributes

To give your items a little more pizazz, we also allow you to add custom “attributes” to your metadata that will appear underneath each of your assets.
To generate those attributes, the following array of attributes was included in the metadata:
1
/*
2
bytes4(keccak256(‘balanceOf(address)’)) == 0x70a08231
3
* bytes4(keccak256(‘ownerOf(uint256)’)) == 0x6352211e
4
bytes4(keccak256(‘approve(address,uint256)’)) == 0x09
5
bytes4(keccak256(‘getApproved(uint256)’)) == 0x081812
6
bytes4(keccak256(‘setApprovalForAll(address,bool)’))
7
bytes4(keccak256(‘isApprovedForAll(address,address)’)
8
bytes4(keccak256(‘transferFrom(address,address,uint25
9
bytes4(keccak256(‘safeTransferFrom(address,address,ui
10
bytes4(keccak256(‘safeTransferFrom(address,address,ui
11
*
12
* => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc
13
* 0xa22cb465 ^ 0xe985e9c5 ^ 0x23b872dd ^ 0x42842e0e
14
*/
15
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
16
/*
17
bytes4(keccak256(‘name()’)) == 0x06fdde03
18
* bytes4(keccak256(‘symbol()’)) == 0x95d89b41
19
bytes4(keccak256(‘tokenURI(uint256)’)) == 0xc87b56dd
20
*
21
* => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f
22
*/
23
bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b
24
/*
25
bytes4(keccak256(‘totalSupply()’)) == 0x18160ddd
26
bytes4(keccak256(‘tokenOfOwnerByIndex(address,uint256
27
bytes4(keccak256(‘tokenByIndex(uint256)’)) == 0x4f6cc
28
*
29
* => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63
30
*/
31
bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x
Copied!

1.2 Royalty standard

Treasureland royalty standard is based on the IERC2981 protocol. And the contract is based on IERC2981 to realize the royalty solution
1
"`javascript
2
/// bytes4(keccak256(“royaltyInfo(uint256)”)) == 0xcef6d368
3
/// bytes4(keccak256(“onRoyaltiesReceived(address,address,uint256,address,uint256,bytes32)”)) == 0xe8cb9d99
4
/// bytes4(0xcef6d368) ^ bytes4(0xe8cb9d99) == 0x263d4ef1
5
bytes4 private constant _INTERFACE_ID_ERC721ROYALTIES = 0x263d4ef1;
6
"`
Copied!
– IERC2981 has a numerical conversion as follows
1
"`javascript
2
amount – a percentage calculated as a fixed point with a scaling factor of 100000 (5 decimals),
3
such that 100% would be the value 10000000, as 10000000/100000 = 100.
4
1% would be the value 100000, as 100000/100000 = 1
Copied!