BriVault

First Flight #52
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

BriTechToken does not have a fixed amount of token

The BriTechToken can create more token than expected

Description

  • The ERC-20 should have a fix amount of token

  • Creating more and more token lead to an inflation of the token

// Root cause in the codebase with @> marks to highlight the relevant section
@> function mint() public onlyOwner {
_mint(owner(), 10_000_000 * 1e18);
}

Risk

Likelihood:

  • Will happen when the owner is malicious

Impact:

  • Will create inflation in the token when the owner create more token

  • Other user will loose value as the token will be more diluate

Proof of Concept

As a owner I call again function mint() to create more token.

Recommended Mitigation

Call to function mint() in the constructor of the contact BriTechToken

-contract BriTechToken is ERC20, Ownable {
- constructor() ERC20("BriTechLabs", "BTT") Ownable(msg.sender) {}
-
- function mint() public onlyOwner {
- _mint(owner(), 10_000_000 * 1e18);
- }
-}
+contract BriTechToken is ERC20, Ownable {
+ constructor() ERC20("BriTechLabs", "BTT") Ownable(msg.sender) {
+ _mint(owner(), 10_000_000 * 1e18);
+ }
+}
Updates

Appeal created

bube Lead Judge 19 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!