Pieces Protocol

First Flight #32
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: high
Valid

ERC20ToGenerateNftFraccion mint() function is publicly accessible

Summary

ERC20ToGenerateNftFraccion::mint() function is publicly accessible and can be called by anyone,
which renders the token useless as anyone can mint as much tokens as they want.

Vulnerability Details
Anyone knowing the address of a given NFT in the contract can call TokenDivider::getErc20InfoFromNft with the NFT address to get the erc20Address and mint as much ERC20 tokens as they like. This leaves buyers with no incentive to buy ERC20s as they can just mint them.

Impact
High

Tools Used
Manual review

Recommendations
Restrict access to the mint function. One way to do this could be via access modifiers to allow only the owner contract TokenDivider to call the mint function.

Updates

Lead Judging Commences

fishy Lead Judge 5 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Lack of token access control chekcs

Any person can mint the ERC20 token generated in representation of the NFT

Support

FAQs

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