Nothing Special   »   [go: up one dir, main page]

Skip to content

Smart contracts for NDWoodArt, including but not limited to DAO voting, Gacha, Smart Account, Membership-Card, Points.

Notifications You must be signed in to change notification settings

DERACHAIN/ndwoodart

Repository files navigation

NDWoodArt

Smart contracts for NDWoodArt, including but not limited to DAO voting, Gacha, Smart Account, Membership, Points.

Prerequisites

Setup

  • Install npm dependencies
$ npm install
  • Create .env file from template
$ cp .env.example .env
  • Fulfill credentials and secrets to .env file

Compile

  • Compile smart contracts
$ npx hardhat compile

Test

  • Execute Unit tests
$ npx hardhat test
  • Generate coverage report
$ npx hardhat coverage

Deploy

  • (Hardhat local) Spin up local Hardhat node
$ npx hardhat node
  • (Real networks) Add supported chain config to hardhat.config.ts
const config: HardhatUserConfig = {
  networks: {
    bnb_testnet: {
      url: "https://data-seed-prebsc-1-s1.bnbchain.org:8545",
      chainId: 97,
      accounts: [privateKeyFromEnv]
    },
  }
}

Deploy contract:

  • Contract NDWoodArt Point (NDL)
KIND=erc20 NAME="NDWoodArt Point" SYMBOL=NDL DECIMALS=18 npx hardhat run ./scripts/deploy-contract.ts --network derachain

Verify contract:

npx hardhat verify <contract address> "NDWoodArt Point" NDL 18 --network derachain
  • Contract NDWoodArt 1155 (for gacha, traits)
KIND=erc1155 NAME="NDWoodArt Items" SYMBOL=NDI npx hardhat run ./scripts/deploy-contract.ts --network derachain

Verify contract:

npx hardhat verify <contract address> "NDWoodArt Items" NDI --network derachain
  • NDWoodArt Membership Card (NDMC): Membership NFT contract is a Collection of NFT2 Prococol. To deploy NFT2 Collection follow this guide

Deploy Implementation:

  • Deploy Thread Voting (DAO Voting Implementation)
KIND=threadVoting npx hardhat run ./scripts/deploy-implementation.ts --network derachain

Deploy Factory

  • Deploy Thread Factory
KIND=thread npx hardhat run ./scripts/deploy-factory.ts --network derachain

Cleanup

  • Cleanup smart contracts artifacts
$ npx hardhat clean

Troubleshoot

  • Deployment is sometimes failed due to networks congestion, the solution is needing to wait for traffic restabilize and redeploy.

License

Copyright belongs to DareNFT - Alpha Waves PTE. LTD, 2023

About

Smart contracts for NDWoodArt, including but not limited to DAO voting, Gacha, Smart Account, Membership-Card, Points.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published