mirror of
https://github.com/status-im/codex-contracts-eth.git
synced 2025-01-31 02:35:36 +00:00
19 lines
494 B
Solidity
19 lines
494 B
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity 0.8.28;
|
|
|
|
type Timestamp is uint64;
|
|
|
|
library Timestamps {
|
|
function currentTime() internal view returns (Timestamp) {
|
|
return Timestamp.wrap(uint64(block.timestamp));
|
|
}
|
|
|
|
function isAfter(Timestamp a, Timestamp b) internal pure returns (bool) {
|
|
return Timestamp.unwrap(a) > Timestamp.unwrap(b);
|
|
}
|
|
|
|
function isFuture(Timestamp timestamp) internal view returns (bool) {
|
|
return Timestamp.unwrap(timestamp) > block.timestamp;
|
|
}
|
|
}
|