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

Missing Event Emission for updates of `profit_max_unlock_time`

Summary

scurvUSD oracle contract, we identified a missing event emission in the update_profit_max_unlock_time function. This issue impacts transparency and traceability, making it difficult to track updates to profit_max_unlock_time** **off-chain.

Impact

Improved Observability: External monitoring tools and indexers can track changes.

Enhanced Debugging: Developers can easily verify parameter updates.

Better Governance and Transparency: DAO members and stakeholders can monitor important contract changes.

Tools Used

Manual Review

Recommendations

Adding an event emission ensures better tracking of system state changes. While the absence of an event does not compromise contract security, it reduces transparency, which is essential in DeFi protocols. Implementing this fix will improve contract maintainability and monitoring capabilities.

event 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:
"""
@notice Update price using `_parameters`
@param _profit_max_unlock_time New `profit_max_unlock_time` value
@param _block_number Block number of parameters to linearize updates
@return Boolean whether value changed
"""
access_control._check_role(UNLOCK_TIME_VERIFIER, msg.sender)
# Allowing same block updates for fixing bad blockhash provided (if possible)
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)
return prev_value != _profit_max_unlock_time
Updates

Lead Judging Commences

0xnevi Lead Judge 5 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.