**Severity: **Low (Affects transparency, debugging, and security monitoring)
**Impact: **Moderate (Compromises protocol monitoring and analytics)
**Category: **Logging / Event Emission
Several functions in the PerpetualVault
smart contract fail to emit critical events, reducing visibility into protocol operations. Missing event emissions hinder off-chain monitoring, debugging, and incident detection.
Missing Events:
deposit()
: No event for deposit initiation.
withdraw()
: No event when a user requests a withdrawal.
run()
: No event for position signals (long/short/close).
runNextAction()
: No event when executing nextAction
.
cancelFlow()
: No event for flow cancellations.
_createIncreasePosition()
, _createDecreasePosition()
: No event for position initiation.
afterOrderExecution()
: No event when an order is fully executed.
_settle()
: No event when settlement begins.
_handleReturn()
: No detailed withdrawal completion event.
Monitoring Failure: Off-chain trackers can't monitor vault activities.
Debugging Difficulty: Developers face challenges identifying issues.
Security Risks: Delayed detection of malicious activity.
Analytics Loss: Historical activity data becomes incomplete.
Manual Review
deposit()
– Emit DepositInitiated()
.
withdraw()
– Emit WithdrawalRequested()
.
run()
– Emit SignalChange()
.
runNextAction()
– Emit NextActionExecuted()
.
cancelFlow()
– Emit FlowCancelled()
.
_createIncreasePosition()
– Emit PositionIncreaseInitiated()
.
_createDecreasePosition()
– Emit PositionDecreaseInitiated()
.
afterOrderExecution()
– Emit OrderExecutionCompleted()
.
_settle()
– Emit SettlementInitiated()
.
_handleReturn()
– Emit WithdrawalCompleted()
.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.