Sablier

Sablier
DeFiFoundry
53,440 USDC
View results
Submission Details
Severity: low
Invalid

Lack of Event Emission on Delegate Call Reversion

[L-3] Lack of Event Emission on Delegate Call Reversion
Description:
The _preventDelegateCall function reverts with a custom error Errors.DelegateCall but does not emit any event to log the occurrence of a delegate call attempt.

Impact:
Without an event emission, it becomes difficult to track and analyze delegate call attempts, hindering monitoring and debugging.

Proof of Concept:
Interact with the contract and observe that no event is emitted when a delegate call is prevented.

Recommended Mitigation:
Emit an event when a delegate call is detected and prevented.

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.22;
import { Errors } from "../libraries/Errors.sol";
/// @title NoDelegateCall
/// @notice This contract implements logic to prevent delegate calls.
abstract contract NoDelegateCall {
/// @dev The address of the original contract that was deployed.
address private immutable ORIGINAL;
/// @dev Event to log delegate call attempts
+ event DelegateCallAttempt(address indexed caller);
/// @dev Sets the original contract address.
constructor() {
ORIGINAL = address(this);
}
/// @notice Prevents delegate calls.
modifier noDelegateCall() {
+ if (address(this) != ORIGINAL) {
+ emit DelegateCallAttempt(msg.sender);
+ revert Errors.DelegateCall();
+ }
_;
}
}
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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