crytic / crytic/properties

[Feature-request]: NFT minting properties

Open
#25 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Solidity
Stars
371
Forks
59
PR merge metrics
No merged PRs in 30d

Description

### Describe the desired feature or improvement

I am reviewing a smart contract that contains a very complex logic to mint NFTs with random rarities using Chainlink VRF. Just by reading the code it is hard to understand if it correctly implements the specification. It would be nice to have pre-built echidna properties to test invariants.

In my particular example, the invariants are rather commonplace to other NFT projects, which is why I believe these are generic enough to be applied to other smart contracts:

- max NFTs per wallet: no user can have more NFTs than the max
- max NFTs minted: total supply must not exceed the max
- max NFTs per project owner: the project owner cannot have more than the max
- NFT price (in Ether, but can be extended to ERC-20 too): minting an NFT must cost exactly the NFT price
- NFT rarity: the number of NFTs minted for a given rarity must match their assigned percentages, within an error margin
- whitelist: no user can mint NFTs if they are not on the whitelist
- etc

If you think this is useful I can work on these properties and submit a PR.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.