RebateFi Hook

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

The ReFiSwapRebateHook::ChangeFee function does not emit an event, state variable change without event

ChangeFee modifies critical pricing parameters without emitting events, off-chain systems have no reliable way to track fee changes

Description

  • The ChangeFee function allows the owner to update the global buyFee and/or sellFee used by the hook to override the pool’s swap fee.

  • These values directly determine the core economic behavior of every ReFi pool using this hook (rebates, incentives, revenue).

  • No events are emitted when either fee is changed, making it impossible for indexers, frontends, analytics platforms, or bots to reliably detect and react to fee updates without constantly reading storage.

// Root cause in the codebase with @> marks to highlight the relevant section
function ChangeFee(bool _isBuyFee, uint24 _buyFee, bool _isSellFee, uint24 _sellFee) external onlyOwner {
@> if (_isBuyFee) buyFee = _buyFee;
@> if (_isSellFee) sellFee = _sellFee;
}

Risk

Likelihood:

  • Every legitimate fee adjustment by the owner triggers the issue

  • Off-chain services (The Graph, Dune, internal dashboards, trading bots) depend on events for real-time updates

Impact:

  • Indexers show stale or incorrect fee values until they manually rescan storage

  • Users and frontends display wrong trading fees, leading to confusion or failed transactions

  • Revenue tracking, rebate calculations, and promotional campaigns become inaccurate or delayed

  • Reduced transparency and trust signal for a fee-bearing hook

Proof of Concept

Recommended Mitigation

Consider emitting an event to enable offchain indexers to track the changes.

event TokensWithdrawn(address indexed token, address indexed to, uint256 amount);
+ event BuyFeeChanged(uint24 newBuyFee);
+ event SellFeeChanged(uint24 newSellFee);
.
.
.
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 11 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!