Token-0x

First Flight #54
Beginner FriendlyDeFi
100 EXP
Submission Details
Impact: high
Likelihood: high

No Constructor; Mint / Total Supply Is Permanently Zero in ERC20.sol

Author Revealed upon completion

Description

Cconstructor sets name and symbol but never calls _mint().
Therefore:

  • _totalSupply = 0 forever

  • totalSupply()returns 0

  • Every transfer will revert (insufficient balance)

  • Token is unusable

constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}

Risk

Likelihood:

  • Functional Failure

  • Protocol Breakdown

Impact:

  • DeFi Protocols cannot distribute tokens, cannot reward users, cannot create markets as intended.

  • Token is deployed with NO supply and cannot mint afterwards.


Recommended Mitigation

Add initial mint:

+ _mint(msg.sender, initialSupply);

Or provide a mint mechanism.

Support

FAQs

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

Give us feedback!