Skip to content

Commit

Permalink
feat: oethcore deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
PraneshASP committed May 16, 2024
1 parent f107a06 commit d808477
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 4 deletions.
33 changes: 33 additions & 0 deletions contracts/deploy/base/001_core.base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const {
deployOracles,
deployOETHCore,
deployOETHDripper,
configureOETHVault,
} = require("../deployActions");

const mainExport = async () => {
console.log("Running 001_core deployment on Base...");

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

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

console.log("Deploying OETH Dripper");
await deployOETHDripper();

console.log("Configuring OETH Vault");
await configureOETHVault(true);


console.log("001_core deploy done.");
return true;
};

mainExport.id = "001_core";
mainExport.tags = ["base"];
mainExport.dependencies = [];
mainExport.skip = () => false;

module.exports = mainExport;
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const { deployOnBase } = require("../utils/delpoy-l2");
const { deployWithConfirmation, withConfirmation } = require("../utils/deploy");
const { getTxOpts } = require("../utils/tx");
const { deployOnBase } = require("../../utils/delpoy-l2");
const {
deployWithConfirmation,
withConfirmation,
} = require("../../utils/deploy");
const { getTxOpts } = require("../../utils/tx");

module.exports = deployOnBase(
{
Expand Down
27 changes: 26 additions & 1 deletion contracts/deploy/deployActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ const {
isMainnet,
isMainnetOrFork,
isHolesky,
isBaseFork,
} = require("../test/helpers.js");
const { deployWithConfirmation, withConfirmation } = require("../utils/deploy");
const {
metapoolLPCRVPid,
lusdMetapoolLPCRVPid,
} = require("../utils/constants");
const { isBase } = require("../utils/hardhat-helpers.js");

const log = require("../utils/logger")("deploy:core");

Expand Down Expand Up @@ -927,6 +929,21 @@ const deployOracles = async () => {
oracleContract = "OETHFixedOracle";
contractName = "OETHOracleRouter";
args = [addresses.zero];
} else if (isBase) {
await deployWithConfirmation(
"PriceFeedPair",
[
addresses.base.aeroUsdPriceFeed,
addresses.base.ethUsdPriceFeed,
false,
true,
],
"PriceFeedPair"
);
const priceFeedPair = await ethers.getContract("PriceFeedPair");
oracleContract = "BaseOETHOracleRouter";
contractName = "BaseOETHOracleRouter";
args = [priceFeedPair.address];
}

await deployWithConfirmation(contractName, args, oracleContract);
Expand Down Expand Up @@ -1016,6 +1033,8 @@ const deployOETHCore = async () => {

const cOETHOracleRouter = isMainnet
? await ethers.getContract("OETHOracleRouter")
: isBase
? await ethers.getContract("BaseOETHOracleRouter")
: cOracleRouter;
const cOETHVault = await ethers.getContractAt(
"IVault",
Expand Down Expand Up @@ -1074,10 +1093,16 @@ const deployOETHCore = async () => {
* Latter seems more fitting - due to mimicking production better as already mentioned.
*/
const resolution = ethers.utils.parseUnits("1", 27);
let name = "Origin Ether";
let symbol = "OETH"
if(isBase) {
name = "OETH Base";
symbol = "OETHbase";
}
await withConfirmation(
cOETH
.connect(sGovernor)
.initialize("Origin Ether", "OETH", cOETHVaultProxy.address, resolution)
.initialize(name, symbol, cOETHVaultProxy.address, resolution)
);
log("Initialized OETH");
};
Expand Down
1 change: 1 addition & 0 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"node:fork": "./node.sh fork",
"node:arb": "FORK_NETWORK_NAME=arbitrumOne yarn run node:fork",
"node:hol": "FORK_NETWORK_NAME=holesky yarn run node:fork",
"node:base": "FORK_NETWORK_NAME=BASE yarn run node:fork",
"lint": "yarn run lint:js && yarn run lint:sol",
"lint:js": "eslint \"test/**/*.js\" \"tasks/**/*.js\" \"deploy/**/*.js\"",
"lint:sol": "solhint \"contracts/**/*.sol\"",
Expand Down
3 changes: 3 additions & 0 deletions contracts/test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ const isHoleskyFork = isFork && process.env.FORK_NETWORK_NAME == "holesky";
const isArbitrumOneOrFork = isArbitrumOne || isArbFork;
const isBase = hre.network.name == "base";
const isBaseFork = isFork && process.env.FORK_NETWORK_NAME == "base";
const isBaseOrFork = isBase || isBaseFork;
const isCI = process.env.GITHUB_ACTIONS;

/// Advances the EVM time by the given number of seconds
Expand Down Expand Up @@ -432,6 +433,8 @@ const getAssetAddresses = async (deployments) => {
AURA: addresses.mainnet.AURA,
BAL: addresses.mainnet.BAL,
};
} else if(isBaseOrFork){
return { WETH: addresses.base.wethTokenAddress }
} else {
const addressMap = {
USDT: (await deployments.get("MockUSDT")).address,
Expand Down

0 comments on commit d808477

Please sign in to comment.