mev-commit
mev-commit copied to clipboard
Costly Index in BidderRegistered Event
/// @dev Event emitted when a bidder is registered with their deposited amount
event BidderRegistered(
address indexed bidder,
uint256 indexed depositedAmount,
uint256 indexed windowNumber
);
The event that tracks Bidder Registrations when they submit new funds to a window or set of windows, has the deposited amount indexed, this costs 375 gas, which is unnecessary, especially considering how frequently this event is fired.
Similar issue on withdrawl
/// @dev Event emitted when a bidder withdraws their deposit
event BidderWithdrawal(
address indexed bidder,
uint256 indexed window,
uint256 indexed amount
);
We should also be tracking the amount of funds being added here, which we're not. We only track net funds in the window.