-
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
ee75032
commit c5df72f
Showing
6 changed files
with
836 additions
and
595 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 |
---|---|---|
@@ -1,29 +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 { | ||
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] | ||
} | ||
|
||
#[external(v0)] | ||
fn set_value(ref self: ContractState, value: felt252) { | ||
self.value.write(value); | ||
} | ||
|
||
#[external(v0)] | ||
fn flip_toggle(ref self: ContractState) { | ||
self.toggle.write(!self.toggle.read()); | ||
} | ||
|
||
fn read(self: @ContractState) -> (felt252, bool) { | ||
(self.value.read(), self.toggle.read()) | ||
} | ||
} | ||
} |
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
Oops, something went wrong.