Galler NFT Protocol Specification

Network

BSC & Ethereum

Precondition

Before import must have at least one token mint in your contract.

NFT Standard

ERC721,now we only support ERC721 import. ERC1155 will be supported later.

We judge the contract ABI by EIP165, so your contract must follow this and have related ERC721 interfaces supported.

EIP/Function

InterfaceId

Comment

EIP165

0x01ffc9a7

ERC721

0x80ac58cd

ERC721Metadata

0x5b5e139f

ERC721Enumerable

0x780e9d63

Ownerable

owner() need return the owner address, and the address should be an EOA, or you can’t claim ownership of the NFT collection

NFT TokenURI Standard

tokenURI return values

  1. HTTP/s link represent metadata
  2. Base64 encoded JSON represent the NFT material

Metadata format

{
    "name":"NFT Name",
    "description":"NFT Description, MAX LENGTH 500 char",
    "image":"https://somedomain.com/pic/xxxx.jpg",
    "attributes":[
        {
            "trait_type":"Trait Type 1",
            "value":"Trait Value"
        },
        {
            "trait_type":"Trait Type 2",
            "value":"Trait Value"
        }
    ]
}

Currently we only support name/description/image/attributes fields, other fields will be ignored.

Data description

  1. name
    • Max 200 characters
  2. description
    • Max 500 characters
  3. Image
    • Https URL of image
    • IPFS address like “ipfs://QmX7cwxUov4R9L9bp81j9sEMyfjv3bnYJXPog4LwuhbswG/1.png”
    • PNG/JPG/JPEG/GIF are supported
  4. attributes
    • All should be placed as a JSON array in the “attributes” object. attribute name keep in “trait_type”, and value keep in “value”.
    • trait_type and value Max 128 characters
    • Max attributes number 20

BASE64 encoded JSON

The example of base64 encoded json is like uniswap v3 or Loot

The example of Loot is like this

eyJuYW1lIjogIkJhZyAjMSIsICJkZXNjcmlwdGlvbiI6ICJMb290IGlzIHJhbmRvbWl6ZWQgYWR2ZW50dXJlciBnZWFyIGdlbmVyYXRlZCBhbmQgc3RvcmVkIG9uIGNoYWluLiBTdGF0cywgaW1hZ2VzLCBhbmQgb3RoZXIgZnVuY3Rpb25hbGl0eSBhcmUgaW50ZW50aW9uYWxseSBvbWl0dGVkIGZvciBvdGhlcnMgdG8gaW50ZXJwcmV0LiBGZWVsIGZyZWUgdG8gdXNlIExvb3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UhnOUlqRXdJaUI1UFNJeE1qQWlJR05zWVhOelBTSmlZWE5sSWo1VGRIVmtaR1ZrSUV4bFlYUm9aWElnUjJ4dmRtVnpQQzkwWlhoMFBqeDBaWGgwSUhnOUlqRXdJaUI1UFNJeE5EQWlJR05zWVhOelBTSmlZWE5sSWo1T1pXTnJiR0ZqWlNCdlppQkZibXhwWjJoMFpXNXRaVzUwUEM5MFpYaDBQangwWlhoMElIZzlJakV3SWlCNVBTSXhOakFpSUdOc1lYTnpQU0ppWVhObElqNUhiMnhrSUZKcGJtYzhMM1JsZUhRK1BDOXpkbWMrIn0=

After Base64 decode is like

{"name": "Bag #1", "description": "Loot is randomized adventurer gear generated and stored on chain. Stats, images, and other functionality are intentionally omitted for others to interpret. Feel free to use Loot in any way you want.", "image": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaW5ZTWluIG1lZXQiIHZpZXdCb3g9IjAgMCAzNTAgMzUwIj48c3R5bGU+LmJhc2UgeyBmaWxsOiB3aGl0ZTsgZm9udC1mYW1pbHk6IHNlcmlmOyBmb250LXNpemU6IDE0cHg7IH08L3N0eWxlPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9ImJsYWNrIiAvPjx0ZXh0IHg9IjEwIiB5PSIyMCIgY2xhc3M9ImJhc2UiPiJHcmltIFNob3V0IiBHcmF2ZSBXYW5kIG9mIFNraWxsICsxPC90ZXh0Pjx0ZXh0IHg9IjEwIiB5PSI0MCIgY2xhc3M9ImJhc2UiPkhhcmQgTGVhdGhlciBBcm1vcjwvdGV4dD48dGV4dCB4PSIxMCIgeT0iNjAiIGNsYXNzPSJiYXNlIj5EaXZpbmUgSG9vZDwvdGV4dD48dGV4dCB4PSIxMCIgeT0iODAiIGNsYXNzPSJiYXNlIj5IYXJkIExlYXRoZXIgQmVsdDwvdGV4dD48dGV4dCB4PSIxMCIgeT0iMTAwIiBjbGFzcz0iYmFzZSI+IkRlYXRoIFJvb3QiIE9ybmF0ZSBHcmVhdmVzIG9mIFNraWxsPC90ZXh0Pjx0ZXh0IHg9IjEwIiB5PSIxMjAiIGNsYXNzPSJiYXNlIj5TdHVkZGVkIExlYXRoZXIgR2xvdmVzPC90ZXh0Pjx0ZXh0IHg9IjEwIiB5PSIxNDAiIGNsYXNzPSJiYXNlIj5OZWNrbGFjZSBvZiBFbmxpZ2h0ZW5tZW50PC90ZXh0Pjx0ZXh0IHg9IjEwIiB5PSIxNjAiIGNsYXNzPSJiYXNlIj5Hb2xkIFJpbmc8L3RleHQ+PC9zdmc+"}

Only SVG pic in this data is supported.


Did this page help you?