Skip to content

Latest commit

 

History

History
74 lines (68 loc) · 2.86 KB

metadata.md

File metadata and controls

74 lines (68 loc) · 2.86 KB

Metadata

Problems Template

FileName: problem<problemNumber>.json (e.g. problem997.json)

If your function is Write Function (calling this function will change the state), your expectReturn should be [] (empty array).

{
    "problemNumber": "<int>, number of this problem",
    "problemVersion": "<int>, support dappchef version of this problem",
    "description": "<str>, What user sholud do in this problem, which means problem statement",
    "constructorCallData": "<array <array>>, calldata types and value",
    "problemSolution": [
        {
            "methodName": "<str>, MethodName",
            "callData": "<array>, callData",
            "expectReturn": "<any>, the return of calling the Method with the callData"
         },
        {
            "methodName": "<str>, MethodName",
            "callData": "<array>, callData",
            "expectReturn": "<any>, the return of calling the Method with the callData"
         },
        {
            "methodName": "<str>, MethodName",
            "callData": "<array>, callData",
            "expectReturn": "<any>, the return of calling the Method with the callData"
         }
    ],
    "attributes": [
        {
          "trait_type": "difficulty", 
          "value": "<int>, difficulty of this problem, 1~3",
        },
        {
          "trait_type": "class", 
          "value": "<str>, class of this problem, see problems classification instructions part",
        } 
    ],
    "image": "<str>, ipfs://<ipfsPrefix>/<problemNumber>, which means the NFT image location",
}
  1. The num of operations in the problemSolution is unlimited, if the problem is very complicated, the length of problemSolution: Array.length could be very long.
  2. This metadata conforms to the OpenSea Format which can show the attributes successfullty.

Reward NFT Metadata

{
    "name": "DappChef Rewards NFT #<problemNumber>",
    "description": "DappChef is a Ethereum Smart Contract Development Learning platform. Solve the coding problem, then you can mint the Reward NFT!",
    "solver": "<address>, the problem solve",
    "approver": "<address>, the key address storing in the server to sign(approve) minting request now",
    "problemSolvedTimestamp": "<int>, the timestamp which user solved the problem",
    "attributes": [
        {
          "display_type": "number", 
          "trait_type": "problemNumber", 
          "value": "<int>, number of this problem",
        },
        {
          "trait_type": "difficulty", 
          "value": "<int>, difficulty of this problem, 1~3",
        },
        {
          "trait_type": "class", 
          "value": "<str>, class of this problem, see problems classification instructions part",
        }, 
    ],
    "image": "<str>, ipfs://<ipfsPrefix>/<problemNumber>, which means the NFT image location",
}