Skip to content

Conversation

@nicholaspai
Copy link
Member

@nicholaspai nicholaspai commented Feb 14, 2022

Percentages and timestamp-based variables can be smaller size to save gas costs for storing data

uint64 _depositQuoteTimeBuffer,
address timerAddress
address timerAddress,
uint32 _depositQuoteTimeBuffer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we default this to what we use in prod (10 mins) then remove it from the constructor? this is what I did in the hub pool: as much as posible remove the instantiation of constructor variables if we know what they will be in production. thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea lets do it

Comment on lines 45 to 52
uint32 public deploymentTime;

// Any deposit quote times greater than or less than this value to the current contract time is blocked. Forces
// caller to use an up to date realized fee.
uint64 public depositQuoteTimeBuffer;
// caller to use an up to date realized fee. Defaults to 10 minutes.
uint32 public depositQuoteTimeBuffer = 600;

// Use count of deposits as unique deposit identifier.
uint64 public numberOfDeposits;
uint32 public numberOfDeposits;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we move these down below weth, since I assume weth and all of these will be read on each deposit, so we'll end up saving one word's worth a reads by grouping them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice done

@nicholaspai nicholaspai merged commit 3c8a596 into master Feb 15, 2022
@nicholaspai nicholaspai deleted the npai/gas-golf-spoke-pool branch February 15, 2022 21:07
pxrl added a commit that referenced this pull request Feb 20, 2024
This PR is cherry-picked directly from contracts-v2/master.

Originally authored by Nick & Matt.

Signed-off-by: nicholaspai <npai.nyc@gmail.com>
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Co-authored-by: nicholaspai <9457025+nicholaspai@users.noreply.github.com>
Co-authored-by: Matt Rice <matthewcrice32@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants