diff --git a/src/fact_registry.cairo b/src/fact_registry.cairo index 1c5db9d9..e4acb830 100644 --- a/src/fact_registry.cairo +++ b/src/fact_registry.cairo @@ -105,15 +105,15 @@ struct FactRegistered { trait IFactRegistry { fn verify_proof_full_and_register_fact( ref self: TContractState, - stark_proof: StarkProofWithSerde, verifier_config: VerifierConfiguration, + stark_proof: StarkProofWithSerde, ) -> FactRegistered; fn verify_proof_initial( ref self: TContractState, job_id: felt252, - stark_proof: StarkProofWithSerde, verifier_config: VerifierConfiguration, + stark_proof: StarkProofWithSerde, ) -> InitResult; fn verify_proof_step( @@ -139,7 +139,7 @@ trait IFactRegistry { fn get_verifier_address(self: @TContractState, preset: VerifierPreset) -> ContractAddress; fn register_verifier( - ref self: TContractState, address: ContractAddress, preset: VerifierPreset + ref self: TContractState, preset: VerifierPreset, address: ContractAddress ); fn transfer_ownership(ref self: TContractState, new_owner: ContractAddress); } @@ -210,14 +210,14 @@ mod FactRegistry { impl FactRegistryImpl of IFactRegistry { fn verify_proof_full_and_register_fact( ref self: ContractState, - stark_proof: StarkProofWithSerde, verifier_config: VerifierConfiguration, + stark_proof: StarkProofWithSerde, ) -> FactRegistered { let (verifier_settings, verifier_preset) = split_settings(verifier_config); let verifier_address = self.get_verifier_address(verifier_preset); let result = ICairoVerifierDispatcher { contract_address: verifier_address } - .verify_proof_full(stark_proof.into(), verifier_settings); + .verify_proof_full(verifier_settings, stark_proof.into()); self ._register_fact( @@ -228,8 +228,8 @@ mod FactRegistry { fn verify_proof_initial( ref self: ContractState, job_id: felt252, - stark_proof: StarkProofWithSerde, verifier_config: VerifierConfiguration, + stark_proof: StarkProofWithSerde, ) -> InitResult { self .verifier_configs @@ -239,7 +239,7 @@ mod FactRegistry { ICairoVerifierDispatcher { contract_address: self.get_verifier_address(verifier_preset) } - .verify_proof_initial(job_id, stark_proof, verifier_settings) + .verify_proof_initial(job_id, verifier_settings, stark_proof) } fn verify_proof_step( @@ -329,7 +329,7 @@ mod FactRegistry { } fn register_verifier( - ref self: ContractState, address: ContractAddress, preset: VerifierPreset + ref self: ContractState, preset: VerifierPreset, address: ContractAddress ) { assert(self.owner.read() == get_caller_address(), 'ONLY_OWNER'); assert(address.into() != 0, 'INVALID_VERIFIER_ADDRESS'); diff --git a/src/proxy.cairo b/src/proxy.cairo index 5c375daf..81fd12ce 100644 --- a/src/proxy.cairo +++ b/src/proxy.cairo @@ -12,15 +12,15 @@ use starknet::{ContractAddress, ClassHash}; trait IProxy { fn verify_proof_full_and_register_fact( ref self: TContractState, - stark_proof: StarkProofWithSerde, verifier_config: VerifierConfiguration, + stark_proof: StarkProofWithSerde, ) -> FactRegistered; fn verify_proof_initial( ref self: TContractState, job_id: felt252, - stark_proof: StarkProofWithSerde, verifier_config: VerifierConfiguration, + stark_proof: StarkProofWithSerde, ) -> InitResult; fn verify_proof_step( @@ -46,7 +46,7 @@ trait IProxy { fn get_verifier_address(self: @TContractState, preset: VerifierPreset) -> ContractAddress; fn register_verifier( - ref self: TContractState, address: ContractAddress, preset: VerifierPreset + ref self: TContractState, preset: VerifierPreset, address: ContractAddress ); fn transfer_ownership(ref self: TContractState, new_owner: ContractAddress); @@ -97,11 +97,11 @@ mod Proxy { impl Proxy of IProxy { fn verify_proof_full_and_register_fact( ref self: ContractState, - stark_proof: StarkProofWithSerde, verifier_config: VerifierConfiguration, + stark_proof: StarkProofWithSerde, ) -> FactRegistered { let fact = IFactRegistryDispatcher { contract_address: self.fact_registry.read() } - .verify_proof_full_and_register_fact(stark_proof, verifier_config); + .verify_proof_full_and_register_fact(verifier_config, stark_proof); self.emit(fact); fact @@ -110,11 +110,11 @@ mod Proxy { fn verify_proof_initial( ref self: ContractState, job_id: felt252, - stark_proof: StarkProofWithSerde, verifier_config: VerifierConfiguration, + stark_proof: StarkProofWithSerde, ) -> InitResult { IFactRegistryDispatcher { contract_address: self.fact_registry.read() } - .verify_proof_initial(job_id, stark_proof, verifier_config) + .verify_proof_initial(job_id, verifier_config, stark_proof) } fn verify_proof_step( @@ -164,10 +164,10 @@ mod Proxy { } fn register_verifier( - ref self: ContractState, address: ContractAddress, preset: VerifierPreset + ref self: ContractState, preset: VerifierPreset, address: ContractAddress ) { IFactRegistryDispatcher { contract_address: self.fact_registry.read() } - .register_verifier(address, preset); + .register_verifier(preset, address); self.emit(Event::VerifierRegistered(VerifierRegistered { address, preset })); } diff --git a/src/verifier.cairo b/src/verifier.cairo index b134bd67..626e8aca 100644 --- a/src/verifier.cairo +++ b/src/verifier.cairo @@ -31,15 +31,15 @@ struct ProofVerified { trait ICairoVerifier { fn verify_proof_full( ref self: TContractState, - stark_proof_serde: StarkProofWithSerde, settings: VerifierSettings, + stark_proof_serde: StarkProofWithSerde, ) -> ProofVerified; fn verify_proof_initial( ref self: TContractState, job_id: felt252, - stark_proof_serde: StarkProofWithSerde, settings: VerifierSettings, + stark_proof_serde: StarkProofWithSerde, ) -> InitResult; fn verify_proof_step( @@ -109,8 +109,8 @@ mod CairoVerifier { impl CairoVerifier of ICairoVerifier { fn verify_proof_full( ref self: ContractState, - stark_proof_serde: StarkProofWithSerde, settings: VerifierSettings, + stark_proof_serde: StarkProofWithSerde, ) -> ProofVerified { let stark_proof: StarkProof = stark_proof_serde.into(); let (program_hash, output_hash) = match settings.cairo_version { @@ -134,8 +134,8 @@ mod CairoVerifier { fn verify_proof_initial( ref self: ContractState, job_id: felt252, - stark_proof_serde: StarkProofWithSerde, settings: VerifierSettings, + stark_proof_serde: StarkProofWithSerde, ) -> InitResult { assert(self.state_constant.entry(job_id).read().is_none(), 'job_id already exists');