Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Costly Index in BidderRegistered Event #571

Open
ckartik opened this issue Jan 17, 2025 · 2 comments
Open

Costly Index in BidderRegistered Event #571

ckartik opened this issue Jan 17, 2025 · 2 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@ckartik
Copy link
Contributor

ckartik commented Jan 17, 2025

   /// @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 ckartik added the good first issue Good for newcomers label Jan 17, 2025
@ckartik ckartik self-assigned this Jan 17, 2025
@ckartik
Copy link
Contributor Author

ckartik commented Jan 17, 2025

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
Copy link
Contributor Author

ckartik commented Jan 17, 2025

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
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant