Giter Site home page Giter Site logo

fossil's Introduction

WIP of Fossil to Cairo 1

References

The repo structure and files organisation will be reviewed once all the components will be implemented

Testing

Start Anvil in a new terminal with the command anvil.

Install dependencies:

dojoup -v v1.0.0-alpha.1
 ```

```bash
cd ethereum
forge soldeer install forge-std~1.8.2

I a New Terminal Start the Katana StarkNet node:

katana --messaging anvil.messaging.json --disable-fee 

In a New Terminal Build the project and set up environment variables:

cd starknet
scarb build
source katana/katana.env

Declare the Cairo contracts:

katana/declare.sh

Deploy the Cairo contracts:

katana/deploy.sh

In a New Terminal Set up local Ethereum testing:

cd ethereum
cp anvil.env .env
source .env
forge script script/LocalTesting.s.sol:LocalSetup --broadcast --rpc-url ${ETH_RPC_URL} 

Generate the proof for the mock account and storage:

cast proof 0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 0 --block 3

The script starknet/katana/prove_sto.sh is a wrapper to store the state root and verify account first and then storage proof for the slot 0x0 in MockStorage.sol.

starknet/katana/verify_proofs.sh

fossil's People

Contributors

ametel01 avatar sqrlfirst avatar hakymulla avatar ahmed-aghadi avatar tkstanczak avatar

Stargazers

Matt Carter avatar Muharrem Acar avatar  avatar  avatar  avatar  avatar sintayew gashaw avatar

fossil's Issues

Change Return Types to Result

Description

Currently, the functions verify_proof in library/trie_proof.cairo and prove_storage in fact_registry return Option. Additionally, verify_proof includes assertions that can cause the call to panic. We want to modify these functions to return Result instead.

Furthermore, the verify_account function currently does not have a return value. We want to update this function to return Result as well.

Expected Changes

  1. Change the return type of verify_proof in library/trie_proof.cairo from Option to Result.
  2. Modify verify_proof to handle errors using Result rather than assertions that cause panic.
  3. Change the return type of prove_storage in fact_registry from Option to Result.
  4. Update verify_account to return Result instead of having no return value.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.