Eggstravaganza

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

gameContract contract address can be updated at any time

[M-4] gameContract contract address can be updated at any time

Description: EggstravaganzaNFT:setGameContract can be called and change the address of the game contract at any time.

Impact: If the gameContract is set to a new address after mintEgg has been called, the original game contract would no longer be able to mint Eggs.

Recommended Mitigation: Pass in the gameContract contract address to the EggstravaganzaNFT contructor to ensure it is initialized and remove the EggstravaganzaNFT:setGameContract function.

+ constructor(string memory _name, string memory _symbol, address _gameContract)
ERC721(_name, _symbol) Ownable(msg.sender);
+ gameContract = _gameContract;
- constructor(string memory _name, string memory _symbol)
ERC721(_name, _symbol) Ownable(msg.sender)
Updates

Lead Judging Commences

m3dython Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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