Smart contracts for NDWoodArt, including but not limited to DAO voting, Gacha, Smart Account, Membership, Points.
- Install npm dependencies
$ npm install
- Create .env file from template
$ cp .env.example .env
- Fulfill credentials and secrets to .env file
- Compile smart contracts
$ npx hardhat compile
- Execute Unit tests
$ npx hardhat test
- Generate coverage report
$ npx hardhat coverage
- (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]
},
}
}
- 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 Thread Voting (DAO Voting Implementation)
KIND=threadVoting npx hardhat run ./scripts/deploy-implementation.ts --network derachain
- Deploy Thread Factory
KIND=thread npx hardhat run ./scripts/deploy-factory.ts --network derachain
- Cleanup smart contracts artifacts
$ npx hardhat clean
- Deployment is sometimes failed due to networks congestion, the solution is needing to wait for traffic restabilize and redeploy.
Copyright belongs to DareNFT - Alpha Waves PTE. LTD, 2023