-
Notifications
You must be signed in to change notification settings - Fork 7
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
10 changed files
with
117 additions
and
307 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
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,31 @@ | ||
import { DeployFunction } from "hardhat-deploy/types"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { IChainLinkPriceOracle__factory } from "../../../../typechain"; | ||
import { ConfigFileHelper } from "../../../file-helper.ts/config-file.helper"; | ||
import { getDeployer } from "../../../utils/deployer-helper"; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const configFileHelper = new ConfigFileHelper(); | ||
const config = configFileHelper.getConfig(); | ||
/* | ||
░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ | ||
░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ | ||
░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ | ||
░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ | ||
░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ | ||
░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ | ||
Check all variables below before execute the deployment script | ||
*/ | ||
const TOKEN0S: string[] = [config.tokens.wbeth]; | ||
const TOKEN1S: string[] = [config.usdPlaceholder]; | ||
const SOURCES: string[] = ["0x97398272a927c56735f7bfce95752540f5e23ccd"]; | ||
|
||
const deployer = await getDeployer(); | ||
const chainLinkOracle = IChainLinkPriceOracle__factory.connect(config.oracle.chainlinkOracle, deployer); | ||
|
||
const setPriceFeedTx = await chainLinkOracle.setPriceFeeds(TOKEN0S, TOKEN1S, SOURCES); | ||
console.log(`✅Done: ${setPriceFeedTx.hash}`); | ||
}; | ||
|
||
export default func; | ||
func.tags = ["SetPriceFeed"]; |
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
42 changes: 42 additions & 0 deletions
42
deploy/exec/oracle-medianizer/config/set-multiple-primary-sources.ts
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,42 @@ | ||
import { DeployFunction } from "hardhat-deploy/types"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { OracleMedianizer__factory } from "../../../../typechain"; | ||
import { ConfigFileHelper } from "../../../file-helper.ts/config-file.helper"; | ||
import { getDeployer } from "../../../utils/deployer-helper"; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const configFileHelper = new ConfigFileHelper(); | ||
const config = configFileHelper.getConfig(); | ||
const DEFAULT_MAX_PRICE_DEVIATION = "1000000000000000000"; | ||
const DEFAULT_MAX_PRICE_STALE = 86400; | ||
/* | ||
░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ | ||
░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ | ||
░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ | ||
░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ | ||
░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ | ||
░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ | ||
Check all variables below before execute the deployment script | ||
*/ | ||
|
||
const TOKEN0S: string[] = [config.tokens.wbeth]; | ||
const TOKEN1S: string[] = [config.usdPlaceholder]; | ||
const MAX_PRICE_DEVIATIONS: string[] = [DEFAULT_MAX_PRICE_DEVIATION]; | ||
const MAX_PRICE_STALES: number[] = [DEFAULT_MAX_PRICE_STALE]; | ||
const SOURCES = [[config.oracle.chainlinkOracle]]; | ||
|
||
const deployer = await getDeployer(); | ||
const oracleMedianizer = OracleMedianizer__factory.connect(config.oracle.oracleMedianizer, deployer); | ||
|
||
const setMultiplePrimarySourcesTx = await oracleMedianizer.setMultiPrimarySources( | ||
TOKEN0S, | ||
TOKEN1S, | ||
MAX_PRICE_DEVIATIONS, | ||
MAX_PRICE_STALES, | ||
SOURCES | ||
); | ||
console.log(`✅Done: ${setMultiplePrimarySourcesTx.hash}`); | ||
}; | ||
|
||
export default func; | ||
func.tags = ["SetMultiplePrimarySources"]; |
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
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
56 changes: 0 additions & 56 deletions
56
script/deployments/ChainLinkOracle/config/SetPriceFeeds.s.sol
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.