The mint
function, implemented in ERC20ToGenerateNftFraccion.sol
, is publicly accessible, meaning that a malicious actor could mint an arbitrary number of tokens. This undermines the integrity of the fractionalization mechanism in the TokenDivider
contract. This results in the dilution of the token supply, exploitation of the claimNft
, sellErc20
, function residing in TokenDivider.sol
. Pieces Protocol should implement access control mechanisms in the mint
** function to only authorized addresses, for example the owner
of the contract or TokenDivider
contract.
The mint
function does not implement any access control, allowing anyone to mint ERC20 tokens.
Unrestricted minting functionality might allow the following:
Dilution of ERC20 Token value, rendering legitimate ownership meaningless.
Exploitation of TokenDivider
's sellErc20
function. After minting a large amount of ERC20 tokens, a malicious actor might sell the tokens at prices that are far below the market value, driving down the perceived value of the tokens. This causes a loss of funds on those who legitimately own tokens.
Foundry test showcases that anyone could call the mint function without any restrictions.
To mitigate this vulnerability, implement strict access control on the mint
function.
Suggested Remediated Code:
Any person can mint the ERC20 token generated in representation of the NFT
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.