1

A (signed) 64 bit timestamp can store a date much larger than the age of the universe.

On many platforms this would be a micro-optimization, but in the context of Ethereum, we want to squeeze every drop of gas out, don't we?

1
  • My mistake in the title. A uint is 256 bits, not bytes. Commented Aug 26, 2018 at 8:26

1 Answer 1

2

A storage slot is 256 bits, as are hashes, ETH amounts etc, so it's simpler to standardize on returning a 256-bit number.

However, if you need a timestamp in your contract you are under no obligation to store 256 bits: It's simple to cast it to a smaller size. This will often provide a gas saving if you're storing other small pieces of data at the same time.

1
  • Also the EVM is 256 bits machine operating data of size other from 256 bits requires extra steps. Commented Aug 28, 2018 at 17:27

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.