Ayush Suresh 9f26ac575d fixed test преди 3 месеца
..
pyth-contract 9f26ac575d fixed test преди 3 месеца
pyth-interface c3e0f491e4 explaining byte padding преди 3 месеца
scripts 6b1c016619 quick simplification преди 3 месеца
src 955a805e85 chore: apply rustfmt преди 1 година
tests 955a805e85 chore: apply rustfmt преди 1 година
.gitignore 18e8b8d809 feat(contract_manager): add support for fuel (#1656) преди 1 година
Cargo.lock 04906de2e1 checking whether this works преди 4 месеца
Cargo.toml f04cae050f feat(target_chains/fuel): update fuel toolchains to the latest version (#1911) преди 1 година
Forc.lock 04906de2e1 checking whether this works преди 4 месеца
Forc.toml c2da454637 add fuel contract by Fuel Labs (#1513) преди 1 година
LICENSE c2da454637 add fuel contract by Fuel Labs (#1513) преди 1 година
README.md 7de4ce3ec8 update fuel readme (#2052) преди 1 година
fuel-toolchain.toml 7d74c6f002 only made changes to the fuel folder преди 3 месеца

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 network deployment:

The Pyth oracle contract has been deployed to Mainnet at 0x1c86fdd9e0e7bc0d2ae1bf6817ef4834ffa7247655701ee1b031b52a24c523da and Testnet at 0x25146735b29d4216639f7f8b1d7b921ff87a1d3051de62d6cceaacabeb33b8e7.