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

ZenBull as collateral #312

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 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
145 changes: 33 additions & 112 deletions addresses/mainnet/assets.json
Original file line number Diff line number Diff line change
@@ -1,113 +1,34 @@
{
"dataType": "Map",
"value": [
[
"0x303000000000",
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
],
[
"0x303100000000",
"0x6B175474E89094C44Da98b954EedeAC495271d0F"
],
[
"0x303200000000",
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
],
[
"0x303300000000",
"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
],
[
"0x303400000000",
"0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"
],
[
"0x303500000000",
"0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84"
],
[
"0x303600000000",
"0x514910771AF9Ca656af840dff83E8264EcF986CA"
],
[
"0x303700000000",
"0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72"
],
[
"0x303800000000",
"0xdA816459F1AB5631232FE5e97a05BBBb94970c95"
],
[
"0x303900000000",
"0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE"
],
[
"0x313000000000",
"0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"
],
[
"0x313200000000",
"0x1344A36A1B56144C3Bc62E7757377D288fDE0369"
],
[
"0x313300000000",
"0x1344A36A1B56144C3Bc62E7757377D288fDE0369"
],
[
"0x313400000000",
"0x1344A36A1B56144C3Bc62E7757377D288fDE0369"
],
[
"0x313500000000",
"0x1344A36A1B56144C3Bc62E7757377D288fDE0369"
],
[
"0x313600000000",
"0x1344A36A1B56144C3Bc62E7757377D288fDE0369"
],
[
"0x313700000000",
"0x1344A36A1B56144C3Bc62E7757377D288fDE0369"
],
[
"0x313800000000",
"0x853d955aCEf822Db058eb8505911ED77F175b99e"
],
[
"0x313900000000",
""
],
[
"0x323000000000",
"0x1b808F49ADD4b8C6b5117d9681cF7312Fcf0dC1D"
],
[
"0x323100000000",
"0xe025E3ca2bE02316033184551D4d3Aa22024D9DC"
],
[
"0x323200000000",
"0xEb91861f8A4e1C12333F42DCE8fB0Ecdc28dA716"
],
[
"0x323300000000",
"0x853d955acef822db058eb8505911ed77f175b99e"
],
[
"0x333800000000",
"0x3B960E47784150F5a63777201ee2B15253D713e8"
],
[
"0x333900000000",
"0xf1B99e3E573A1a9C5E6B2Ce818b617F0E664E86B"
],
[
"0x30A000000000",
"0xdAC17F958D2ee523a2206206994597C13D831ec7"
],
[
"0xE0A014000000",
"0x4d19F33948b99800B6113Ff3e83beC9b537C85d2"
]
]
}
"dataType": "Map",
"value": [
["0x303000000000", "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"],
["0x303100000000", "0x6B175474E89094C44Da98b954EedeAC495271d0F"],
["0x303200000000", "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"],
["0x303300000000", "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"],
["0x303400000000", "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0"],
["0x303500000000", "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84"],
["0x303600000000", "0x514910771AF9Ca656af840dff83E8264EcF986CA"],
["0x303700000000", "0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72"],
["0x303800000000", "0xdA816459F1AB5631232FE5e97a05BBBb94970c95"],
["0x303900000000", "0xa354F35829Ae975e850e23e9615b11Da1B3dC4DE"],
["0x313000000000", "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"],
["0x313200000000", "0x1344A36A1B56144C3Bc62E7757377D288fDE0369"],
["0x313300000000", "0x1344A36A1B56144C3Bc62E7757377D288fDE0369"],
["0x313400000000", "0x1344A36A1B56144C3Bc62E7757377D288fDE0369"],
["0x313500000000", "0x1344A36A1B56144C3Bc62E7757377D288fDE0369"],
["0x313600000000", "0x1344A36A1B56144C3Bc62E7757377D288fDE0369"],
["0x313700000000", "0x1344A36A1B56144C3Bc62E7757377D288fDE0369"],
["0x313800000000", "0x853d955aCEf822Db058eb8505911ED77F175b99e"],
["0x313900000000", ""],
["0x323000000000", "0x1b808F49ADD4b8C6b5117d9681cF7312Fcf0dC1D"],
["0x323100000000", "0xe025E3ca2bE02316033184551D4d3Aa22024D9DC"],
["0x323200000000", "0xEb91861f8A4e1C12333F42DCE8fB0Ecdc28dA716"],
["0x323300000000", "0x853d955acef822db058eb8505911ed77f175b99e"],
["0x333800000000", "0x3B960E47784150F5a63777201ee2B15253D713e8"],
["0x333900000000", "0xf1B99e3E573A1a9C5E6B2Ce818b617F0E664E86B"],
["0x30A000000000", "0xdAC17F958D2ee523a2206206994597C13D831ec7"],
["0xE0A014000000", "0x4d19F33948b99800B6113Ff3e83beC9b537C85d2"],
["0xE03016000000", "0xae78736Cd615f374D3085123A210448E74Fc6393"],
["0xE03017000000", "0xb46Fb07b0c80DBC3F97cae3BFe168AcaD46dF507"]
]
}
3 changes: 2 additions & 1 deletion contracts/Importer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ 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/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/notional/NotionalJoin.sol";
import "@yield-protocol/vault-v2/contracts/other/notional/NotionalMultiOracle.sol";
import "@yield-protocol/vault-v2/contracts/other/notional/Transfer1155Module.sol";
Expand Down
4 changes: 2 additions & 2 deletions scripts/fragments/assetsAndSeries/makeIlk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ export const makeIlk = async (
joins: Map<string, string> // assetId, joinAddress
): Promise<Array<{ target: string; data: string }>> => {
let proposal: Array<{ target: string; data: string }> = []

const join = Join__factory.connect(joins.get(ilk.ilkId)!, ownerAcc)

proposal = proposal.concat(await updateCollateralization(cauldron, ilk))
proposal = proposal.concat(await updateDebtLimits(cauldron, ilk))

// Some ilks are not liquidable
if (ilk.auctionLineAndLimit !== undefined) {
proposal = proposal.concat(await addIlkToWitch(cloak, witch, ilk, join))
let propo = await addIlkToWitch(cloak, witch, ilk, join)
proposal = proposal.concat(propo[0])
}

return proposal
Expand Down
7 changes: 6 additions & 1 deletion scripts/fragments/witch/addIlkToWitch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ export const addIlkToWitch = async (
// If line and limit are set are already set, they will be updated
proposal = proposal.concat(await setLineAndLimit(witch, ilk.auctionLineAndLimit!))

if (!(await join.hasRole(id(join.interface, 'exit(address,uint128)'), witch.address))) {
if (
!(await join.hasRole(id(join.interface, 'exit(address,uint128)'), witch.address)) &&
witch['ilksAdded'].find((i) => i === ilk.ilkId) === undefined
) {
// Allow Witch to exit ilk
proposal.push({
target: join.address,
Expand All @@ -46,8 +49,10 @@ export const addIlkToWitch = async (
})
// TODO: Maybe check the ilk.ilkId matches
console.log(`cloak.add(witch exit ${getName(ilk.ilkId)})`)
witch['ilksAdded'].push(ilk.ilkId)
} else {
console.log(`Witch already has an exit role on join(${getName(ilk.ilkId)})`)
witch['ilksAdded'].push(ilk.ilkId)
}

return proposal
Expand Down
Loading