-
4.1 MerkleTree
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
- pehaps not take full potential of the gas optimation for NFTGame contract
- interface function check
- event test
- vm.expectRevert add msg
- 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
- more checklist:
- Static analysis with solhint, slither, and mythX
- 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