From 76f0523e6058d0e764d71a7a96e5e33092b6529f Mon Sep 17 00:00:00 2001 From: B <264380+bartosz-lipinski@users.noreply.github.com> Date: Thu, 25 Mar 2021 16:38:36 -0500 Subject: [PATCH] Add pausable proposal (#1506) * feat: add pausable proposal * fix: update proposal --- token-swap/proposals/Pausable.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 token-swap/proposals/Pausable.md diff --git a/token-swap/proposals/Pausable.md b/token-swap/proposals/Pausable.md new file mode 100644 index 00000000..3b7a0709 --- /dev/null +++ b/token-swap/proposals/Pausable.md @@ -0,0 +1,26 @@ +# Pausable & Ownable + +Implement two programs for SPL that can be used to extend contracts with ability to pause, resume and check for the owner before instructions are executed. + +An Owner program with the instructions you've listed: + + - set owner + - renounce ownership + - check owner + +Additionally: +* an Owner struct should contain Option +* library code should generate a pda, probably given (struct_key, program_id) + +Given an Owner program, compose it with the Pause program. + + - pause + - resume + +Note: only owner can pause/resume normal operations + +For both programs provide example usage from other programs via CPI and unit tests. + +Links: +* [Pausable solidity contract](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/24a0bc23cfe3fbc76f8f2510b78af1e948ae6651/contracts/security/Pausable.sol) +* [Ownable solidity contract](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/24a0bc23cfe3fbc76f8f2510b78af1e948ae6651/contracts/access/Ownable.sol)