Eggstravaganza

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

Centralization Risk for trusted game owners, game owner can easily manipulate the `searchEgg` outcome by MEV changing the `eggFindThreshold` to 0 or 100

Description: game owner can set the eggFindThreshold at any time, when it is 0, all searchEgg calls will fail, when it is 100, all searchEgg calls will succeed.
game owner can use MEV to manipulate the outcome of any users searchEgg calls.

Impact: This breaks the fairness of the game, allowing the game owner to control the outcome of the egg hunt.

Proof of Concept: add following test and run it

function testGameOwnerManipulateSearchEgg() public {
vm.startPrank(gameOwner);
game.startGame(GAME_DURATION);
game.setEggFindThreshold(0); // front run let alice fail to find egg
vm.stopPrank();
vm.startPrank(alice);
game.searchForEgg();
vm.stopPrank();
assertEq(nft.balanceOf(alice), 0); // no egg found
vm.startPrank(gameOwner);
game.setEggFindThreshold(100); // front run let bob find egg
vm.stopPrank();
vm.startPrank(bob);
game.searchForEgg();
assertTrue(nft.ownerOf(1) == bob); // successful search egg
}

Recommended Mitigation:
reconsider the game logic, like once game start, the game should not be stop till end time and the eggFindThreshold should not be changed.

Updates

Lead Judging Commences

m3dython Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

Trusted Owner

Owner is trusted and is not expected to interact in ways that would compromise security

Support

FAQs

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

Give us feedback!