Description:Description
The ossify function is designed to set the ossified state to true and emit an event. However, it does not currently check if ossified is already true before performing these actions.
Impact
If ossify is called when ossified is already true, the function will emit an event unnecessarily, which could lead to incorrect event logs and potentially misleading information for users or developers relying on these logs.
Mitigation
Add a check to ensure ossified is false before setting it to true and emitting the event.
/// @inheritdoc IMetrom
function ossify() external {
if (msg.sender != owner) revert Forbidden();
+ if (ossified) revert Ossified();
ossified = true;
emit Ossify();
}
This change ensures that the ossify function only sets the state and emits the event when the contract is not already ossified, preventing redundant events and maintaining accurate logs.
Github username: @0xmahdirostami Twitter username: 0xmahdirostami Submission hash (on-chain): 0x01288c88f486123005de7b9bf0421f21ed6b77cc1495accf1bc49c91771f37d1 Severity: low
Description: Description The
ossify
function is designed to set theossified
state to true and emit an event. However, it does not currently check ifossified
is already true before performing these actions.Impact If
ossify
is called whenossified
is already true, the function will emit an event unnecessarily, which could lead to incorrect event logs and potentially misleading information for users or developers relying on these logs.Mitigation Add a check to ensure
ossified
is false before setting it to true and emitting the event.This change ensures that the
ossify
function only sets the state and emits the event when the contract is not already ossified, preventing redundant events and maintaining accurate logs.