Snowman::mintSnowman()
The Snowman NFTs can be infinitely minted by anybody without staking the Snow token by calling the Snowman::mintSnowman()
function directly because there is no access control in the function, meanwhile, the intended way to mint the Snowman NFT is through the SnowmanAirdrop::claimSnowman()
function.
The NFT is at risk of loosing its value since an infinite amount can be minted for FREE.
Likelihood:
High
Impact:
High
Add the below test to the TestSnowman
test suite.
This test generates a random address and calls the mintSnowman function on the nft contract, and asserts that the address indeed receives an NFT.
First, we need to pass the address of the airdrop contract into the constructor of the Snowman contract.
Secondly, in the Snowman::mintSnowman()
function, we need to ensure that the msg.sender
is the same address as the airdrop address that was passed into the constructor.
The mint function of the Snowman contract is unprotected. Hence, anyone can call it and mint NFTs without necessarily partaking in the airdrop.
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.