Skip to content

Commit

Permalink
TODOs + issues
Browse files Browse the repository at this point in the history
  • Loading branch information
drspacemn committed Feb 13, 2024
1 parent 6c00e39 commit 3c554a0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/appchain.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ mod appchain {
fn update_state(ref self: ContractState, program_output: Span<felt252>) {
self.config.assert_only_owner_or_operator();

// TODO: reentrancy guard.
// TODO: facts verification.
// TODO: update the current state (component needed).
// TODO(#2): reentrancy guard.
// TODO(#3): facts verification.
// TODO(#4): update the current state (component needed).

// Header size + 2 messages segments len.
assert(
Expand All @@ -86,7 +86,7 @@ mod appchain {

let mut offset = snos_output::HEADER_SIZE;

// TODO: We should update SNOS output to have the messages count
// TODO(#7): We should update SNOS output to have the messages count
// instead of the messages segment len.

let mut messages_segments = program_output.slice(offset, program_output.len() - offset);
Expand Down
6 changes: 3 additions & 3 deletions src/config/component.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ mod config_cpt {
#[storage]
struct Storage {
/// Appchain operator that is allowed to update the state.
// TODO(#9): Multiple Operators
operator: ContractAddress,
/// Program info (StarknetOS), with program hash and config hash.
program_info: (felt252, felt252),
Expand All @@ -35,8 +36,7 @@ mod config_cpt {
impl Config<
TContractState,
+HasComponent<TContractState>,
impl Ownable: ownable_cpt::HasComponent<TContractState>,
+Drop<TContractState>
impl Ownable: ownable_cpt::HasComponent<TContractState>
> of IConfig<ComponentState<TContractState>> {
fn set_operator(ref self: ComponentState<TContractState>, address: ContractAddress) {
get_dep_component!(@self, Ownable).assert_only_owner();
Expand All @@ -52,6 +52,7 @@ mod config_cpt {
) {
self.assert_only_owner_or_operator();
self.program_info.write((program_hash, config_hash))
// TODO(#6): ProgramHashChanged Event
}

fn get_program_info(self: @ComponentState<TContractState>) -> (felt252, felt252) {
Expand All @@ -73,7 +74,6 @@ mod config_cpt {
TContractState,
+HasComponent<TContractState>,
impl Ownable: ownable_cpt::HasComponent<TContractState>,
+Drop<TContractState>
> of InternalTrait<TContractState> {
/// Asserts if the caller is the owner of the contract or
/// the authorized operator. Reverts otherwise.
Expand Down
4 changes: 2 additions & 2 deletions src/messaging/component.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ mod messaging_cpt {

#[embeddable_as(MessagingImpl)]
impl Messaging<
TContractState, +HasComponent<TContractState>, +Drop<TContractState>
TContractState, +HasComponent<TContractState>
> of IMessaging<ComponentState<TContractState>> {
fn send_message_to_appchain(
ref self: ComponentState<TContractState>,
Expand Down Expand Up @@ -284,7 +284,7 @@ mod messaging_cpt {

#[generate_trait]
impl InternalImpl<
TContractState, +HasComponent<TContractState>, +Drop<TContractState>
TContractState, +HasComponent<TContractState>
> of InternalTrait<TContractState> {
/// Initializes the messaging component.
///
Expand Down

0 comments on commit 3c554a0

Please sign in to comment.