Eggstravaganza

First Flight #37
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

Potential Reentrancy, State change after external call in `EggVault::depositEgg`

Description:
The EggHuntGame::depositEggToVault(uint256 tokenId) function calls the eggNFT.transferFrom() (external call), then proceeds to call depositEgg(), which updates critical state variables. In this case, EggstravaganzaNFT is a trusted contract with no reentrant behavior and transferFrom() does not invoke external code. However, the pattern should be treated with caution.

Recommended Mitigation:
Apply the nonReentrant modifier (from OpenZeppelin’s ReentrancyGuard) on depositEgg() and withdrawEgg() for extra protection.

contract EggVault is Ownable, ReentrancyGuard {
...
function depositEgg(...) public nonReentrant { ... }
}
Updates

Lead Judging Commences

m3dython Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

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

Give us feedback!