DeFiFoundry
20,000 USDC
View results
Submission Details
Severity: high
Invalid

Incorrect token minting recipient in FjordToken contract

Summary

Incorrect token minting recipient in FjordToken contract.

Vulnerability Details

In the FjordToken contract, the initial token supply is minted to the deployer of the contract (msg.sender) instead of the FjordAuction contract.

contract FjordToken is ERC20 {
constructor() ERC20("Fjord Foundry", "FJO", 18) {
_mint(msg.sender, 100_000_000 ether);
}
}

https://github.com/Cyfrin/2024-08-fjord/blob/0312fa9dca29fa7ed9fc432fdcd05545b736575d/src/FjordToken.sol#L6C1-L10C2

The constructor mints the initial token supply to msg.sender, which is the address deploying the FjordToken contract.

Impact

The FjordAuction contract will not have the tokens it needs to transfer.

Tools Used

Manual review

Recommendations

Modify the FjordToken constructor to accept the FjordAuction contract address and mint tokens directly to it.

Updates

Lead Judging Commences

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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