Beatland Festival

First Flight #44
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Use of too many mappings

Root + Impact

Description

The code uses too many mappaing object to hold values related to the pass.
should create a sing pass object/struct and the track them using one mapping.
// Pass data
mapping(uint256 => uint256) public passSupply; // Current minted
mapping(uint256 => uint256) public passMaxSupply; // Max allowed
mapping(uint256 => uint256) public passPrice;


Impact:

Not a very gas efficient design


Proof of Concept

Recommended Mitigation

- mapping(uint256 => uint256) public passSupply; // Current minted
- mapping(uint256 => uint256) public passMaxSupply; // Max allowed
- mapping(uint256 => uint256) public passPrice;
+ struct Pass{
uint256 supply;
uint256 maxSupply;
uint256 passPrice;
}
+ mapping(uint256 => Pass) passes
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.