-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
# astria-oracle-contracts | ||
|
||
Repository of contracts used for Astria's native oracle. | ||
|
||
### deploy | ||
|
||
Copy the example .env: `cp local.env.example .env` | ||
|
||
Put your private key in `.env` and `source .env`. | ||
|
||
To deploy `AstriaOracle.sol`: | ||
|
||
```sh | ||
forge script script/AstriaOracle.s.sol:AstriaOracleScript \ | ||
--rpc-url $RPC_URL --broadcast --sig "deploy()" -vvvv | ||
``` | ||
|
||
### query contract | ||
|
||
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. | ||
|
||
```sh | ||
forge script script/AstriaOracle.s.sol:AstriaOracleScript --rpc-url $RPC_URL --broadcast --sig "getPrice()" -vvvv | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# private key to submit txs with | ||
PRIVATE_KEY=0x | ||
|
||
# default local rpc url | ||
RPC_URL="http://localhost:8545" | ||
|
||
### contract deployment values | ||
|
||
# the `astriaOracleCallerAddress` built into the astria-geth node | ||
# in production, the private key for this address must NOT be known. | ||
EVM_ORACLE_SENDER_ADDRESS=0x0000000000000000000000000000000000000088 | ||
|
||
### contract call values | ||
|
||
ORACLE_CONTRACT_ADDRESS=0x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters