Rock Paper Scissors

First Flight #38
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: high
Invalid

Missing Access Control on Mint Function

Description: The WinningToken::mint function in the WinningToken contract is only protected by onlyOwner , but there's no mechanism to prevent the owner from minting unlimited tokens.

Impact: The owner could mint an unlimited number of tokens, potentially devaluing the token and disrupting the game's economy.

Proof of Concept:

// Malicious owner could mint unlimited tokens
function exploitMint() external {
// As owner
winningToken.mint(attackerAddress, 1_000_000);
}

Recommended Mitigation:

// ... existing code ...
uint256 public constant MAX_SUPPLY = 1_000_000;
uint256 public totalSupply;
function mint(address to, uint256 amount) external onlyOwner {
require(totalSupply + amount <= MAX_SUPPLY, "Exceeds max supply");
totalSupply += amount;
_mint(to, amount);
}
// ... existing code ...
Updates

Appeal created

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.