Skip to content

Costly Index in BidderRegistered Event #571

Open

Description

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

Activity

  1. self-assigned this
    on Jan 17, 2025
  2. ckartik commented on Jan 17, 2025

    @ckartik
    ContributorAuthor

    Similar issue on withdrawl

    /// @dev Event emitted when a bidder withdraws their deposit
    event BidderWithdrawal(
        address indexed bidder,
        uint256 indexed window,
        uint256 indexed amount
    );
    
  3. ckartik commented on Jan 17, 2025

    @ckartik
    ContributorAuthor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions