Skip to content

Commit

Permalink
chore: fix deployment setup
Browse files Browse the repository at this point in the history
  • Loading branch information
PraneshASP committed May 16, 2024
1 parent d808477 commit 2cfb600
Show file tree
Hide file tree
Showing 5 changed files with 546 additions and 2,249 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const mainExport = async () => {

console.log("Deploying Oracles");
await deployOracles();

console.log("Deploying OETH Core");
await deployOETHCore();

Expand All @@ -20,7 +20,6 @@ const mainExport = async () => {
console.log("Configuring OETH Vault");
await configureOETHVault(true);


console.log("001_core deploy done.");
return true;
};
Expand Down
16 changes: 8 additions & 8 deletions contracts/deploy/deployActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -947,10 +947,10 @@ const deployOracles = async () => {
}

await deployWithConfirmation(contractName, args, oracleContract);
const oracleRouter = await ethers.getContract("OracleRouter");
const oracleRouter = await ethers.getContract(contractName);
log("Deployed OracleRouter");

if (isHolesky) {
if (isHolesky || isBase) {
// no need to configure any feeds since they are hardcoded to a fixed feed
// TODO: further deployments will require more intelligent separation of different
// chains / environment oracle deployments
Expand Down Expand Up @@ -1029,13 +1029,13 @@ const deployOETHCore = async () => {
const cOETHProxy = await ethers.getContract("OETHProxy");
const cOETHVaultProxy = await ethers.getContract("OETHVaultProxy");
const cOETH = await ethers.getContractAt("OETH", cOETHProxy.address);
const cOracleRouter = await ethers.getContract("OracleRouter");
// const cOracleRouter = await ethers.getContract("OracleRouter");

const cOETHOracleRouter = isMainnet
? await ethers.getContract("OETHOracleRouter")
: isBase
: isBase
? await ethers.getContract("BaseOETHOracleRouter")
: cOracleRouter;
: await ethers.getContract("OracleRouter");
const cOETHVault = await ethers.getContractAt(
"IVault",
cOETHVaultProxy.address
Expand Down Expand Up @@ -1094,11 +1094,11 @@ const deployOETHCore = async () => {
*/
const resolution = ethers.utils.parseUnits("1", 27);
let name = "Origin Ether";
let symbol = "OETH"
if(isBase) {
let symbol = "OETH";
if (isBase) {
name = "OETH Base";
symbol = "OETHbase";
}
}
await withConfirmation(
cOETH
.connect(sGovernor)
Expand Down
14 changes: 12 additions & 2 deletions contracts/hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("dotenv").config();
const ethers = require("ethers");
const { task } = require("hardhat/config");
const {
Expand All @@ -15,6 +16,8 @@ const {
getHardhatNetworkProperties,
isBaseFork,
baseProviderUrl,
isBase,
isBaseForkTest,
} = require("./utils/hardhat-helpers.js");

require("@nomiclabs/hardhat-etherscan");
Expand Down Expand Up @@ -45,6 +48,7 @@ const MAINNET_MULTISIG = "0xbe2AB3d3d8F6a32b96414ebbd865dBD276d3d899";
const MAINNET_CLAIM_ADJUSTER = MAINNET_DEPLOYER;
const MAINNET_STRATEGIST = "0xf14bbdf064e3f67f51cd9bd646ae3716ad938fdc";
const HOLESKY_DEPLOYER = "0x1b94CA50D3Ad9f8368851F8526132272d1a5028C";
const BASE_DEPLOYER = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266";

const mnemonic =
"replace hover unaware super where filter stone fine garlic address matrix basic";
Expand All @@ -68,10 +72,13 @@ const paths = {};
if (isHolesky || isHoleskyForkTest || isHoleskyFork) {
// holesky deployment files are in contracts/deploy/holesky
paths.deploy = "deploy/holesky";
} else if (isBase || isBaseForkTest || isBaseFork) {
// base deployment files are in contracts/deploy/base
paths.deploy = "deploy/base";
} else {
// holesky deployment files are in contracts/deploy/mainnet
paths.deploy = "deploy/mainnet";
}

if (process.env.HARDHAT_CACHE_DIR) {
paths.cache = process.env.HARDHAT_CACHE_DIR;
}
Expand Down Expand Up @@ -189,6 +196,7 @@ module.exports = {
mainnet: MAINNET_DEPLOYER,
arbitrumOne: MAINNET_DEPLOYER,
holesky: HOLESKY_DEPLOYER,
base: BASE_DEPLOYER,
},
governorAddr: {
default: 1,
Expand All @@ -197,6 +205,8 @@ module.exports = {
process.env.FORK === "true"
? isHoleskyFork
? HOLESKY_DEPLOYER
: isBaseFork
? BASE_DEPLOYER
: MAINNET_GOVERNOR
: 1,
hardhat:
Expand All @@ -207,7 +217,7 @@ module.exports = {
: 1,
mainnet: MAINNET_GOVERNOR,
holesky: HOLESKY_DEPLOYER, // on Holesky the deployer is also the governor
base: MAINNET_GOVERNOR, // TODO: change this
base: BASE_DEPLOYER, // TODO: change this
},
/* Local node environment currently has no access to Decentralized governance
* address, since the contract is in another repo. Once we merge the ousd-governance
Expand Down
4 changes: 2 additions & 2 deletions contracts/test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@ const getAssetAddresses = async (deployments) => {
AURA: addresses.mainnet.AURA,
BAL: addresses.mainnet.BAL,
};
} else if(isBaseOrFork){
return { WETH: addresses.base.wethTokenAddress }
} else if (isBaseOrFork) {
return { WETH: addresses.base.wethTokenAddress };
} else {
const addressMap = {
USDT: (await deployments.get("MockUSDT")).address,
Expand Down

0 comments on commit 2cfb600

Please sign in to comment.