-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2eb3c3b
commit ddd9d54
Showing
13 changed files
with
2,756 additions
and
11 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 |
---|---|---|
|
@@ -8,6 +8,7 @@ mod emergency; | |
mod multisig; | ||
mod token; | ||
mod access_control; | ||
mod mcms; | ||
|
||
#[cfg(test)] | ||
mod tests; |
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 |
---|---|---|
@@ -1,16 +1,40 @@ | ||
use array::ArrayTrait; | ||
|
||
#[starknet::interface] | ||
trait IMockMultisigTarget<TContractState> { | ||
fn increment(ref self: TContractState, val1: felt252, val2: felt252) -> Array<felt252>; | ||
fn set_value(ref self: TContractState, value: felt252); | ||
fn flip_toggle(ref self: TContractState); | ||
fn read(self: @TContractState) -> (felt252, bool); | ||
} | ||
|
||
#[starknet::contract] | ||
mod MockMultisigTarget { | ||
use array::ArrayTrait; | ||
use super::IMockMultisigTarget; | ||
|
||
#[storage] | ||
struct Storage {} | ||
struct Storage { | ||
value: felt252, | ||
toggle: bool | ||
} | ||
|
||
#[abi(per_item)] | ||
#[generate_trait] | ||
impl HelperImpl of HelperTrait { | ||
#[external(v0)] | ||
#[abi(embed_v0)] | ||
impl MockMultisigTargetImpl of super::IMockMultisigTarget<ContractState> { | ||
fn increment(ref self: ContractState, val1: felt252, val2: felt252) -> Array<felt252> { | ||
array![val1 + 1, val2 + 1] | ||
} | ||
|
||
fn set_value(ref self: ContractState, value: felt252) { | ||
self.value.write(value); | ||
} | ||
|
||
fn flip_toggle(ref self: ContractState) { | ||
self.toggle.write(!self.toggle.read()); | ||
} | ||
|
||
fn read(self: @ContractState) -> (felt252, bool) { | ||
(self.value.read(), self.toggle.read()) | ||
} | ||
} | ||
} |
Oops, something went wrong.