Daniel Chew 4ab64d2539 feat(target_chains/fuel): use saturating sub (#2031) 1 年之前
..
pyth-contract 4ab64d2539 feat(target_chains/fuel): use saturating sub (#2031) 1 年之前
pyth-interface 4ab64d2539 feat(target_chains/fuel): use saturating sub (#2031) 1 年之前
scripts cf7987f4c5 feat(target_chains/fuel): add governance contract (#1518) 1 年之前
src aa9509ccd3 chore(target_chains/fuel): update fuel packages (#1837) 1 年之前
tests 2c4bc07bef feat(target_chains/fuel): bump fuel-toolchain and refactor (#1794) 1 年之前
.gitignore 18e8b8d809 feat(contract_manager): add support for fuel (#1656) 1 年之前
Cargo.lock f04cae050f feat(target_chains/fuel): update fuel toolchains to the latest version (#1911) 1 年之前
Cargo.toml f04cae050f feat(target_chains/fuel): update fuel toolchains to the latest version (#1911) 1 年之前
Forc.lock 4ab64d2539 feat(target_chains/fuel): use saturating sub (#2031) 1 年之前
Forc.toml c2da454637 add fuel contract by Fuel Labs (#1513) 1 年之前
LICENSE c2da454637 add fuel contract by Fuel Labs (#1513) 1 年之前
README.md 2c4bc07bef feat(target_chains/fuel): bump fuel-toolchain and refactor (#1794) 1 年之前
fuel-toolchain.toml 4ab64d2539 feat(target_chains/fuel): use saturating sub (#2031) 1 年之前

README.md

Pyth-integration

An implementation of a Pyth Network oracle contract in Sway. Utilising minimal, internal Wormhole functionality and state.

Interfaces

The project provides four interfaces for interaction with the oracle contract:

  • PythCore - provides the core functionality to required to utilise the oracle; getting fees, updating prices and fetching prices.
  • PythInit - provides the functionality to setup the oracle's state.
  • PythInfo - provides additional information about the oracle's state.
  • WormholeGuardians - provides functionality to maintain and query the wormhole-state-elements used by the oracle.

Running the project

Project

Run the following commands from the root of the repository.

Program compilation

forc build

Running the tests

Before running the tests the programs must be compiled with the command above.

cargo test

Before deploying

Before deploying the oracle contract; the deployer must be set to the address of the deploying wallet in the storage block, so that the deployer can setup the contract with the constructor() method.

Parameters for the constructor() method can be seen in the tests of the method, which at the time of writing uses the real up-to-date values as per Pyth's documentation and EVM integrations. Care should be taken to ensure that the most up-to-date values are used for the constructor() method's parameters.

Fuel Beta-5 network deployment:

The Pyth oracle contract has been deployed to Beta-5 at the ContractId: 0xe69daeb9fcf4c536c0fe402403b4b9e9822cc8b1f296e5d754be12cc384554c5.