Coder Social home page Coder Social logo

final-project-team-5's Introduction

KrytpoCamp 期末專案 Rookies NFT Collections


四份合約

  1. mint NFT - 大再
    • 盲盒機制、白名單機制、兩階段發售、空投機制
  2. 戰鬥場
    • Kyle
  3. 配對生育場
    • 英宗
  4. 產蛋場
    • Marco

前端頁面

  1. mint
    • 喬瑟夫
  2. 戰鬥場
    • 喬瑟夫
  3. 配對生育場
    • 喬瑟夫
  4. 產蛋場
    • 喬瑟夫

scaffold (腳手架)

喬瑟夫

專案架構

packages/vite-app-ts/ 前端專案
packages/hardhat-ts/ solidity 專案

開始專案

  1. 先到 hardhat-ts 專案下,建立一個 .env 檔 放置以下資訊
REACT_APP_PROVIDER=96d856dd85f34d76a3c4ab39fccafe9a
ACCOUNT_PRIVATE_KEY= <錢包地址>
  1. install your dependencies

    yarn install or npm install
  2. start a hardhat node

    yarn chain or npm run chain
  3. run the app, open a new command prompt

    # build hardhat & external contracts types
    yarn contracts:build or npm run contracts:build
    # deploy your hardhat contracts
    yarn deploy or npm run deploy
    # start vite
    yarn start or npm run start

How to mint (Rookies.sol)

  • add to whitelist function addToAllowList(address[] calldata addresses)
  • check mint status _isPreSaleActive, _isPublicSaleActive
  • mint function mint_presale(uint8 NUM_TOKENS_MINT), function mint_public(uint8 NUM_TOKENS_MINT)
  • Etherscan合約地址Rookies.sol

Why ERC721A

  • 節省mint gas fee,特別是針對批次mint
  • 優化 1 - Removing duplicate storage from OpenZeppelin’s (OZ) ERC721Enumerable
  • 優化 2 - updating the owner’s balance once per batch mint request, instead of per minted NFT
  • 優化 3 - updating the owner data once per batch mint request, instead of per minted NFT
  • 實作參考資料Azuki ERC721A

How to stake

  • 授權 NFT質押合約
    • NFT 合約 執行 function approve(<質押合約 地址>, tokenId)
  • 質押 NFT質押合約
    • 質押 合約 執行 function stakeNFT(_tokenID)
  • 查看獎勵
    • 質押 合約 執行 getStakingReward(<錢包 地址>)
  • 查看使用者
    • 質押 合約 執行 function getUser(<錢包 地址>)
  • 贖回 NFT
    • 質押 合約 執行 function unstakeNFT(_stakeID)
    • 查看使用者 就可以看到 _stakeID

License

This project is licensed under the MIT license.

final-project-team-5's People

Contributors

codenamejason avatar dazaic avatar dvinubius avatar grothem avatar joseph2068 avatar marcoliu1020 avatar shravansunder avatar shravansunderxero avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.