Open
Description
π§ Motivation
Time is important and off-chain there are often cases where time related checks need to be performed. To handle this on chain it would be nice to have some utils that would encapsulate these checks.
There are many use cases for this:
- Assuming we have a multisignature wallet that should only require the approval of all owners if more than a specified amount should be transferred (see https://github.com/gnosis/MultiSigWallet/blob/master/contracts/MultiSigWalletWithDailyLimit.sol). In the linked contract this limit is always the "in the last 24h" but it would be interesting to map this to a calendar day.
- Assuming we want to perform recurring transfer (see https://groundhog.network/) it makes sense to limit these to calendar dates (On the 1st of November I pay my monthly zeppelin subscription, or on the 13th of November between 1pm and 2pm the company pays me my salary).
π Details
There is a library that is already implementing this logic (https://github.com/pipermerriam/ethereum-datetime), but this is not really up to date, nor audited.
Also it would be interesting to consider edge cases like leap seconds (at least mention why they are not implemented).
An api should include method to check if what year/ month/ day/ hour/ minute a certain timestamp is.