Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New release #223

Merged
merged 4 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [2.5.1-dev.1](https://github.com/VenusProtocol/oracle/compare/v2.5.0...v2.5.1-dev.1) (2024-09-10)


### Bug Fixes

* restore deployment script to configure some price feeds on hardhat ([ee980da](https://github.com/VenusProtocol/oracle/commit/ee980da7253f882861ef4f97dcda0cb4c17711d4))

## [2.5.0](https://github.com/VenusProtocol/oracle/compare/v2.4.0...v2.5.0) (2024-09-10)


Expand Down
47 changes: 47 additions & 0 deletions deploy/3-configure-feeds.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import hre from "hardhat";
import { DeployFunction } from "hardhat-deploy/dist/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";

import { Oracles, assets, getOraclesData } from "../helpers/deploymentConfig";

const func: DeployFunction = async function ({ network, deployments, getNamedAccounts }: HardhatRuntimeEnvironment) {
const { deploy } = deployments;
const { deployer } = await getNamedAccounts();

const resilientOracle = await hre.ethers.getContract("ResilientOracle");

const oraclesData: Oracles = await getOraclesData();

for (const asset of assets[network.name]) {
const { oracle } = asset;
console.log(`Configuring ${asset.token}`);

await deploy(`Mock${asset.token}`, {
from: deployer,
log: true,
deterministicDeployment: false,
args: [`Mock${asset.token}`, `Mock${asset.token}`, 18],
autoMine: true,
contract: "BEP20Harness",
});

const mock = await hre.ethers.getContract(`Mock${asset.token}`);

console.log(`Configuring resilient oracle for ${asset.token}`);
let tx = await resilientOracle.setTokenConfig({
asset: mock.address,
oracles: oraclesData[oracle].oracles,
enableFlagsForOracles: oraclesData[oracle].enableFlagsForOracles,
});

await tx.wait(1);

console.log(`Configuring ${oracle} oracle for ${asset.token}`);
tx = await oraclesData[oracle].underlyingOracle?.setPrice(mock.address, asset.price);
await tx.wait(1);
}
};

export default func;
func.tags = ["configure"];
func.skip = async env => env.network.live;
62 changes: 62 additions & 0 deletions helpers/deploymentConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,68 @@ export const pythID: Config = {
};

export const assets: Assets = {
hardhat: [
{
token: "BNX",
address: "",
oracle: "chainlinkFixed",
price: "159990000000000000000",
},
{
token: "BTCB",
address: "",
oracle: "chainlinkFixed",
price: "208000000000000000",
},
{
token: "XVS",
address: "",
oracle: "chainlinkFixed",
price: "208000000000000000",
},
{
token: "ANKR",
address: "",
oracle: "chainlinkFixed",
price: "159990000000000000000",
},
{
token: "ankrBNB",
address: "",
oracle: "chainlinkFixed",
price: "159990000000000000000",
},
{
token: "MBOX",
address: "",
oracle: "chainlinkFixed",
price: "159990000000000000000",
},
{
token: "NFT",
address: "",
oracle: "chainlinkFixed",
price: "159990000000000000000",
},
{
token: "RACA",
address: "",
oracle: "chainlinkFixed",
price: "159990000000000000000",
},
{
token: "stkBNB",
address: "",
oracle: "chainlinkFixed",
price: "159990000000000000000",
},
{
token: "USDD",
address: "",
oracle: "chainlinkFixed",
price: "159990000000000000000",
},
],
bsctestnet: [
{
token: "BNX",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@venusprotocol/oracle",
"description": "Venus Protocol Price Oracle",
"version": "2.5.0",
"version": "2.5.1-dev.1",
"author": "Venus",
"engines": {
"node": ">=18.x.x"
Expand Down