The intended behavior of the claim() function is to ensure that each treasureHash can only be claimed once by checking the claimed mapping before allowing a reward payout.
However, the contract incorrectly checks the mapping using _treasureHash instead of the user-supplied treasureHash. Since _treasureHash is never initialized and defaults to bytes32(0), the duplicate-claim protection is broken, allowing the same treasure to be claimed multiple times.
// Root cause in the codebase with marks to highlight the relevant section
bytes32 private immutable _treasureHash; // never initialized
function claim(bytes calldata proof, bytes32 treasureHash, address payable recipient) external nonReentrant {
// Incorrect key used for validation
if (claimed[_treasureHash]) revert AlreadyClaimed(treasureHash);
}
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.
The contest is complete and the rewards are being distributed.