-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:snapshot-labs/sx-starknet into f…
…eat_struct_packing
- Loading branch information
Showing
27 changed files
with
491 additions
and
412 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
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
mod proposal_validation_always_fail; | ||
mod executor; | ||
mod space_v2; |
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,30 @@ | ||
#[starknet::interface] | ||
trait ISpaceV2<TContractState> { | ||
fn initialize(ref self: TContractState, var: felt252); | ||
fn get_var(self: @TContractState) -> felt252; | ||
} | ||
|
||
#[starknet::contract] | ||
mod SpaceV2 { | ||
use super::ISpaceV2; | ||
use sx::utils::reinitializable::Reinitializable; | ||
use sx::utils::ReinitializableImpl; | ||
#[storage] | ||
struct Storage { | ||
_var: felt252 | ||
} | ||
|
||
#[external(v0)] | ||
impl SpaceV2 of ISpaceV2<ContractState> { | ||
fn initialize(ref self: ContractState, var: felt252) { | ||
// TODO: Temp component syntax | ||
let mut state: Reinitializable::ContractState = | ||
Reinitializable::unsafe_new_contract_state(); | ||
ReinitializableImpl::initialize(ref state); | ||
self._var.write(var); | ||
} | ||
fn get_var(self: @ContractState) -> felt252 { | ||
self._var.read() | ||
} | ||
} | ||
} |
Oops, something went wrong.