Skip to content

Commit

Permalink
feat: deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
djm07073 committed Feb 5, 2025
1 parent ae4c8f4 commit 4747cbd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ out/
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/

broadcast/*
# Docs
docs/

Expand Down
31 changes: 9 additions & 22 deletions script/ConnectOracle.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,19 @@
pragma solidity ^0.8.24;

import "forge-std/Script.sol";
import {ConnectOracle, Price} from "../src/ConnectOracle.sol";
import {ConnectOracle, Price} from "src/ConnectOracle.sol";
// forge script script/ConnectOracle.s.sol:ConnectOracleDeployScript\
// --rpc-url $JSON_RPC_URL\
// --broadcast \
// --interactives 1

contract OracleScript is Script {
contract ConnectOracleDeployScript is Script {
ConnectOracle public oracle;

constructor(address _oracle) {
oracle = ConnectOracle(_oracle);
}

function getPrice(string memory pairId) public {
vm.startBroadcast();
Price memory price = oracle.get_price(pairId);
console.log("Price:", price.price);
vm.stopBroadcast();
}

function getAllCurrencyPairs() public {
function run() public {
vm.startBroadcast();
string memory prices = oracle.get_all_currency_pairs();
console.log("Prices:", prices);
oracle = new ConnectOracle();
console.log("Deployed ConnectOracle:", address(oracle));
vm.stopBroadcast();
}

function getPrices(
string[] memory pair_ids
) public returns (Price[] memory) {
return oracle.get_prices(pair_ids);
}
}
5 changes: 0 additions & 5 deletions test/Counter.t.sol

This file was deleted.

0 comments on commit 4747cbd

Please sign in to comment.