BriVault

First Flight #52
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Return value from `_setFinallizedVaultBalance::BriVault` is not used anywhere in the contract

Root + Impact : _setFinallizedVaultBalance::BriVault is returning uint256 but the return value is not used in the contract anywhere, wasting gas fee.

Description

  • In the function _setFinallizedVaultBalance::BriVault ,the return value is not used anywhere this function is being called and is an internal function, so it's a waste of gas fee.

contract BriVault is ERC4626, Ownable {
...
@> function _setFinallizedVaultBalance() internal returns (uint256) {
if (block.timestamp <= eventStartDate) {
revert eventNotStarted();
}
@> return finalizedVaultAsset = IERC20(asset()).balanceOf(address(this));
}
...
}

Risk

Likelihood: Low

Impact: Low

Recommended Mitigation

  • Remove the return value and the returns(uint256) from the main function signature.

contract BriVault is ERC4626, Ownable {
...
- function _setFinallizedVaultBalance() internal returns (uint256) {
+ function _setFinallizedVaultBalance() internal {
if (block.timestamp <= eventStartDate) {
revert eventNotStarted();
}
- return finalizedVaultAsset = IERC20(asset()).balanceOf(address(this));
}
...
}
Updates

Appeal created

bube Lead Judge 21 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Gas optimizations

Gas optimizations are invalid according to the CodeHawks documentation.

Support

FAQs

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

Give us feedback!