Repository of contracts used for Astria's native oracle.
Copy the example .env: cp local.env.example .env
Put your private key in .env
and source .env
.
To deploy AstriaOracle.sol
:
forge script script/AstriaOracle.s.sol:AstriaOracleScript \
--rpc-url $RPC_URL --broadcast --sig "deploy()" -vvvv
The script has an example function which calls getPrice()
for ETH/USD
. You can update the test for different currency pair strings to get their price.
forge script script/AstriaOracle.s.sol:AstriaOracleScript --rpc-url $RPC_URL --broadcast --sig "getPrice()" -vvvv
In .env
, set ORACLE_CONTRACT_ADDRESS
to the contract address of a deployed AstriaOracle
contract and set CURRENCY_PAIR
to the desired currency pair.
forge script script/Aggregator.s.sol:AggregatorScript --rpc-url $RPC_URL --broadcast --sig "deploy()" -vvvv
Set AGGREGATOR_CONTRACT_ADDRESS
in .env
to the deployed address.
forge script script/Aggregator.s.sol:AggregatorScript --rpc-url $RPC_URL --broadcast --sig "getLatestRoundData()" -vvvv