Fetch 5ire/USD Price from Entangle Oracle
This script fetches and verifies the 5IRE/USD price using the PullConsumer smart contract on the 5ireChain.
- Node.js (v20 or higher)
- Yarn
- A
5ireChain MainnetConfiguration - Private key with sufficient
5IRE coinsfor gas fees
- Install dependencies:
yarn install- Configure environment variables by creating a
.envfile:
FIRE_URL=https://rpc.5ire.network
FIRE_DEPLOYER=your_private_key_hereExecute the script using Hardhat:
npx hardhat run scripts/entangle/fetchAndVerify.ts --network fireThe script performs the following operations:
- Fetches verification data for 5IRE/USD price from
Entangle Oracle - Interacts with the PullConsumer contract at
0xB1e44Fb6DDc1DA35300DA3b66be4235F1532d6D7 - Verifies the price using
merkle proofsandsignatures - Outputs the transaction hash upon successful verification
When successful, you should see output similar to:
sent tx: 0x62364a7c80168b8a5a4e8e0758b7a034e96e2e57ae543a8c7907a27039e79a56
Fetch 5ire/USD, 5ire/USDT Price from Orochi Oracle
This script fetches the `5IRE/USD` and `5IRE/USDT` price using the FetchPrice smart contract on the 5ireChain.- Node.js (v20 or higher)
- Yarn
- A
5ireChain MainnetConfiguration - Private key with sufficient
5IRE coinsfor gas fees
- Install dependencies:
yarn install- Configure environment variables by creating a
.envfile:
FIRE_URL=https://rpc.5ire.network
FIRE_DEPLOYER=your_private_key_hereCompile and deploy the contract:
npx hardhat compileDeploy the contract to the 5ireChain network:
npx hardhat run scripts/orochi/deploy.ts --network fireCopy the deployed contract address and update orochifetch.ts with it. Then run:
npx hardhat run scripts/orochi/orochifetch.ts --network fireThe script performs the following operations:
- Fetches
5IRE/USDand5IRE/USDTprices fromOrochi Oracle - Interacts with the FetchPrice contract at
0x3E36123bAE1d9EB392C32849324D093a45CEDd7F - Retrieves and displays the latest price
When successful, you should see output similar to:
📡 Fetching 5IRE/USDT price from contract...
💰 5IRE/USDT Price: 0.003066 USDT
💰 5IRE/USD Price: 0.003066352589999999 USD
Fetch 5IRE/USD Price from Umbrella Network
This script fetches the `5IRE/USD` price using the `UmbrellaPriceFetcher` smart contract on the `5ireChain`.- Node.js (v20 or higher)
- Yarn
- A
5ireChain MainnetConfiguration - Private key with sufficient
5IRE coinsfor Gas fees
- Install dependencies:
yarn install- Configure environment variables by creating a
.envfile:
FIRE_URL=https://rpc.5ire.network
FIRE_DEPLOYER=your_private_key_hereCompile and deploy the contract:
npx hardhat compileDeploy the contract to the 5ireChain network:
npx hardhat run scripts/Umbrella/deploy.ts --network fireCopy the deployed contract address and update umbrellaFetch.ts with it. Then run:
npx hardhat run scripts/Umbrella/umbrellaFetch.ts --network fireThe script performs the following operations:
- Fetches
5IRE/USDprice fromUmbrella Network - Interacts with the
Feed Addresscontract at0x1B9131518EadDFDCCc1876616e3Bf9c534b4e527 - Retrieves and displays the latest price
When successful, you should see output similar to:
Price: 0.00338371 USD
Timestamp: 1739737743