The repository is divided into two components: Reward Contract and Deployer Contract. The Reward Contract allows users to mint their reward NFT after solving the problems, and contract will validate the signed msg to check whether it is approved by our server or not. The Deployer Contract will be used by answerers to deploy their answer contract. We can analysis the Deplyoer Contract with Dune Analytics to get the traffic status. |
---|
- Store 5 Signing key.
- Could verify the Signature which is sent from User(who has solved the problem in the DappChef and want to mint the Reward NFT).
- The params of signing msg is described in the Signing Script documentation.
- The signed-msg(signature) should be signed by the private key stored in our back-end server(or even one of other 4 keys).
- Normally, the signature produced from the Server Key, but in some special cases, who may change the main signing key to other 4 keys.
- Inherite the
ConsumeMsgContract
- NFT Contract
- When user want to mint NFT, we should use the
VerifySignature()
in theConsumeMsgContract
to check whether he/she is approved by our server or not. - We colud use the
balanceOf()
andparseMetadata
to check the Users' Answer Status. - We could use the
tokenURI()
to find the information of User's solved problems.
tokenID
will not be the number of problem, it is the number which means the sequence of being minted.
- Clone the repository:
$ git clone https://github.com/SWF-Lab/DappChef-Core-Contract.git
- Install the dependencies:
$ cd DappChef-Core-Contract && yarn
- Compile the Contracts
$ yarn compile
- Run the tests
$ yarn test
- Make sure the
.env
arguments are same as your image.
$ cp .env.example .env
- Create new branch, reference with SWF-Lab/github_practice:
$ git checkout main # Change to the main branch
$ git pull # Make sure the local code is same with the remote
$ git checkout -b add-my-context # Create new branch
- Write your code...
- Push the code to remote repo
$ git add .
$ git commit -m "add a new funcationality"
$ git push