-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate Pausable to component (#773)
* update Scarb * fix formatting * migrate pausable to component * fix formatting * add documentation * fix comments * Apply suggestions from code review Co-authored-by: Eric Nordelo <[email protected]> * Apply suggestions from code review Co-authored-by: Eric Nordelo <[email protected]> * fix spdx and comment block * change _comp to _component * remove unnecessary import * fix comments --------- Co-authored-by: Eric Nordelo <[email protected]>
- Loading branch information
1 parent
0b77977
commit d55661a
Showing
4 changed files
with
73 additions
and
32 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
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
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,22 @@ | ||
#[starknet::contract] | ||
mod PausableMock { | ||
use openzeppelin::security::pausable::Pausable as pausable_component; | ||
|
||
component!(path: pausable_component, storage: pausable, event: PausableEvent); | ||
|
||
#[abi(embed_v0)] | ||
impl PausableImpl = pausable_component::PausableImpl<ContractState>; | ||
impl InternalImpl = pausable_component::InternalImpl<ContractState>; | ||
|
||
#[storage] | ||
struct Storage { | ||
#[substorage(v0)] | ||
pausable: pausable_component::Storage | ||
} | ||
|
||
#[event] | ||
#[derive(Drop, starknet::Event)] | ||
enum Event { | ||
PausableEvent: pausable_component::Event | ||
} | ||
} |
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