Following the work on EIP-5805, we decided to spin off the clock part as its own EIP
Hey @Amxx I have a few questions/suggestions if you dont mind:
Why state that it must be “not decreasing” — why not say monotonically increasing?
Their does not seem to be support for sub second precision, which is actually available in Quorum.
I have seen contracts that actually use different time standards than the normal civilian UTC
I have seen use cases for having timestamps in WAD
I also have a proposal still in draft for a different timestamp unit
Finally, GitHub - bokkypoobah/BokkyPooBahsDateTimeLibrary: Gas-Efficient Solidity DateTime Library is the Gold standard in terms of date and time libraries out there. Its been rigorously tested and audited. Its based off of the US Naval Observatory specifications and fwiw NTP is directly dependent upon them for accuracy etc.
If your available to talk on telegram my username is @sambacha
Hello, and sorry for the (very) late answer.
About the use of other clocks beside timestamps and block number, I believe they are supported (and that is exactly what this ERC is designed for).
For example if you have access to a milisecond clock, you could do
function clock() public view virtual returns (uint48) {
return (time in miliseconds);
}
function CLOCK_MODE() public view virtual returns (string memory) {
return "mode=timestamp&step=milliseconds";
}
or any other description you want.
The limitation would come from uint48 is not a big enough type. 2**48 milliseconds from 1-1-1970 is march 5th 2026
.
Using WAD would make things even worst (I have no clue why anyone would need this level of precision in a blockchain context).
I don’t see any incompatibility between this and ERC-6372. I’m not sure why anyone would want to represent date and time in “human” format inside a smart contract (IMO, this format should only be seen by humans in UIs).
Also curious if this library not supporting leap seconds might ever become an issue.