benduran ab0cf6f7d8 chore: updated gitignore to excluse the built dist/ folder 3 тижнів тому
..
deploy 07835ec8ae chore: remove deprecated BlastAPI endpoints (#3025) 2 місяців тому
src ef3a901822 feat(target_chains/starknet): scarb & snforge upgrade (#2570) 7 місяців тому
tests ef3a901822 feat(target_chains/starknet): scarb & snforge upgrade (#2570) 7 місяців тому
.gitignore ab0cf6f7d8 chore: updated gitignore to excluse the built dist/ folder 3 тижнів тому
.tool-versions ef3a901822 feat(target_chains/starknet): scarb & snforge upgrade (#2570) 7 місяців тому
README.md ef3a901822 feat(target_chains/starknet): scarb & snforge upgrade (#2570) 7 місяців тому
Scarb.lock ef3a901822 feat(target_chains/starknet): scarb & snforge upgrade (#2570) 7 місяців тому
Scarb.toml ef3a901822 feat(target_chains/starknet): scarb & snforge upgrade (#2570) 7 місяців тому

README.md

Pyth Starknet Contract

This directory contains the Pyth contract on Starknet.

Installation

  1. Install Scarb (the Cairo and Starknet development toolchain) by following the installation instructions.
  2. Install Starknet Foundry by following the installation instructions.

The .tool-versions file in this directory specifies the tool versions used by the contract.

Testing

Run snforge test in this directory to run the contract unit tests and integration tests.

The tests/data.cairo file contains input data that was generated with test_vaas tool. To regenerate it, run the following commands from the repository root (requires Rust installation):

cd target_chains/starknet/tools/test_vaas
cargo run --bin generate_test_data > ../../contracts/tests/data.cairo

Formatting

Run scarb fmt to automatically format the source code.

Local deployment

  1. Install Starkli (a cli tool for Starknet) by following the installation instructions.
  2. Install Devnet (a local Starknet node) by following the installation instructions.
  3. Run the deployment script:

    deploy/deploy.sh > ~/pyth.env
    

This generates ~/pyth.env file that should contain the address of the deployed contract, for example:

$ cat ~/pyth.env
PYTH_WORMHOLE_ADDRESS=0x07fa5a689a768982ecb60ed05f39ca8f6efe623dd32ee6f3608662e3452a104c
PYTH_CONTRACT_ADDRESS=0x00f61bf0314a478bfc865c71d33cc53c77d0f994ea4a228ccf888d14435a8821

Apply these variables to your current shell with:

export $(xargs < ~/pyth.env)