Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VR proposal #332

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ dist/
.idea/
.DS_Store
addresses/localhost/
addresses/tenderly/
tmp/

# Foundry
Expand Down
5 changes: 5 additions & 0 deletions addresses/arb_mainnet/vyJoins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dataType": "Map",
"value": []
}

4 changes: 4 additions & 0 deletions addresses/arb_mainnet/vyTokens.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"dataType": "Map",
"value": []
}
5 changes: 5 additions & 0 deletions addresses/mainnet/vyJoins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dataType": "Map",
"value": []
}

4 changes: 4 additions & 0 deletions addresses/mainnet/vyTokens.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"dataType": "Map",
"value": []
}
2 changes: 1 addition & 1 deletion contracts/ERC20Mock.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
import "@yield-protocol/utils-v2/contracts/token/ERC20Permit.sol";
import "@yield-protocol/utils-v2/src/token/ERC20Permit.sol";


contract ERC20Mock is ERC20Permit {
Expand Down
2 changes: 1 addition & 1 deletion contracts/IdentityOracle.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.15;

import "@yield-protocol/vault-v2/contracts/interfaces/IOracle.sol";
import "@yield-protocol/vault-v2/src/interfaces/IOracle.sol";

contract IdentityOracle is IOracle {
function peek(
Expand Down
84 changes: 46 additions & 38 deletions contracts/Importer.sol
Original file line number Diff line number Diff line change
@@ -1,48 +1,56 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.13;

import "@yield-protocol/vault-v2/contracts/modules/HealerModule.sol";
import "@yield-protocol/vault-v2/contracts/modules/RepayFromLadleModule.sol";
import "@yield-protocol/vault-v2/contracts/oracles/accumulator/AccumulatorMultiOracle.sol";
import "@yield-protocol/vault-v2/contracts/oracles/chainlink/ChainlinkMultiOracle.sol";
import "@yield-protocol/vault-v2/contracts/oracles/chainlink/ChainlinkUSDMultiOracle.sol";
import "@yield-protocol/vault-v2/contracts/oracles/chainlink/ChainlinkL2USDMultiOracle.sol";
import "@yield-protocol/vault-v2/contracts/oracles/compound/CompoundMultiOracle.sol";
import "@yield-protocol/vault-v2/contracts/oracles/composite/CompositeMultiOracle.sol";
import "@yield-protocol/vault-v2/contracts/oracles/compound/CTokenMultiOracle.sol";
import "@yield-protocol/vault-v2/contracts/oracles/uniswap/UniswapV3Oracle.sol";
import "@yield-protocol/vault-v2/contracts/oracles/lido/LidoOracle.sol";
import "@yield-protocol/vault-v2/contracts/oracles/lido/IWstETH.sol";
import "@yield-protocol/vault-v2/contracts/oracles/yearn/YearnVaultMultiOracle.sol";
import "@yield-protocol/vault-v2/contracts/oracles/yearn/IYvToken.sol";
// import "@yield-protocol/vault-v2/contracts/oracles/crab/CrabOracle.sol";
import "@yield-protocol/vault-v2/contracts/oracles/yieldspace/YieldSpaceMultiOracle.sol";
// import "@yield-protocol/vault-v2/contracts/oracles/rocket/RETHOracle.sol";
import "@yield-protocol/vault-v2/contracts/other/tether/TetherJoin.sol";
import "@yield-protocol/vault-v2/contracts/other/notional/NotionalJoin.sol";
import "@yield-protocol/vault-v2/contracts/other/notional/NotionalMultiOracle.sol";
import "@yield-protocol/vault-v2/contracts/other/notional/Transfer1155Module.sol";
import "@yield-protocol/vault-v2/contracts/other/notional/ERC1155Mock.sol";
import "@yield-protocol/vault-v2/contracts/other/ether/WrapEtherModule.sol";
import "@yield-protocol/vault-v2/contracts/utils/Giver.sol";
import "@yield-protocol/vault-v2/contracts/Join.sol";
import "@yield-protocol/vault-v2/contracts/FlashJoin.sol";
import "@yield-protocol/vault-v2/contracts/FYToken.sol";
import "@yield-protocol/vault-v2/contracts/Cauldron.sol";
import "@yield-protocol/vault-v2/contracts/Ladle.sol";
import "@yield-protocol/vault-v2/contracts/Witch.sol";
import "@yield-protocol/vault-v2/src/modules/HealerModule.sol";
import "@yield-protocol/vault-v2/src/modules/RepayFromLadleModule.sol";
import "@yield-protocol/vault-v2/src/oracles/accumulator/AccumulatorMultiOracle.sol";
import "@yield-protocol/vault-v2/src/oracles/chainlink/ChainlinkMultiOracle.sol";
import "@yield-protocol/vault-v2/src/oracles/chainlink/ChainlinkUSDMultiOracle.sol";
import "@yield-protocol/vault-v2/src/oracles/chainlink/ChainlinkL2USDMultiOracle.sol";
import "@yield-protocol/vault-v2/src/oracles/compound/CompoundMultiOracle.sol";
import "@yield-protocol/vault-v2/src/oracles/composite/CompositeMultiOracle.sol";
import "@yield-protocol/vault-v2/src/oracles/compound/CTokenMultiOracle.sol";
import "@yield-protocol/vault-v2/src/oracles/uniswap/UniswapV3Oracle.sol";
import "@yield-protocol/vault-v2/src/oracles/lido/LidoOracle.sol";
import "@yield-protocol/vault-v2/src/oracles/lido/IWstETH.sol";
import "@yield-protocol/vault-v2/src/oracles/yearn/YearnVaultMultiOracle.sol";
import "@yield-protocol/vault-v2/src/oracles/yearn/IYvToken.sol";
// import "@yield-protocol/vault-v2/src/oracles/crab/CrabOracle.sol";
import "@yield-protocol/vault-v2/src/oracles/yieldspace/YieldSpaceMultiOracle.sol";
// import "@yield-protocol/vault-v2/src/oracles/rocket/RETHOracle.sol";
import "@yield-protocol/vault-v2/src/other/tether/TetherJoin.sol";
import "@yield-protocol/vault-v2/src/other/notional/NotionalJoin.sol";
import "@yield-protocol/vault-v2/src/other/notional/NotionalMultiOracle.sol";
import "@yield-protocol/vault-v2/src/other/notional/Transfer1155Module.sol";
import "@yield-protocol/vault-v2/src/other/notional/ERC1155Mock.sol";
import "@yield-protocol/vault-v2/src/modules/WrapEtherModule.sol";
import "@yield-protocol/vault-v2/src/utils/Giver.sol";
import "@yield-protocol/vault-v2/src/Join.sol";
import "@yield-protocol/vault-v2/src/FlashJoin.sol";
import "@yield-protocol/vault-v2/src/FYToken.sol";
import "@yield-protocol/vault-v2/src/Cauldron.sol";
import "@yield-protocol/vault-v2/src/Ladle.sol";
import "@yield-protocol/vault-v2/src/Witch.sol";
import "@yield-protocol/yieldspace-tv/src/YieldMath.sol";
import "@yield-protocol/yieldspace-tv/src/Pool/Pool.sol";
import "@yield-protocol/yieldspace-tv/src/Pool/Modules/PoolNonTv.sol";
import "@yield-protocol/yieldspace-tv/src/Pool/Modules/PoolYearnVault.sol";
import "@yield-protocol/yieldspace-tv/src/Pool/Modules/PoolEuler.sol";
import "@yield-protocol/yieldspace-tv/src/oracle/PoolOracle.sol";
import "@yield-protocol/utils-v2/contracts/utils/Timelock.sol";
import "@yield-protocol/utils-v2/contracts/utils/EmergencyBrake.sol";
import "@yield-protocol/utils-v2/contracts/utils/Assert.sol";
import "@yield-protocol/strategy-v2/contracts/Strategy.sol";
import "@yield-protocol/utils-v2/src/utils/Timelock.sol";
import "@yield-protocol/utils-v2/src/utils/EmergencyBrake.sol";
import "@yield-protocol/utils-v2/src/utils/Assert.sol";
import "@yield-protocol/strategy-v2/src/Strategy.sol";
// import "@yield-protocol/vault-v2/contracts/oracles/strategy/StrategyOracle.sol";
import "@yield-protocol/vault-v2/contracts/other/contango/ContangoLadle.sol";
import "@yield-protocol/vault-v2/contracts/other/contango/ContangoWitch.sol";
import "@yield-protocol/yvarb/contracts/YieldStEthLever.sol";
import "@yield-protocol/yvarb/contracts/YieldNotionalLever.sol";
import "@yield-protocol/vault-v2/src/other/contango/ContangoLadle.sol";
import "@yield-protocol/vault-v2/src/other/contango/ContangoWitch.sol";
// import "@yield-protocol/yvarb/contracts/YieldStEthLever.sol";
// import "@yield-protocol/yvarb/contracts/YieldNotionalLever.sol";
import "@yield-protocol/vault-v2/src/variable/VRCauldron.sol";
import "@yield-protocol/vault-v2/src/variable/VRLadle.sol";
import "@yield-protocol/vault-v2/src/variable/VRWitch.sol";
import "@yield-protocol/vault-v2/src/variable/VYToken.sol";
import "@yield-protocol/vault-v2/src/variable/VRRouter.sol";
import "@yield-protocol/vault-v2/src/oracles/VariableInterestRateOracle.sol";
import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
2 changes: 1 addition & 1 deletion contracts/OldEmergencyBrake.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;
import "@yield-protocol/utils-v2/contracts/access/AccessControl.sol";
import "@yield-protocol/utils-v2/src/access/AccessControl.sol";


interface IEmergencyBrake {
Expand Down
2 changes: 1 addition & 1 deletion contracts/RegistryInterfaces.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.0;
import "@yield-protocol/vault-v2/contracts/interfaces/DataTypes.sol";
import "@yield-protocol/vault-v2/src/interfaces/DataTypes.sol";
import "@yield-protocol/yieldspace-tv/src/interfaces/IPool.sol";


Expand Down
6 changes: 3 additions & 3 deletions contracts/Roller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ pragma solidity >=0.8.15;
import "erc3156/contracts/interfaces/IERC3156FlashBorrower.sol";
import "erc3156/contracts/interfaces/IERC3156FlashLender.sol";
import "@yield-protocol/yieldspace-tv/src/interfaces/IMaturingToken.sol";
import "@yield-protocol/vault-v2/contracts/interfaces/IFYToken.sol";
import "@yield-protocol/vault-v2/src/interfaces/IFYToken.sol";
// import "@yield-protocol/vault-interfaces/src/ILadle.sol";
import "@yield-protocol/yieldspace-tv/src/interfaces/IPool.sol";
// import "@yield-protocol/strategy-v2/contracts/IStrategy.sol";
import "@yield-protocol/utils-v2/contracts/token/MinimalTransferHelper.sol";
import "@yield-protocol/utils-v2/contracts/access/AccessControl.sol";
import "@yield-protocol/utils-v2/src/token/MinimalTransferHelper.sol";
import "@yield-protocol/utils-v2/src/access/AccessControl.sol";

interface ILadle {
function joins(bytes6) external view returns (address);
Expand Down
12 changes: 6 additions & 6 deletions contracts/Solvency.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.15;
import "@yield-protocol/vault-v2/contracts/interfaces/DataTypes.sol";
import "@yield-protocol/vault-v2/contracts/interfaces/IFYToken.sol";
import "@yield-protocol/utils-v2/contracts/math/WDiv.sol";
import "@yield-protocol/utils-v2/contracts/cast/CastU256I256.sol";
import "@yield-protocol/vault-v2/src/interfaces/DataTypes.sol";
import "@yield-protocol/vault-v2/src/interfaces/IFYToken.sol";
import "@yield-protocol/utils-v2/src/utils/Math.sol";
import "@yield-protocol/utils-v2/src/utils/Cast.sol";
import "./RegistryInterfaces.sol";

interface INotionalJoin {
Expand All @@ -14,8 +14,8 @@ interface INotionalJoin {
/// aggregated ETH value of fyToken in circulation against the aggregated ETH value
/// of all assets in the Joins
contract Solvency {
using CastU256I256 for uint256;
using WDiv for uint256;
using Cast for uint256;
using Math for uint256;

bytes6 constant public ETH = 0x303000000000;
address constant public FCASH = 0x1344A36A1B56144C3Bc62E7757377D288fDE0369;
Expand Down
6 changes: 3 additions & 3 deletions contracts/Trader.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ pragma solidity >=0.8.15;
import "erc3156/contracts/interfaces/IERC3156FlashBorrower.sol";
import "erc3156/contracts/interfaces/IERC3156FlashLender.sol";
import "@yield-protocol/yieldspace-tv/src/interfaces/IMaturingToken.sol";
import "@yield-protocol/vault-v2/contracts/interfaces/IFYToken.sol";
import "@yield-protocol/vault-v2/src/interfaces/IFYToken.sol";
import "@yield-protocol/yieldspace-tv/src/interfaces/IPool.sol";
import "@yield-protocol/utils-v2/contracts/token/MinimalTransferHelper.sol";
import "@yield-protocol/utils-v2/contracts/access/AccessControl.sol";
import "@yield-protocol/utils-v2/src/token/MinimalTransferHelper.sol";
import "@yield-protocol/utils-v2/src/access/AccessControl.sol";

interface ITrader {
function authorize(address grantee) external;
Expand Down
2 changes: 1 addition & 1 deletion contracts/deprecated/OldEmergencyBrake.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;
import "@yield-protocol/utils-v2/contracts/access/AccessControl.sol";
import "@yield-protocol/utils-v2/src/access/AccessControl.sol";


interface IEmergencyBrake {
Expand Down
31 changes: 14 additions & 17 deletions contracts/deprecated/OldWitch.sol
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.6;

import "@yield-protocol/utils-v2/contracts/access/AccessControl.sol";
import "@yield-protocol/vault-v2/contracts/interfaces/ILadle.sol";
import "@yield-protocol/vault-v2/contracts/interfaces/ICauldron.sol";
import "@yield-protocol/vault-v2/contracts/interfaces/IJoin.sol";
import "@yield-protocol/vault-v2/contracts/interfaces/DataTypes.sol";
import "@yield-protocol/utils-v2/contracts/math/WMul.sol";
import "@yield-protocol/utils-v2/contracts/math/WMulUp.sol";
import "@yield-protocol/utils-v2/contracts/math/WDiv.sol";
import "@yield-protocol/utils-v2/contracts/math/WDivUp.sol";
import "@yield-protocol/utils-v2/contracts/cast/CastU256U128.sol";
import "@yield-protocol/utils-v2/contracts/cast/CastU256U32.sol";
import "@yield-protocol/utils-v2/src/access/AccessControl.sol";
import "@yield-protocol/vault-v2/src/interfaces/ILadle.sol";
import "@yield-protocol/vault-v2/src/interfaces/ICauldron.sol";
import "@yield-protocol/vault-v2/src/interfaces/IJoin.sol";
import "@yield-protocol/vault-v2/src/interfaces/DataTypes.sol";
import "@yield-protocol/utils-v2/src/utils/Math.sol";
import "@yield-protocol/utils-v2/src/utils/Cast.sol";


contract OldWitch is AccessControl() {
using WMul for uint256;
using WMulUp for uint256;
using WDiv for uint256;
using WDivUp for uint256;
using CastU256U128 for uint256;
using CastU256U32 for uint256;
using Math for uint256;
using Math for uint256;
using Math for uint256;
using Math for uint256;
using Cast for uint256;
using Cast for uint256;

event Point(bytes32 indexed param, address value);
event IlkSet(bytes6 indexed ilkId, uint32 duration, uint64 initialOffer, uint96 line, uint24 dust, uint8 dec);
Expand Down
23 changes: 10 additions & 13 deletions contracts/deprecated/StrategyV1.sol
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.13;

import "@yield-protocol/utils-v2/contracts/access/AccessControl.sol";
import "@yield-protocol/utils-v2/contracts/token/SafeERC20Namer.sol";
import "@yield-protocol/utils-v2/contracts/token/MinimalTransferHelper.sol";
import "@yield-protocol/utils-v2/contracts/token/IERC20.sol";
import "@yield-protocol/utils-v2/contracts/token/ERC20Rewards.sol";
import "@yield-protocol/utils-v2/contracts/cast/CastU256I128.sol";
import "@yield-protocol/utils-v2/contracts/cast/CastU128I128.sol";
import "@yield-protocol/vault-v2/contracts/interfaces/DataTypes.sol";
import "@yield-protocol/vault-v2/contracts/interfaces/ICauldron.sol";
import "@yield-protocol/vault-v2/contracts/interfaces/ILadle.sol";
import "@yield-protocol/utils-v2/src/access/AccessControl.sol";
import "@yield-protocol/utils-v2/src/token/SafeERC20Namer.sol";
import "@yield-protocol/utils-v2/src/token/MinimalTransferHelper.sol";
import "@yield-protocol/utils-v2/src/token/IERC20.sol";
import "@yield-protocol/utils-v2/src/token/ERC20Rewards.sol";
import "@yield-protocol/utils-v2/src/utils/Cast.sol";
import "@yield-protocol/vault-v2/src/interfaces/DataTypes.sol";
import "@yield-protocol/vault-v2/src/interfaces/ICauldron.sol";
import "@yield-protocol/vault-v2/src/interfaces/ILadle.sol";
import "@yield-protocol/yieldspace-tv/src/interfaces/IPool.sol";
import "./YieldMathExtensions.sol";

Expand All @@ -29,9 +28,7 @@ contract StrategyV1 is AccessControl, ERC20Rewards {
using DivUp for uint256;
using MinimalTransferHelper for IERC20;
using YieldMathExtensions for IPool;
using CastU256U128 for uint256; // Inherited from ERC20Rewards
using CastU256I128 for uint256;
using CastU128I128 for uint128;
using Cast for uint256; // Inherited from ERC20Rewards

event YieldSet(ILadle ladle, ICauldron cauldron);
event TokenJoinReset(address join);
Expand Down
14 changes: 7 additions & 7 deletions contracts/wands/CollateralWandBase.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.13;

import '@yield-protocol/vault-v2/contracts/interfaces/ICauldronGov.sol';
import '@yield-protocol/vault-v2/contracts/interfaces/IOracle.sol';
import '@yield-protocol/vault-v2/contracts/interfaces/ILadleGov.sol';
import '@yield-protocol/vault-v2/contracts/interfaces/IJoin.sol';
import '@yield-protocol/utils-v2/contracts/access/AccessControl.sol';
import '@yield-protocol/utils-v2/contracts/token/IERC20Metadata.sol';
import {IEmergencyBrake} from '@yield-protocol/utils-v2/contracts/utils/EmergencyBrake.sol';
import '@yield-protocol/vault-v2/src/interfaces/ICauldronGov.sol';
import '@yield-protocol/vault-v2/src/interfaces/IOracle.sol';
import '@yield-protocol/vault-v2/src/interfaces/ILadleGov.sol';
import '@yield-protocol/vault-v2/src/interfaces/IJoin.sol';
import '@yield-protocol/utils-v2/src/access/AccessControl.sol';
import '@yield-protocol/utils-v2/src/token/IERC20Metadata.sol';
import {IEmergencyBrake} from '@yield-protocol/utils-v2/src/utils/EmergencyBrake.sol';

interface IWitchCustom {
//// @dev Function to set the auction limit on the witch
Expand Down
4 changes: 2 additions & 2 deletions contracts/wands/FCashWand.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.13;
import './CollateralWandBase.sol';
import '@yield-protocol/vault-v2/contracts/interfaces/DataTypes.sol';
import '@yield-protocol/vault-v2/contracts/other/notional/NotionalJoin.sol';
import '@yield-protocol/vault-v2/src/interfaces/DataTypes.sol';
import '@yield-protocol/vault-v2/src/other/notional/NotionalJoin.sol';

interface INotionalMultiOracle{
function setSource(
Expand Down
12 changes: 6 additions & 6 deletions contracts/wands/SeriesWand.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.13;
import '@yield-protocol/vault-v2/contracts/interfaces/ICauldronGov.sol';
import '@yield-protocol/vault-v2/contracts/interfaces/ILadleGov.sol';
import '@yield-protocol/vault-v2/contracts/interfaces/IJoin.sol';
import '@yield-protocol/vault-v2/contracts/interfaces/IFYToken.sol';
import '@yield-protocol/utils-v2/contracts/access/AccessControl.sol';
import {IEmergencyBrake} from '@yield-protocol/utils-v2/contracts/utils/EmergencyBrake.sol';
import '@yield-protocol/vault-v2/src/interfaces/ICauldronGov.sol';
import '@yield-protocol/vault-v2/src/interfaces/ILadleGov.sol';
import '@yield-protocol/vault-v2/src/interfaces/IJoin.sol';
import '@yield-protocol/vault-v2/src/interfaces/IFYToken.sol';
import '@yield-protocol/utils-v2/src/access/AccessControl.sol';
import {IEmergencyBrake} from '@yield-protocol/utils-v2/src/utils/EmergencyBrake.sol';

/// @dev A wand to create new series.
/// @author @iamsahu
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"@typechain/ethers-v5": "^10.0.0",
"@typechain/hardhat": "^6.0.0",
"@types/mocha": "^8.0.0",
"@yield-protocol/strategy-v2": "2.0.0",
"@yield-protocol/utils-v2": "2.6.9-rc.1",
"@yield-protocol/vault-v2": "0.18.10-rc.1",
"@yield-protocol/yieldspace-tv": "0.1.9-rc.3",
"@yield-protocol/strategy-v2": "^2.0.3",
"@yield-protocol/utils-v2": "^2.6.16",
"@yield-protocol/vault-v2": "../vault-v2/yield-protocol-vault-v2-0.18.13.tgz",
"@yield-protocol/yieldspace-tv": "^0.1.11",
"chai": "4.2.0",
"dss-interfaces": "0.1.1",
"erc3156": "^0.4.8",
Expand Down
23 changes: 23 additions & 0 deletions scripts/fragments/assetsAndSeries/addVRIlk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Add an existing ilk to a series

import { VRCauldron } from '../../../typechain'
import { Ilk, Series } from '../../governance/confTypes'
import { getName, indent } from '../../../shared/helpers'

export const addVRIlk = async (
cauldron: VRCauldron,
ilk: Ilk,
nesting: number = 0
): Promise<Array<{ target: string; data: string }>> => {
console.log()
console.log(indent(nesting, `ADD_ILK_TO_SERIES`))
const proposal: Array<{ target: string; data: string }> = []

proposal.push({
target: cauldron.address,
data: cauldron.interface.encodeFunctionData('addIlks', [ilk.baseId, [ilk.ilkId]]),
})
console.log(indent(nesting, `addIlks ${getName(ilk.baseId)}: ${getName(ilk.ilkId)}`))

return proposal
}
Loading