RebateFi Hook

First Flight #53
Beginner FriendlyDeFi
100 EXP
View results
Submission Details
Impact: low
Likelihood: high
Invalid

`ReFiSwapRebateHook::ChangeFee` does not emit event after protocol state is changed

Root + Impact

Description

  • An event should be emitted once a state of the protocol is changed, but no events were emitted.

function ChangeFee(bool _isBuyFee, uint24 _buyFee, bool _isSellFee, uint24 _sellFee) external onlyOwner {
@> if (_isBuyFee) buyFee = _buyFee;
@> if (_isSellFee) sellFee = _sellFee;
}

Risk

Likelihood:

  • The issue occurs every time an owner changes fee.

Impact:

  • No data is provided by the protocol to any concerned third-party, reducing on-chain observability and making it harder for off-chain indexers, UIs, and auditors to track history.

Proof of Concept

function ChangeFee(bool _isBuyFee, uint24 _buyFee, bool _isSellFee, uint24 _sellFee) external onlyOwner {
@> if (_isBuyFee) buyFee = _buyFee;
@> if (_isSellFee) sellFee = _sellFee;
}

Recommended Mitigation

Add events and emit them

+event BuyFeeChanged(uint24 buyFee);
+event SellFeeChanged(uint24 sellFee);
function ChangeFee(bool _isBuyFee, uint24 _buyFee, bool _isSellFee, uint24 _sellFee) external onlyOwner {
- if (_isBuyFee) buyFee = _buyFee;
+ if (_isBuyFee) {
+ buyFee = _buyFee;
+ emit BuyFeeChanged(buyFee);
+ }
- if (_isSellFee) sellFee = _sellFee;
+ if (_isSellFee) {
+ sellFee = _sellFee;
+ emit SellFeeChanged(sellFee);
+ }
}
Updates

Lead Judging Commences

chaossr Lead Judge 12 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!