15,000 USDC
View results
Submission Details
Severity: gas
Valid

Returns Bool

Summary

Remove the returns (bool) from the mint function because, it always returns true and is not necessary.

Vulnerability Details

Remove returns(bool) from the below function =>
function mint(address _to, uint256 _amount) external onlyOwner returns (bool) {
if (_to == address(0)) {
revert DecentralizedStableCoin__NotZeroAddress();
}
if (_amount <= 0) {
revert DecentralizedStableCoin__MustBeMoreThanZero();
}
_mint(_to, _amount);
return true;
}

Impact

The return value is not necessary and removing it will save some gas. And, it will also make the code cleaner and easier to read as it removes an unnecessary line of code.

Tools Used

Manual Review

Recommendations

Support

FAQs

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