Coder Social home page Coder Social logo

week2_nft_staking_security's Introduction

Week 2: Nonfungible Token Extensions, Staking, and Security

Files Info

  1. ERC721A.md

  2. Wrapped_NFT_Pattern

  3. NFT_EVENT.md

  4. SmartContractTrio

    4.1 MerkleTree

  5. NFTEnumerableContracts

  6. CTFs

    6.1 Overmint1Attacker

    6.2 Overmint2Attacker

  7. gas_profile.png

  8. forge_coverage

src
├──  SmartContractTrio
│   ├── NFT721.sol
│   ├── RewardToken.sol
│   └── StakingContract.sol
├── CTFs
│   ├── Overmint1.sol
│   ├── Overmint2.sol
│   └── test.sol
└── NFTEnumerableContracts
    ├── NFTCollection.sol
    └── NFTGame.sol

test
├──  SmartContractTrio.t
│   ├── NFT721.t.sol
│   └── StakingContract.t.sol
├── CTFs.Attacker.t
│   ├── Overmint1Attacker.sol
│   └── Overmint2Attacker.sol
└── NFTEnumerableContracts.t
    ├── NFTCollection.t.sol
    └── NFTGame.t.sol

script/MerkleTree/
├── createMerkleProof.js
├── createMerkleTree.js
└── tree.json


todo

  1. pehaps not take full potential of the gas optimation for NFTGame contract
  2. interface function check
  3. event test
  4. vm.expectRevert add msg
  5. foundry more test feature usages https://www.rareskills.io/post/foundry-testing-solidity https://www.rareskills.io/post/foundry-forge-coverage 4.1 forge_coverage should add more 4.2 Mutation Test
  6. more checklist:
    1. Static analysis with solhint, slither, and mythX

reference:

https://betterprogramming.pub/the-ultimate-100-point-checklist-before-sending-your-smart-contract-for-audit-af9a5b5d95d0 checking

new adds

  • Calcualting the rewards is based one tokenId, which means how long the NFT has staked. But if one user send many NFTs to the stakingContract, and how to calculating the rewards while there are many NFTs for one user. The current implementation is calculating each tokenId's rewards then add all. Such as all tokenId's rewards math formula are same, so can have the more efficient way calculating the rewards. So I think this implementaion should adjust. using other data structure?? 20240112

reference: https://portal.thirdweb.com/contracts/build/extensions/erc-721/ERC721Staking

week2_nft_staking_security's People

Contributors

sodexx7 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.