Sablier

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

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() {
_preventDelegateCall();
_;
}
/// @dev This function checks whether the current call is a delegate call, and reverts if it is.
///
/// - A private function is used instead of inlining this logic in a modifier because Solidity copies modifiers into
/// every function that uses them. The `ORIGINAL` address would get copied in every place the modifier is used,
/// which would increase the contract size. By using a function instead, we can avoid this duplication of code
/// and reduce the overall size of the contract.
function _preventDelegateCall() private view {
if (address(this) != ORIGINAL) {
+ emit DelegateCallAttempt(msg.sender);
revert Errors.DelegateCall();
}
}
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Info/Gas/Invalid as per Docs

https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity

Support

FAQs

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