Skip to content

Commit

Permalink
feat: set oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
rhlsthrm committed Dec 2, 2024
1 parent 54c3139 commit ffb1458
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/contracts/tasks/chain-specific/base/hypernative.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { task } from "hardhat/config";
import { Address } from "viem";
import { USDC_MARKET } from ".";
import { configureAddress } from "../../../chainDeploy/helpers/liquidators/ionicLiquidator";

const HYPERNATIVE_ORACLE = "0x98fEFA40BE865394903fDe4B2A8B352a5F28202e";

task("markets:upgrade-and-setup:hypernative", "Upgrades all markets and sets addresses provider on them").setAction(
async (_, { viem, deployments, run, getNamedAccounts }) => {
Expand All @@ -20,3 +23,15 @@ task("markets:upgrade-and-setup:hypernative", "Upgrades all markets and sets add
});
}
);

task("hypernative:set-address", "Set the address for the hypernative oracle").setAction(
async (_, { viem, deployments, getNamedAccounts }) => {
const { deployer } = await getNamedAccounts();
const ap = await viem.getContractAt(
"AddressesProvider",
(await deployments.get("AddressesProvider")).address as Address
);
const publicClient = await viem.getPublicClient();
await configureAddress(ap, publicClient, deployer, "HYPERNATIVE_ORACLE", HYPERNATIVE_ORACLE);
}
);

0 comments on commit ffb1458

Please sign in to comment.