22pragma solidity ^ 0.8.13 ;
33
44contract StateTransition {
5- event StateUpdated (bytes32 )
5+ event StateUpdated (bytes32 );
66
77 bytes32 public PROGRAM_ID = 0x00 ;
88 bytes32 public stateRoot;
@@ -12,18 +12,19 @@ contract StateTransition {
1212 alignedProofAggregator = _alignedProofAggregator;
1313 }
1414
15- function updateState (bytes publicInputs , bytes32 [] merkleProof ) public {
15+ function updateState (bytes calldata publicInputs , bytes32 [] calldata merkleProof ) public {
1616 bytes memory callData = abi.encodeWithSignature (
17- "verifyProofInclusion(bytes32[],bytes32,bytes) " , merkleProof, programId , publicInputs
17+ "verifyProofInclusion(bytes32[],bytes32,bytes) " , merkleProof, PROGRAM_ID , publicInputs
1818 );
1919 (bool callResult , bytes memory response ) = alignedProofAggregator.staticcall (callData);
20- require (callWasSuccessful , "static_call failed " );
20+ require (callResult , "static_call failed " );
2121
2222 bool proofVerified = abi.decode (response, (bool ));
2323 require (proofVerified, "proof not verified in aligned " );
2424
25- (prevStateRoot, newStateRoot) = abi.decode (publicInputs, (bytes32 , UserStateUpdate[] ));
25+ (bytes32 prevStateRoot , bytes32 newStateRoot ) = abi.decode (publicInputs, (bytes32 , bytes32 ));
2626 require (prevStateRoot == stateRoot);
27+
2728 stateRoot = newStateRoot;
2829
2930 emit StateUpdated (stateRoot);
0 commit comments