We can save gas if we use a smaller datatype for the two timestamps (maturationTimestamp and depositTimestamp). I can also change this to uint64, if you consider uint32 too small (year 2038).
It does help a bit for deposit, rolloverDeposit and withdraw (between 2 % and 3.5 %), but it makes the deployments slightly more expensive.
If you would consider this PR, shall we use uint32 or uint64 for the timestamps?
Can maybe fundingID also shortened? If we use uint64 for all 3 variables, they would fit together in one slot.
Edit: I also talked about changing averageRecordedIncomeIndex to uint64, but I was mislead by Index - it should rather stay uint256.
We can save gas if we use a smaller datatype for the two timestamps (
maturationTimestamp
anddepositTimestamp
). I can also change this touint64
, if you consideruint32
too small (year 2038).Gas changes:
It does help a bit for
deposit
,rolloverDeposit
andwithdraw
(between 2 % and 3.5 %), but it makes the deployments slightly more expensive.If you would consider this PR, shall we use uint32 or uint64 for the timestamps? Can maybe
fundingID
also shortened? If we useuint64
for all 3 variables, they would fit together in one slot.Edit: I also talked about changing
averageRecordedIncomeIndex
to uint64, but I was mislead byIndex
- it should rather stay uint256.