Midnight constructor can use msg.sender instead of reading roleSetter from storage
Summary
The constructor emits roleSetter (an SLOAD) in the event instead of msg.sender, wasting gas since they are the same value.
Vulnerability Detail
In the constructor:
constructor() {
roleSetter = msg.sender;
emit EventsLib.Constructor(roleSetter);
}roleSetter was just assigned msg.sender, so the emit reads back from storage instead of using the already-available msg.sender from the calldata.
Impact
Wastes gas on an unnecessary SLOAD in the constructor.
Code Snippet
Tool Used
Manual Review
Recommendation
constructor() {
roleSetter = msg.sender;
emit EventsLib.Constructor(msg.sender);
}