vault: reduce size of timestamp further

This commit is contained in:
Mark Spanbroek 2025-02-05 16:14:08 +01:00
parent 0237b640e7
commit 3064b1468c

View File

@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
type Timestamp is uint64;
type Duration is uint64;
type Timestamp is uint40;
type Duration is uint40;
using {_timestampEquals as ==} for Timestamp global;
using {_timestampNotEqual as !=} for Timestamp global;
@ -27,7 +27,7 @@ function _timestampAtMost(Timestamp a, Timestamp b) pure returns (bool) {
library Timestamps {
function currentTime() internal view returns (Timestamp) {
return Timestamp.wrap(uint64(block.timestamp));
return Timestamp.wrap(uint40(block.timestamp));
}
function until(