-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Description
In CashAsset::disableWithdrawFee(), the event WithdrawFeeDisabled is emitted even in case the exchangeRate is below 1e18 and the temporaryWithdrawFeeEnabled is not yet set to false.
Impact
Low: This can lead to incorrect assumptions in off-chain infrastructure due to incorrect events
Recommendation
Updating the code to only emit an event in case the if() is entered.
/**
* @notice Disable withdraw fee when the cash asset is back to being solvent
*/
function disableWithdrawFee() external {
uint exchangeRate = _getExchangeRate();
if (exchangeRate >= 1e18 && temporaryWithdrawFeeEnabled) {
temporaryWithdrawFeeEnabled = false;
smFeePercentage = previousSmFeePercentage;
emit WithdrawFeeDisabled(exchangeRate);
}
}
References
https://github.com/lyra-finance/v2-core/blob/master/src/assets/CashAsset.sol#L274
Metadata
Metadata
Assignees
Labels
No labels