DeFiFoundry
50,000 USDC
View results
Submission Details
Severity: low
Invalid

Missing `ExecutionFeeRefundFailed` Event Emission on refundExecutionFee Failure

Description

The try...catch block for IGmxProxy(gmxProxy).refundExecutionFee does not emit ExecutionFeeRefundFailed event when the function fails. This makes it difficult to detect and debug refund failures, especially for off-chain monitoring systems.

function _cancelFlow() internal {
if (flow == FLOW.DEPOSIT) {
uint256 depositId = counter;
collateralToken.safeTransfer(depositInfo[depositId].owner, depositInfo[depositId].amount);
totalDepositAmount = totalDepositAmount - depositInfo[depositId].amount;
EnumerableSet.remove(userDeposits[depositInfo[depositId].owner], depositId);
try IGmxProxy(gmxProxy).refundExecutionFee(
depositInfo[counter].owner,
depositInfo[counter].executionFee
@=> ) {} catch {}
delete depositInfo[depositId];
} else if (flow == FLOW.WITHDRAW) {
try IGmxProxy(gmxProxy).refundExecutionFee(
depositInfo[counter].owner,
depositInfo[counter].executionFee
) {} catch {}
}
// Setting flow to liquidation has no meaning.
// The aim is to run FINAIZE action. (swap indexToken to collateralToken);
flow = FLOW.LIQUIDATION;
nextAction.selector = NextActionSelector.FINALIZE;
}

Impact:

Silent failures make it harder to track unsuccessful refund attempts.
Lack of transparency in contract execution.
Potential loss of funds if failures go unnoticed.

Recommendation

Emit ExecutionFeeRefundFailed event inside the catch block to log refund failures. This will help with debugging and off-chain tracking.

Suggested Fix:
Modify the catch block to include an event emission:

try IGmxProxy(gmxProxy).refundExecutionFee(
depositInfo[counter].owner,
depositInfo[counter].executionFee
) {} catch {
+ emit ExecutionFeeRefundFailed(depositInfo[counter].owner, depositInfo[counter].executionFee);
}
Updates

Lead Judging Commences

n0kto Lead Judge 8 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 likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

n0kto Lead Judge 8 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 likelihood 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.