Skip to content

Commit b084bf4

Browse files
committed
fix
1 parent 7efe26d commit b084bf4

File tree

1 file changed

+7
-7
lines changed
  • pages/price-feeds/use-real-time-data

1 file changed

+7
-7
lines changed

pages/price-feeds/use-real-time-data/fuel.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,33 +45,33 @@ abi UpdatePrice {
4545
}
4646
4747
const PYTH_MAINNET_CONTRACT_ID = 0x1c86fdd9e0e7bc0d2ae1bf6817ef4834ffa7247655701ee1b031b52a24c523da; // Mainnet Contract
48-
const PYTH_CONTRACT_ID = 0x25146735b29d4216639f7f8b1d7b921ff87a1d3051de62d6cceaacabeb33b8e7; // Testnet Contract
48+
const PYTH_TESTNET_CONTRACT_ID = 0x25146735b29d4216639f7f8b1d7b921ff87a1d3051de62d6cceaacabeb33b8e7; // Testnet Contract
4949
const FUEL_ETH_BASE_ASSET_ID = 0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07;
5050
5151
impl UpdatePrice for Contract {
5252
fn valid_time_period() -> u64 {
53-
let pyth_contract = abi(PythCore, PYTH_CONTRACT_ID);
53+
let pyth_contract = abi(PythCore, PYTH_MAINNET_CONTRACT_ID);
5454
let period = pyth_contract.valid_time_period();
5555
period
5656
}
5757
fn get_price(price_feed_id: PriceFeedId) -> Price {
58-
let pyth_contract = abi(PythCore, PYTH_CONTRACT_ID);
58+
let pyth_contract = abi(PythCore, PYTH_MAINNET_CONTRACT_ID);
5959
let price = pyth_contract.price(price_feed_id);
6060
price
6161
}
6262
fn get_price_unsafe(price_feed_id: PriceFeedId) -> Price {
63-
let pyth_contract = abi(PythCore, PYTH_CONTRACT_ID);
63+
let pyth_contract = abi(PythCore, PYTH_MAINNET_CONTRACT_ID);
6464
let price = pyth_contract.price_unsafe(price_feed_id);
6565
price
6666
}
6767
fn update_fee(update_data: Vec<Bytes>) -> u64 {
68-
let pyth_contract = abi(PythCore, PYTH_CONTRACT_ID);
68+
let pyth_contract = abi(PythCore, PYTH_MAINNET_CONTRACT_ID);
6969
let fee = pyth_contract.update_fee(update_data);
7070
fee
7171
}
7272
#[payable]
7373
fn update_price_feeds(update_fee: u64, update_data: Vec<Bytes>) {
74-
let pyth_contract = abi(PythCore, PYTH_CONTRACT_ID);
74+
let pyth_contract = abi(PythCore, PYTH_MAINNET_CONTRACT_ID);
7575
pyth_contract
7676
.update_price_feeds {
7777
asset_id: FUEL_ETH_BASE_ASSET_ID,
@@ -102,7 +102,7 @@ The code snippet above does the following things:
102102
- `update_fee(update_data)`: Calculates the fee required to update the price feeds.
103103
- `update_price_feeds(update_fee, update_data)`: Updates the price feeds with the provided data and fee.
104104

105-
3. Uses the `PYTH_CONTRACT_ID` constant to interact with the Pyth contract on testnet.
105+
3. Uses the `PYTH_MAINNET_CONTRACT_ID` constant to interact with the Pyth contract on testnet.
106106
4. Uses the `FUEL_ETH_BASE_ASSET_ID` constant as the asset ID for paying update fees.
107107

108108
To use this contract, you would typically:

0 commit comments

Comments
 (0)