DatingDapp

First Flight #33
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

Issues in withdrawFees() executeTransaction(uint256 _txId) Function.

Summary
The withdrawFees() function in the provided Solidity code of LikeRegistry.sol File is not checking the Contract Balance.

Vulnerability Details
The totalFees = 0 should be after the require(success, "Transfer failed") line. This Might cause the Issue related to Transaction Failure. Cause of many issues like State Variable Gets Changed or Might Lose our Gas Fees.

executeTransaction(uint256 _txId)

The txn.executed = true;** should be after the require(success, "Transfer failed")** line. This Might cause the Issue related to Transaction Failure. Cause of many issues like State Variable Gets Changed or Might Lose our Gas Fees.

****

Tools Used
Manually

Recommendations

function withdrawFees() external nonReentrant onlyOwner {
require(totalFees > 0, "No fees to withdraw");
uint256 totalFeesToWithdraw = totalFees;
require(address(this).balance >= totalFeesToWithdraw , "insufficent balance" );
(bool success,) = payable(owner()).call{value: totalFeesToWithdraw}("");
require(success, "Transfer failed");
totalFees = 0;
}
Updates

Appeal created

n0kto Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational or Gas

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

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