This review addresses the absence of an array to store the IDs of active estates in the NFTFactory
smart contract. Storing active estate IDs in an array allows for efficient management and checking of estate existence.
Description : The contract does not maintain an array to store active estate IDs. This makes it difficult to efficiently check if an estate exists before burning it.
Impact : Without an array, the contract cannot efficiently verify the existence of an estate ID, leading to potential errors and inefficiencies.
Incorrect Estate Burning : Attempting to burn a non-existent estate ID can lead to errors and unexpected behavior, causing the transaction to fail.
IDs Stuck : Without proper management of active estate IDs, certain IDs may become stuck and cannot be burned, leading to inconsistencies in the contract state.
Inefficient Management : Without an array, managing active estate IDs becomes inefficient.
Manual Code Review
Add an Array to Store Active Estate IDs after calling the createEstate
function
Check if id
exists in the activeEstates
array in the burnEstate
function
Use a linear search to find the ID and remove it by moving the last element to the current position and popping the array. For instance:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.