Skip to content

🍩 DappChef is a Ethereum Smart Contract Development Learning platform.

Notifications You must be signed in to change notification settings

SWF-Lab/DappChef-Core-Contract

Repository files navigation

🍩 DappChef Contract

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.

Requirements

ConsumeMsg Contract

  1. Store 5 Signing key.
  2. Could verify the Signature which is sent from User(who has solved the problem in the DappChef and want to mint the Reward NFT).
  3. The params of signing msg is described in the Signing Script documentation.
  4. The signed-msg(signature) should be signed by the private key stored in our back-end server(or even one of other 4 keys).
  5. Normally, the signature produced from the Server Key, but in some special cases, who may change the main signing key to other 4 keys.

Reward Contract

  1. Inherite the ConsumeMsgContract
  2. NFT Contract
  3. When user want to mint NFT, we should use the VerifySignature() in the ConsumeMsgContract to check whether he/she is approved by our server or not.
  4. We colud use the balanceOf() and parseMetadata to check the Users' Answer Status.
  5. 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.

🛠 Start Your Journey

Start the App

  1. Clone the repository:
$ git clone https://github.com/SWF-Lab/DappChef-Core-Contract.git
  1. Install the dependencies:
$ cd DappChef-Core-Contract && yarn
  1. Compile the Contracts
$ yarn compile
  1. Run the tests
$ yarn test
  1. Make sure the .env arguments are same as your image.
$ cp .env.example .env

Start the Development

  1. 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
  1. Write your code...
  2. Push the code to remote repo
$ git add .
$ git commit -m "add a new funcationality"
$ git push

About

🍩 DappChef is a Ethereum Smart Contract Development Learning platform.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published