Pausable Contract #104
-
As a step to improve the security of our NFA contract, we are willing to implement the Pause feature. That feature would allow us to pause some or all of the functions in specific situations. Imagining an occasion when some malicious intended person find some breach to exploit and get advantage over the contract, in this sense the Pause feature would provide us a way to reduce the possible damages to this ecosystem. But, as everything, this feature comes with a tradeoff. The common implementations of Pause feature requires an entity to handle when the contract should be paused or resumed. This turn the contract to be susceptible to human error and gives a lot of control to Fleek or the contract owner. With that in mind, we are willing to get the community input about how we should have this in the contract. For first, we need to define which strategies we must follow to achieve sustainable security losing as little as possible the reliability over the contract functions. For this we have to decide which functions should or should not be pausable. For an example, the first thoughts about it were: Make pausable:
Make not pausable:
Within the thoughts about the functions being or not pausable, we also came up with the idea of having multiple levels of pause (e.g. pausing just one item from the pausable list above). Would be this worth it? Or should we have just a single flag that indicates if the contract is paused or not? Over all being said we also want to get the community thoughts about which implementation to follow. Should we follow how OpenZeppelin has it or something else? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Thank you for this summary! I think maybe for MVP we can go with a single global pause flag and like you said pause a set of functions all at once. Regarding the problem with putting to much control into the contract owners, it's not a full solution but what they suggest here at the end could help it: https://blog.logrocket.com/pause-functionality-secure-solidity-smart-contracts/. I.e., add a flag that could be controlled by governance whether or not the contract is pausable. |
Beta Was this translation helpful? Give feedback.
-
Jotting down some notes based on our architecture conversation @zoruka We discussed the idea of maybe creating another layer for pre-checks that brings in both access control and pausable and create require functions combining the two. This would move some of the access control functions like This diagram created by @zoruka is good IMO in terms of overall approach to making things modular: I proposed we can combine this in a nested way to achieve the idea around a pre-checks layer: We thought we'd put this discussion up so we can confirm this approach and subsequently add it to our backlog for a future version or if we have time, in the MVP. |
Beta Was this translation helpful? Give feedback.
-
Update: Closing the discussion due to inactivity. |
Beta Was this translation helpful? Give feedback.
#110