The `afterUpdate function performs unnecessary delete operations before immediately overwriting storage slots, leading to wasted gas.
In the afterUpdate function, during array reordering:
Each iteration performs:
A delete operation which costs a full SSTORE (~5000 gas)
Immediately followed by assignment which is another SSTORE (~5000 gas)
Since the slot is immediately overwritten, the delete operation is completely unnecessary. For an array with n elements, this wastes approximately 5000 * (n-1) gas.
unnecessary gas costs for users transferring NFT positions, particularly with multiple deposits.
Manual Review
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.