Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ctian1 committed Aug 6, 2024
1 parent e23897b commit de4ec8e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/prove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
- name: Install SP1 toolchain
run: |
curl -L https://sp1.succinct.xyz | bash
~/.config/.sp1/bin/sp1up
~/.config/.sp1/bin/cargo-prove prove --version
~/.sp1/bin/sp1up
~/.sp1/bin/cargo-prove prove --version
- name: Build SP1 program
run: |
cd program
~/.config/.sp1/bin/cargo-prove prove build
~/.sp1/bin/cargo-prove prove build
10 changes: 8 additions & 2 deletions contracts/src/Fibonacci.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ pragma solidity ^0.8.20;

import {ISP1Verifier} from "@sp1-contracts/ISP1Verifier.sol";

struct PublicValuesStruct {
uint32 n;
uint32 a;
uint32 b;
}

/// @title Fibonacci.
/// @author Succinct Labs
/// @notice This contract implements a simple example of verifying the proof of a computing a
Expand Down Expand Up @@ -32,7 +38,7 @@ contract Fibonacci {
returns (uint32, uint32, uint32)
{
ISP1Verifier(verifier).verifyProof(fibonacciProgramVKey, _publicValues, _proofBytes);
(uint32 n, uint32 a, uint32 b) = abi.decode(_publicValues, (uint32, uint32, uint32));
return (n, a, b);
PublicValuesStruct memory publicValues = abi.decode(_publicValues, (PublicValuesStruct));
return (publicValues.n, publicValues.a, publicValues.b);
}
}

0 comments on commit de4ec8e

Please sign in to comment.