Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change crowdsales to use timestamps instead of block numbers #350

Closed
frangio opened this issue Aug 4, 2017 · 3 comments
Closed

Change crowdsales to use timestamps instead of block numbers #350

frangio opened this issue Aug 4, 2017 · 3 comments

Comments

@frangio
Copy link
Contributor

frangio commented Aug 4, 2017

Due to the difficulty bomb it is very hard to estimate block numbers.

jakub-wojciechowski added a commit to jakub-wojciechowski/zeppelin-solidity that referenced this issue Aug 6, 2017
jakub-wojciechowski added a commit to jakub-wojciechowski/zeppelin-solidity that referenced this issue Aug 6, 2017
jakub-wojciechowski added a commit to jakub-wojciechowski/zeppelin-solidity that referenced this issue Aug 6, 2017
@SCBuergel
Copy link

SCBuergel commented Aug 7, 2017

Some thoughts from my end (cross post from Slack)
For now you are generally using block.number instead of block.timestamp.
Advantages of what you do:

  • block.number will always increase by one compared to previous block, this is guaranteed by the protocol.
  • block.timestamp can be minimally gamed by a miner, see here and here
    Disadvantages:
  • the future block time is unknown and leads to surprises, especially with the latest difficulty bomb and ice age forks.
    Given that ICOs usually run over several days, the in-accuracy due to unknown block times is actually higher than the max 15 minutes practical gamable of the block.timestamp. Hence I’d suggest to use block.timestamp (or now) instead of block.number for your crowdsale contract.

frangio added a commit that referenced this issue Aug 10, 2017
Change crowdsales to use timestamps instead of block numbers #350
@frangio
Copy link
Contributor Author

frangio commented Aug 11, 2017

Thank you for your thoughts @SCBuergel. I agree with all of them. We have done the change (#353) because of the disdvantage you stated, and the reasoning that it's a good trade-off for crowdsales. I'll recap this in the release notes.

@frangio frangio closed this as completed Aug 11, 2017
SylTi pushed a commit to SylTi/zeppelin-solidity that referenced this issue Aug 24, 2017
SylTi pushed a commit to SylTi/zeppelin-solidity that referenced this issue Aug 24, 2017
SylTi pushed a commit to SylTi/zeppelin-solidity that referenced this issue Aug 24, 2017
@DaveAppleton
Copy link
Contributor

Finally.

Months ago I reported that the ethereum team members had agreed that a block time could not be gamed by more than a few seconds. Certainly not the 15 minutes mentioned above.

The original comment was to prevent it being used for things like rand seeds.

wmitsuda added a commit to wmitsuda/what_is_an_initial_coin_offering that referenced this issue Oct 9, 2017
ProphetDaniel pushed a commit to classicdelta/Smart-Contracts that referenced this issue Mar 9, 2018
ProphetDaniel pushed a commit to classicdelta/Smart-Contracts that referenced this issue Mar 9, 2018
ProphetDaniel pushed a commit to classicdelta/Smart-Contracts that referenced this issue Mar 9, 2018
ProphetDaniel pushed a commit to classicdelta/Smart-Contracts that referenced this issue Mar 9, 2018
Change crowdsales to use timestamps instead of block numbers OpenZeppelin#350
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants