We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mintTo
0x0x0x
basket.sol#mintTo is as follows:
basket.sol#mintTo
function mintTo(uint256 amount, address to) public nonReentrant override { require(auction.auctionOngoing() == false); require(amount > 0); uint256 startSupply = totalSupply(); require(startSupply + amount <= maxSupply); handleFees(startSupply); pullUnderlying(amount, msg.sender); _mint(to, amount); require(totalSupply() <= maxSupply); emit Minted(to, amount); }
To check, whether maxSupply is exceeded first the following statement is used:
require(startSupply + amount <= maxSupply);
At the end of the function once again, it is checked:
require(totalSupply() <= maxSupply);
Since second requirement already check whether maximum supply is exceeded, the first on is not required and consumes extra gas.
The text was updated successfully, but these errors were encountered:
0x0x0x issue #142
a37c104
I agree, the first require statement is redundant.
require
Sorry, something went wrong.
No branches or pull requests
Handle
0x0x0x
Vulnerability details
basket.sol#mintTo
is as follows:To check, whether maxSupply is exceeded first the following statement is used:
require(startSupply + amount <= maxSupply);
At the end of the function once again, it is checked:
require(totalSupply() <= maxSupply);
Since second requirement already check whether maximum supply is exceeded, the first on is not required and consumes extra gas.
The text was updated successfully, but these errors were encountered: