diff --git a/starknet/src/utils/reinitializable.cairo b/starknet/src/utils/reinitializable.cairo index d160cc6f..a536364e 100644 --- a/starknet/src/utils/reinitializable.cairo +++ b/starknet/src/utils/reinitializable.cairo @@ -5,7 +5,7 @@ mod ReinitializableComponent { #[storage] struct Storage { - _initialized: bool + Reinitializable_initialized: bool } // Event is needed to derive PartialEq on it so we can test it in other modules. @@ -20,22 +20,22 @@ mod ReinitializableComponent { /// Initialize the contract. Must not have been initialized before. fn initialize(ref self: ComponentState) { self.not_initialized(); - self._initialized.write(true); + self.Reinitializable_initialized.write(true); } /// Reset the initialization state of the contract, allowing it to be initialized again in the future. fn reset(ref self: ComponentState) { - self._initialized.write(false); + self.Reinitializable_initialized.write(false); } /// Asserts that the contract has been initialized. fn initialized(self: @ComponentState) { - assert(self._initialized.read() == true, 'Not Initialized'); + assert(self.Reinitializable_initialized.read() == true, 'Not Initialized'); } /// Asserts that the contract has not been initialized. fn not_initialized(self: @ComponentState) { - assert(self._initialized.read() == false, 'Already Initialized'); + assert(self.Reinitializable_initialized.read() == false, 'Already Initialized'); } } } diff --git a/starknet/src/utils/simple_quorum.cairo b/starknet/src/utils/simple_quorum.cairo index 4e2712f5..ad2e6554 100644 --- a/starknet/src/utils/simple_quorum.cairo +++ b/starknet/src/utils/simple_quorum.cairo @@ -6,7 +6,7 @@ mod SimpleQuorumComponent { #[storage] struct Storage { - _quorum: u256 + Simplequorum_quorum: u256 } #[generate_trait] @@ -14,7 +14,7 @@ mod SimpleQuorumComponent { TContractState, +HasComponent > of InternalTrait { fn initializer(ref self: ComponentState, quorum: u256) { - self._quorum.write(quorum); + self.Simplequorum_quorum.write(quorum); } /// Returns the status of a proposal. @@ -32,7 +32,7 @@ mod SimpleQuorumComponent { votes_against: u256, votes_abstain: u256, ) -> ProposalStatus { - let quorum_reached = votes_for + votes_abstain >= self._quorum.read(); + let quorum_reached = votes_for + votes_abstain >= self.Simplequorum_quorum.read(); let supported = votes_for > votes_against; let accepted = quorum_reached && supported; @@ -64,7 +64,7 @@ mod SimpleQuorumComponent { TContractState, +HasComponent > of IQuorum> { fn quorum(self: @ComponentState) -> u256 { - self._quorum.read() + self.Simplequorum_quorum.read() } } } diff --git a/starknet/src/utils/single_slot_proof.cairo b/starknet/src/utils/single_slot_proof.cairo index 77f45bf1..50b21169 100644 --- a/starknet/src/utils/single_slot_proof.cairo +++ b/starknet/src/utils/single_slot_proof.cairo @@ -9,9 +9,9 @@ mod SingleSlotProofComponent { #[storage] struct Storage { - _timestamp_remappers: ContractAddress, - _facts_registry: ContractAddress, - _cached_remapped_timestamps: LegacyMap:: + Singleslotproof_timestamp_remappers: ContractAddress, + Singleslotproof_facts_registry: ContractAddress, + Singleslotproof_cached_remapped_timestamps: LegacyMap:: } #[generate_trait] @@ -23,8 +23,8 @@ mod SingleSlotProofComponent { timestamp_remappers: ContractAddress, facts_registry: ContractAddress ) { - self._timestamp_remappers.write(timestamp_remappers); - self._facts_registry.write(facts_registry); + self.Singleslotproof_timestamp_remappers.write(timestamp_remappers); + self.Singleslotproof_facts_registry.write(facts_registry); } fn get_storage_slot( @@ -35,12 +35,12 @@ mod SingleSlotProofComponent { mpt_proof: Span ) -> u256 { // Checks if the timestamp is already cached. - let l1_block_number = self._cached_remapped_timestamps.read(timestamp); + let l1_block_number = self.Singleslotproof_cached_remapped_timestamps.read(timestamp); assert(l1_block_number.is_non_zero(), 'Timestamp not cached'); // Returns the value of the storage slot of account: `l1_contract_address` at key: `slot_key` and block number: `l1_block_number`. let slot_value = IEVMFactsRegistryDispatcher { - contract_address: self._facts_registry.read() + contract_address: self.Singleslotproof_facts_registry.read() } .get_storage(l1_block_number, l1_contract_address.into(), slot_key, mpt_proof); @@ -54,17 +54,17 @@ mod SingleSlotProofComponent { // timestamp is less than the earliest timestamp or larger than the latest timestamp in the mapper // then the call will return Option::None and the transaction will revert. let l1_block_number = ITimestampRemappersDispatcher { - contract_address: self._timestamp_remappers.read() + contract_address: self.Singleslotproof_timestamp_remappers.read() } .get_closest_l1_block_number(tree, timestamp.into()) .expect('TimestampRemappers call failed') .expect('Timestamp out of range'); - self._cached_remapped_timestamps.write(timestamp, l1_block_number); + self.Singleslotproof_cached_remapped_timestamps.write(timestamp, l1_block_number); } fn cached_timestamps(self: @ComponentState, timestamp: u32) -> u256 { - let l1_block_number = self._cached_remapped_timestamps.read(timestamp); + let l1_block_number = self.Singleslotproof_cached_remapped_timestamps.read(timestamp); assert(l1_block_number.is_non_zero(), 'Timestamp not cached'); l1_block_number } diff --git a/starknet/src/utils/snip12.cairo b/starknet/src/utils/snip12.cairo index 5a4f51f0..11edd26b 100644 --- a/starknet/src/utils/snip12.cairo +++ b/starknet/src/utils/snip12.cairo @@ -13,7 +13,7 @@ mod SNIP12Component { #[storage] struct Storage { - _domain_hash: felt252 + Snip12_domain_hash: felt252 } #[generate_trait] @@ -21,7 +21,7 @@ mod SNIP12Component { TContractState, +HasComponent > of InternalTrait { fn initializer(ref self: ComponentState, name: felt252, version: felt252) { - self._domain_hash.write(get_domain_hash(name, version)); + self.Snip12_domain_hash.write(get_domain_hash(name, version)); } /// Verifies the signature of the propose calldata. @@ -154,7 +154,7 @@ mod SNIP12Component { ) -> felt252 { let mut encoded_data = array![]; STARKNET_MESSAGE.serialize(ref encoded_data); - self._domain_hash.read().serialize(ref encoded_data); + self.Snip12_domain_hash.read().serialize(ref encoded_data); signer.serialize(ref encoded_data); message_hash.serialize(ref encoded_data); encoded_data.span().struct_hash() diff --git a/starknet/src/utils/space_manager.cairo b/starknet/src/utils/space_manager.cairo index ece0d0a4..b2cd395f 100644 --- a/starknet/src/utils/space_manager.cairo +++ b/starknet/src/utils/space_manager.cairo @@ -4,7 +4,7 @@ mod SpaceManagerComponent { #[storage] struct Storage { - _spaces: LegacyMap:: + Spacemanager_spaces: LegacyMap:: } #[event] @@ -35,9 +35,10 @@ mod SpaceManagerComponent { match spaces.pop_front() { Option::Some(space) => { assert( - (*space).is_non_zero() && !self._spaces.read(*space), 'Invalid Space' + (*space).is_non_zero() && !self.Spacemanager_spaces.read(*space), + 'Invalid Space' ); - self._spaces.write(*space, true); + self.Spacemanager_spaces.write(*space, true); }, Option::None(()) => { break; } }; @@ -45,23 +46,23 @@ mod SpaceManagerComponent { } fn enable_space(ref self: ComponentState, space: ContractAddress) { - assert(space.is_non_zero() && !self._spaces.read(space), 'Invalid Space'); - self._spaces.write(space, true); + assert(space.is_non_zero() && !self.Spacemanager_spaces.read(space), 'Invalid Space'); + self.Spacemanager_spaces.write(space, true); self.emit(Event::SpaceEnabled(SpaceEnabled { space: space })); } fn disable_space(ref self: ComponentState, space: ContractAddress) { - assert(self._spaces.read(space), 'Invalid Space'); - self._spaces.write(space, false); + assert(self.Spacemanager_spaces.read(space), 'Invalid Space'); + self.Spacemanager_spaces.write(space, false); self.emit(Event::SpaceDisabled(SpaceDisabled { space: space })); } fn is_space_enabled(self: @ComponentState, space: ContractAddress) -> bool { - return self._spaces.read(space); + return self.Spacemanager_spaces.read(space); } fn assert_only_spaces(self: @ComponentState) { - assert(self._spaces.read(info::get_caller_address()), 'Unauthorized Space'); + assert(self.Spacemanager_spaces.read(info::get_caller_address()), 'Unauthorized Space'); } } }