Skip to content

Commit

Permalink
Update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahilgat committed Jul 30, 2023
1 parent b51dc3a commit 5285e25
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 8 deletions.
13 changes: 5 additions & 8 deletions scripts/deploy/28_samb_treasury_vault.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { run } from "hardhat";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import {
CHAINID,
SAMB_ADDRESS,
} from "../../constants/constants";
import { CHAINID, SAMB_ADDRESS } from "../../constants/constants";
import {
AUCTION_DURATION,
PERFORMANCE_FEE,
Expand All @@ -30,7 +27,7 @@ const main = async ({
return;
}

const logicDeployment = await deployments.get("RibbonTreasuryVaultLogicSAMB");
const logicDeployment = await deployments.get("RibbonTreasuryVaultLogicBare");
console.log(`LogicDeployment @ ${logicDeployment.address}`);
const lifecycleAddress = logicDeployment.libraries.VaultLifecycleTreasuryBare;
console.log(`VaultLifeCycleTreasuryBare @ ${lifecycleAddress}`);
Expand All @@ -39,7 +36,7 @@ const main = async ({
"RibbonTreasuryVaultBare",
{
libraries: {
VaultLifecycleTreasury: lifecycleAddress,
VaultLifecycleTreasuryBare: lifecycleAddress,
},
}
);
Expand All @@ -59,7 +56,7 @@ const main = async ({
_auctionDuration: AUCTION_DURATION,
_period: 30,
_maxDepositors: 30,
_minDeposit: parseEther("5"),
_minDeposit: 10000000000,
},
{
isPut: false,
Expand Down Expand Up @@ -93,6 +90,6 @@ const main = async ({
}
};
main.tags = ["RibbonTreasuryVaultSAMB"];
main.dependencies = []; //["ManualVolOracle", "RibbonTreasuryVaultLogic"];
main.dependencies = ["RibbonTreasuryVaultLogicBare"];

export default main;
71 changes: 71 additions & 0 deletions scripts/deploy/33_treasury_vault_logic_bare.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { run } from "hardhat";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import {
USDC_ADDRESS,
GNOSIS_EASY_AUCTION,
WETH_ADDRESS,
} from "../../constants/constants";

const main = async ({
network,
deployments,
getNamedAccounts,
}: HardhatRuntimeEnvironment) => {
const chainId = network.config.chainId;

const { deploy } = deployments;
const { deployer } = await getNamedAccounts();
console.log(`12 - Deploying Treasury Vault logic on ${network.name}`);

const lifecycleTreasury = await deploy("VaultLifecycleTreasuryBare", {
contract: "VaultLifecycleTreasuryBare",
from: deployer,
});
console.log(`VaultLifeCycleTreasuryBare @ ${lifecycleTreasury.address}`);

const vault = await deploy("RibbonTreasuryVaultLogicBare", {
contract: "RibbonTreasuryVaultBare",
from: deployer,
args: [
WETH_ADDRESS[chainId],
USDC_ADDRESS[chainId],
"0x4114b7c04bbba682130cae2ba26fc5d2473b4ddc", // OTOKEN_FACTORY
"0x4bec71A4Ac41eE9761440F6921DD17bA1C1213B1", // GAMMA_CONTROLLER
"0x3c212A044760DE5a529B3Ba59363ddeCcc2210bE", // MARGIN_POOL
GNOSIS_EASY_AUCTION[chainId],
],
libraries: {
VaultLifecycleTreasuryBare: lifecycleTreasury.address,
},
});

console.log(`RibbonTreasuryVaultLogicBare @ ${vault.address}`);

try {
await run("verify:verify", {
address: lifecycleTreasury.address,
constructorArguments: [],
});
} catch (error) {
console.log(error);
}

try {
await run("verify:verify", {
address: vault.address,
constructorArguments: [
WETH_ADDRESS[chainId],
USDC_ADDRESS[chainId],
"0x4114b7c04bbba682130cae2ba26fc5d2473b4ddc", // OTOKEN_FACTORY
"0x4bec71A4Ac41eE9761440F6921DD17bA1C1213B1", // GAMMA_CONTROLLER
"0x3c212A044760DE5a529B3Ba59363ddeCcc2210bE", // MARGIN_POOL
GNOSIS_EASY_AUCTION[chainId],
],
});
} catch (error) {
console.log(error);
}
};
main.tags = ["RibbonTreasuryVaultLogicBare"];

export default main;

0 comments on commit 5285e25

Please sign in to comment.