crates/lint/docs/missing-events-access-control.md
Severity: Low
ID: missing-events-access-control
Flags protected entry-point functions that update state used for access control without emitting an event.
This lint looks for mutable state variables that are:
msg.sender or tx.origin,msg.sender, another access-control state variable, or a keyed
mapping write, directly or through local aliases/internal helpers, andIt intentionally skips constructors, unprotected setters, variables not used in authorization
checks, unrelated events, and fixed writes other than clearing the state variable currently used by
the access guard. Those limits keep the rule focused on Slither's low-severity events-access case
while avoiding common false positives.
Off-chain monitors, users, and auditors often rely on events to track changes to owners, guardians, roles, and other authority-bearing state. If a protected function silently changes access control, critical permission updates are harder to review and investigate.
function transferOwnership(address newOwner) external onlyOwner {
owner = newOwner;
}
event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);
function transferOwnership(address newOwner) external onlyOwner {
address oldOwner = owner;
owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}