-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
An improvement in pausable.sol #723
Comments
Earlier: Pausable.sol worked as a toggle switch to turn on/off any functionality Now: Pausable.sol will work with contract that use the time variables defined in pausable contract. Pause will 'pause' a function and resume will 'resume' that function along with updations in the endTime. closes OpenZeppelin#723
Hi @AyushyaChitransh! Thanks for your suggestion. Do you have a use case in mind that benefits from this sort of time-tracking being performed on-chain? |
@federicobond Pausable instinctively refers to something which has been continuing in time, hence time-tracking. Anything that requires to be paused, will pause something which has a duration. And the integrity of that duration is retained by resume function Use cases:
I cannot think of any other popular use case as of now. |
Thank you for your answer @AyushyaChitransh. I think we are best keeping the current Pausable behaviour minimal for now, since it's not a requirement that we have seen coming up for most use cases, and it would be easy to add if required. At OpenZeppelin, we aim to cover the most general use cases with well audited contracts. This requires us to be very careful with any extra assumptions that we make about how they will be used, especially considering that each extra storage slot used costs quite a bit of gas. |
🎉 Description
Togglable
As of its current implementation,
pausable.sol
works as a toggle switch toturn_on
andturn_off
certain functionalities. If we just want to have a toggle functionality, then we can inherit a different contract with name liketogglable
. The namepausable
leads to notions of time.Pausable
If we are to have a
pausable
contract, it should have variables likestartTime
andendTime
defined in itself. Then pausable would be able to track duration of how long it was paused and update theendTime
when it is resumed.The text was updated successfully, but these errors were encountered: