0

Trying to get some insight as to whether or not it's more optimal to call block.timestamp repeatedly for comparisons or to set a (memory) variable to hold the value and use it instead.

I've looked at the gas cost table here:

http://ethdocs.org/en/latest/contracts-and-transactions/account-types-gas-and-transactions.html

but am not certain about where block.timestamp fits in.

0

The TIMESTAMP op code costs 2 gas, according to the yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), Appendix G and Appendix H.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.