mev-commit icon indicating copy to clipboard operation
mev-commit copied to clipboard

Costly Index in BidderRegistered Event

Open ckartik opened this issue 1 year ago • 2 comments

   /// @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.

ckartik avatar Jan 17 '25 18:01 ckartik

Similar issue on withdrawl

/// @dev Event emitted when a bidder withdraws their deposit
event BidderWithdrawal(
    address indexed bidder,
    uint256 indexed window,
    uint256 indexed amount
);

ckartik avatar Jan 17 '25 18:01 ckartik

We should also be tracking the amount of funds being added here, which we're not. We only track net funds in the window.

ckartik avatar Jan 17 '25 18:01 ckartik