-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated ARB vaults deployment scripts
- Loading branch information
Showing
4 changed files
with
352 additions
and
4 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,116 @@ | ||
import { run } from "hardhat"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { | ||
CHAINID, | ||
ARB_ADDRESS, | ||
} from "../../constants/constants"; | ||
import { | ||
AUCTION_DURATION, | ||
PERFORMANCE_FEE, | ||
PREMIUM_DISCOUNT, | ||
} from "../utils/constants"; | ||
|
||
const main = async ({ | ||
network, | ||
deployments, | ||
ethers, | ||
getNamedAccounts, | ||
}: HardhatRuntimeEnvironment) => { | ||
const { BigNumber } = ethers; | ||
const { parseEther } = ethers.utils; | ||
const { deploy } = deployments; | ||
const { deployer, owner, keeper, admin, feeRecipient } = | ||
await getNamedAccounts(); | ||
console.log(`34 - Deploying ARB Treasury Vault 15% on ${network.name}`); | ||
|
||
const chainId = network.config.chainId; | ||
if (chainId !== CHAINID.ARB_MAINNET) { | ||
console.log(`Error: chainId ${chainId} not supported`); | ||
return; | ||
} | ||
|
||
const pricer = await deployments.get("OptionsPremiumPricerARB"); | ||
|
||
const strikeSelection = await deploy("ManualStrikeSelectionARB-15%", { | ||
contract: "ManualStrikeSelection", | ||
from: deployer, | ||
args: [], | ||
}); | ||
|
||
console.log( | ||
`RibbonTreasuryVaultARB strikeSelection @ ${strikeSelection.address}` | ||
); | ||
|
||
try { | ||
await run("verify:verify", { | ||
address: strikeSelection.address, | ||
constructorArguments: [], | ||
}); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
|
||
const logicDeployment = await deployments.get("RibbonTreasuryVaultV2Logic"); | ||
const lifecycle = await deployments.get("VaultLifecycleTreasury"); | ||
|
||
const RibbonTreasuryVault = await ethers.getContractFactory( | ||
"RibbonTreasuryVaultV2", | ||
{ | ||
libraries: { | ||
VaultLifecycleTreasury: lifecycle.address, | ||
}, | ||
} | ||
); | ||
|
||
const initArgs = [ | ||
{ | ||
_owner: owner, | ||
_keeper: keeper, | ||
_feeRecipient: feeRecipient, | ||
_managementFee: 0, | ||
_performanceFee: PERFORMANCE_FEE, | ||
_tokenName: "Ribbon ARB Treasury Vault", | ||
_tokenSymbol: "rARB-TSRY", | ||
_optionsPremiumPricer: pricer.address, | ||
_strikeSelection: strikeSelection.address, | ||
_premiumDiscount: PREMIUM_DISCOUNT, | ||
_auctionDuration: AUCTION_DURATION, | ||
_period: 30, | ||
_maxDepositors: 30, | ||
_minDeposit: parseEther("50000"), | ||
}, | ||
{ | ||
isPut: false, | ||
decimals: 18, | ||
asset: ARB_ADDRESS[chainId], | ||
underlying: ARB_ADDRESS[chainId], | ||
minimumSupply: BigNumber.from(10).pow(10), | ||
cap: parseEther("2000000"), | ||
}, | ||
]; | ||
const initData = RibbonTreasuryVault.interface.encodeFunctionData( | ||
"initialize", | ||
initArgs | ||
); | ||
|
||
const proxy = await deploy("RibbonTreasuryVaultARB-15%", { | ||
contract: "AdminUpgradeabilityProxy", | ||
from: deployer, | ||
args: [logicDeployment.address, admin, initData], | ||
}); | ||
|
||
console.log(`RibbonTreasuryVaultARB Proxy @ ${proxy.address}`); | ||
|
||
try { | ||
await run("verify:verify", { | ||
address: proxy.address, | ||
constructorArguments: [logicDeployment.address, admin, initData], | ||
}); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
}; | ||
main.tags = ["RibbonTreasuryVaultARB-15%"]; | ||
main.dependencies = []; //["OptionsPremiumPricerARB", "RibbonTreasuryVaultV2Logic"]; | ||
|
||
export default main; |
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,116 @@ | ||
import { run } from "hardhat"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { | ||
CHAINID, | ||
ARB_ADDRESS, | ||
} from "../../constants/constants"; | ||
import { | ||
AUCTION_DURATION, | ||
PERFORMANCE_FEE, | ||
PREMIUM_DISCOUNT, | ||
} from "../utils/constants"; | ||
|
||
const main = async ({ | ||
network, | ||
deployments, | ||
ethers, | ||
getNamedAccounts, | ||
}: HardhatRuntimeEnvironment) => { | ||
const { BigNumber } = ethers; | ||
const { parseEther } = ethers.utils; | ||
const { deploy } = deployments; | ||
const { deployer, owner, keeper, admin, feeRecipient } = | ||
await getNamedAccounts(); | ||
console.log(`35 - Deploying ARB Treasury Vault 20% on ${network.name}`); | ||
|
||
const chainId = network.config.chainId; | ||
if (chainId !== CHAINID.ARB_MAINNET) { | ||
console.log(`Error: chainId ${chainId} not supported`); | ||
return; | ||
} | ||
|
||
const pricer = await deployments.get("OptionsPremiumPricerARB"); | ||
|
||
const strikeSelection = await deploy("ManualStrikeSelectionARB-20%", { | ||
contract: "ManualStrikeSelection", | ||
from: deployer, | ||
args: [], | ||
}); | ||
|
||
console.log( | ||
`RibbonTreasuryVaultARB strikeSelection @ ${strikeSelection.address}` | ||
); | ||
|
||
try { | ||
await run("verify:verify", { | ||
address: strikeSelection.address, | ||
constructorArguments: [], | ||
}); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
|
||
const logicDeployment = await deployments.get("RibbonTreasuryVaultV2Logic"); | ||
const lifecycle = await deployments.get("VaultLifecycleTreasury"); | ||
|
||
const RibbonTreasuryVault = await ethers.getContractFactory( | ||
"RibbonTreasuryVaultV2", | ||
{ | ||
libraries: { | ||
VaultLifecycleTreasury: lifecycle.address, | ||
}, | ||
} | ||
); | ||
|
||
const initArgs = [ | ||
{ | ||
_owner: owner, | ||
_keeper: keeper, | ||
_feeRecipient: feeRecipient, | ||
_managementFee: 0, | ||
_performanceFee: PERFORMANCE_FEE, | ||
_tokenName: "Ribbon ARB Treasury Vault", | ||
_tokenSymbol: "rARB-TSRY", | ||
_optionsPremiumPricer: pricer.address, | ||
_strikeSelection: strikeSelection.address, | ||
_premiumDiscount: PREMIUM_DISCOUNT, | ||
_auctionDuration: AUCTION_DURATION, | ||
_period: 30, | ||
_maxDepositors: 30, | ||
_minDeposit: parseEther("50000"), | ||
}, | ||
{ | ||
isPut: false, | ||
decimals: 18, | ||
asset: ARB_ADDRESS[chainId], | ||
underlying: ARB_ADDRESS[chainId], | ||
minimumSupply: BigNumber.from(10).pow(10), | ||
cap: parseEther("2000000"), | ||
}, | ||
]; | ||
const initData = RibbonTreasuryVault.interface.encodeFunctionData( | ||
"initialize", | ||
initArgs | ||
); | ||
|
||
const proxy = await deploy("RibbonTreasuryVaultARB-20%", { | ||
contract: "AdminUpgradeabilityProxy", | ||
from: deployer, | ||
args: [logicDeployment.address, admin, initData], | ||
}); | ||
|
||
console.log(`RibbonTreasuryVaultARB Proxy @ ${proxy.address}`); | ||
|
||
try { | ||
await run("verify:verify", { | ||
address: proxy.address, | ||
constructorArguments: [logicDeployment.address, admin, initData], | ||
}); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
}; | ||
main.tags = ["RibbonTreasuryVaultARB-20%"]; | ||
main.dependencies = []; //["OptionsPremiumPricerARB", "RibbonTreasuryVaultV2Logic"]; | ||
|
||
export default main; |
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,116 @@ | ||
import { run } from "hardhat"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { | ||
CHAINID, | ||
ARB_ADDRESS, | ||
} from "../../constants/constants"; | ||
import { | ||
AUCTION_DURATION, | ||
PERFORMANCE_FEE, | ||
PREMIUM_DISCOUNT, | ||
} from "../utils/constants"; | ||
|
||
const main = async ({ | ||
network, | ||
deployments, | ||
ethers, | ||
getNamedAccounts, | ||
}: HardhatRuntimeEnvironment) => { | ||
const { BigNumber } = ethers; | ||
const { parseEther } = ethers.utils; | ||
const { deploy } = deployments; | ||
const { deployer, owner, keeper, admin, feeRecipient } = | ||
await getNamedAccounts(); | ||
console.log(`36 - Deploying ARB Treasury Vault 25% on ${network.name}`); | ||
|
||
const chainId = network.config.chainId; | ||
if (chainId !== CHAINID.ARB_MAINNET) { | ||
console.log(`Error: chainId ${chainId} not supported`); | ||
return; | ||
} | ||
|
||
const pricer = await deployments.get("OptionsPremiumPricerARB"); | ||
|
||
const strikeSelection = await deploy("ManualStrikeSelectionARB-25%", { | ||
contract: "ManualStrikeSelection", | ||
from: deployer, | ||
args: [], | ||
}); | ||
|
||
console.log( | ||
`RibbonTreasuryVaultARB strikeSelection @ ${strikeSelection.address}` | ||
); | ||
|
||
try { | ||
await run("verify:verify", { | ||
address: strikeSelection.address, | ||
constructorArguments: [], | ||
}); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
|
||
const logicDeployment = await deployments.get("RibbonTreasuryVaultV2Logic"); | ||
const lifecycle = await deployments.get("VaultLifecycleTreasury"); | ||
|
||
const RibbonTreasuryVault = await ethers.getContractFactory( | ||
"RibbonTreasuryVaultV2", | ||
{ | ||
libraries: { | ||
VaultLifecycleTreasury: lifecycle.address, | ||
}, | ||
} | ||
); | ||
|
||
const initArgs = [ | ||
{ | ||
_owner: owner, | ||
_keeper: keeper, | ||
_feeRecipient: feeRecipient, | ||
_managementFee: 0, | ||
_performanceFee: PERFORMANCE_FEE, | ||
_tokenName: "Ribbon ARB Treasury Vault", | ||
_tokenSymbol: "rARB-TSRY", | ||
_optionsPremiumPricer: pricer.address, | ||
_strikeSelection: strikeSelection.address, | ||
_premiumDiscount: PREMIUM_DISCOUNT, | ||
_auctionDuration: AUCTION_DURATION, | ||
_period: 30, | ||
_maxDepositors: 30, | ||
_minDeposit: parseEther("50000"), | ||
}, | ||
{ | ||
isPut: false, | ||
decimals: 18, | ||
asset: ARB_ADDRESS[chainId], | ||
underlying: ARB_ADDRESS[chainId], | ||
minimumSupply: BigNumber.from(10).pow(10), | ||
cap: parseEther("2000000"), | ||
}, | ||
]; | ||
const initData = RibbonTreasuryVault.interface.encodeFunctionData( | ||
"initialize", | ||
initArgs | ||
); | ||
|
||
const proxy = await deploy("RibbonTreasuryVaultARB-25%", { | ||
contract: "AdminUpgradeabilityProxy", | ||
from: deployer, | ||
args: [logicDeployment.address, admin, initData], | ||
}); | ||
|
||
console.log(`RibbonTreasuryVaultARB Proxy @ ${proxy.address}`); | ||
|
||
try { | ||
await run("verify:verify", { | ||
address: proxy.address, | ||
constructorArguments: [logicDeployment.address, admin, initData], | ||
}); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
}; | ||
main.tags = ["RibbonTreasuryVaultARB-25%"]; | ||
main.dependencies = []; //["OptionsPremiumPricerARB", "RibbonTreasuryVaultV2Logic"]; | ||
|
||
export default main; |