crates/lint/docs/missing-events-arithmetic.md
Severity: Low
ID: missing-events-arithmetic
Flags protected entry-point functions that update tainted integer state used in arithmetic by an unprotected function without emitting an event.
This lint looks for scalar int/uint state variables that are:
It intentionally skips fixed-value writes, constructors, unprotected setters, mappings/arrays, and
update paths that emit an event directly or through an internal helper. Those limits keep the rule
focused on Slither's low-severity events-maths case while avoiding common false positives.
Off-chain monitors, users, and auditors often rely on events to track changes to critical contract parameters such as prices, fees, caps, and rates. If a protected function silently changes a parameter used in calculations, downstream behavior can change without an easy audit trail.
function setBuyPrice(uint256 newBuyPrice) external onlyOwner {
buyPrice = newBuyPrice;
}
event BuyPriceUpdated(uint256 newBuyPrice);
function setBuyPrice(uint256 newBuyPrice) external onlyOwner {
buyPrice = newBuyPrice;
emit BuyPriceUpdated(newBuyPrice);
}