forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pausable proposal (solana-labs#1506)
* feat: add pausable proposal * fix: update proposal
- Loading branch information
1 parent
3858d0a
commit 76f0523
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Pubkey> | ||
* 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) |