DeFiLayer 1Layer 2
14,723 OP
View results
Submission Details
Severity: low
Valid

Missing Event Emission in update_profit_max_unlock_time

Summary

The function update_profit_max_unlock_time modifies the state variable profit_max_unlock_time but does not emit an event after the state change. This lack of event emission can impact integration with external systems.

Vulnerability Details

@external
def update_profit_max_unlock_time(_profit_max_unlock_time: uint256, _block_number: uint256) -> bool:
access_control._check_role(UNLOCK_TIME_VERIFIER, msg.sender)
assert self.last_block_number <= _block_number, "Outdated"
self.last_block_number = _block_number
prev_value: uint256 = self.profit_max_unlock_time
self.profit_max_unlock_time = _profit_max_unlock_time
return prev_value != _profit_max_unlock_time # No event emitted

The function modifies a critical contract parameter (profit_max_unlock_time) but does not emit an event.

Impact

This makes it harder to track updates on-chain, as external listeners (indexers, monitoring tools, governance participants) must manually query storage instead of subscribing to an event.

Tools Used

Manual

Recommendations

+ ProfitMaxUnlockTimeUpdated:
+ old_value: uint256
+ new_value: uint256
+ block_number: uint256
@external
def update_profit_max_unlock_time(_profit_max_unlock_time: uint256, _block_number: uint256) -> bool:
access_control._check_role(UNLOCK_TIME_VERIFIER, msg.sender)
assert self.last_block_number <= _block_number, "Outdated"
self.last_block_number = _block_number
prev_value: uint256 = self.profit_max_unlock_time
self.profit_max_unlock_time = _profit_max_unlock_time
+ log ProfitMaxUnlockTimeUpdated(prev_value, _profit_max_unlock_time, _block_number) # ✅ Emit event
return prev_value != _profit_max_unlock_time
Updates

Lead Judging Commences

0xnevi Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-missing-event-emission-profit_max_unlock_time

I believe low severity to be appropriate here, events could be used to be more explicit for the upcoming effects on price for changes in max unlock time, similar to as included in `update_price` with the `PriceUpdate` event

Appeal created

bauchibred Auditor
3 months ago
oluwaseyisekoni Submitter
3 months ago
0xnevi Lead Judge
3 months ago
0xnevi Lead Judge about 2 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-missing-event-emission-profit_max_unlock_time

I believe low severity to be appropriate here, events could be used to be more explicit for the upcoming effects on price for changes in max unlock time, similar to as included in `update_price` with the `PriceUpdate` event

Support

FAQs

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