This repository has been archived by the owner on Dec 22, 2024. It is now read-only.
whitehair0330 - Incorrect calculation of the lossFee
in the GasProcess.processExecutionFee()
function.
#166
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Sponsor Disputed
The sponsor disputed this issue's validity
Won't Fix
The sponsor confirmed this issue will not be fixed
whitehair0330
Medium
Incorrect calculation of the
lossFee
in theGasProcess.processExecutionFee()
function.Summary
In the
processExecutionFee()
function, thelossFee
is always miscalculated to 0.Vulnerability Detail
At
L24
, thelossFee
is calculated. However, theexecutionFee
was already adjusted to the same value asuserExecutionFee
. Consequently, thelossFee
is consistently calculated as 0. This leads to the inaccurate modification of theCommonData
.Impact
The incorrect calculation of the
lossFee
leads to the improper modification of theCommonData
.Code Snippet
https://github.com/sherlock-audit/2024-05-elfi-protocol/blob/main/elfi-perp-contracts/contracts/process/GasProcess.sol#L17-L41
Tool used
Manual Review
Recommendation
The
GasProcess.processExecutionFee()
function should be fixed as follows.Duplicate of #108
The text was updated successfully, but these errors were encountered: