Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 527 Bytes

1-Non-Critial.md

File metadata and controls

28 lines (20 loc) · 527 Bytes

Non-Critial Issues

NC001 - Functions Mutating Storage Should Emit Events

Description

Functions mutating storage should emit an Event for easy off-chain monitoring.

Example

🤦 Bad:

function setFee(uint256 _fee) external onlyOwner {
    fee = _fee;
}

🚀 Good:

function setFee(uint256 _fee) external onlyOwner {
    emit ChangedFee(fee, _fee);
    fee = _fee;
}

Background Information