Skip to content

Latest commit

 

History

History
129 lines (115 loc) · 4.7 KB

YPP-0056.md

File metadata and controls

129 lines (115 loc) · 4.7 KB

Proposal

Deploy & configure contracts needed by Contango. (Fix Step 3)

Background

Contango exchange uses fixed rate markets to synthesise expirable futures. In order to allow for a smoother interaction, Yield will deploy a set of contracts specially tailored for Contango. This proposal fixes an issue with YPP-0055 in which the ContangoWitch was deployed pointing to an invalid address instead of Contango

Details

Here are the steps:

  1. Deploy a new ContangoWitch (no need for governance approval)
  2. Governance proposal
    1. Revoke slurp and give permissions on the invalid ContangoWitch
    2. Configure ContangoWitch
      1. Grant permissions to ContangoWitch
      2. Configure assets and limits on ContangoWitch

Script that performed said actions: https://github.com/yieldprotocol/environments-v2/blob/09fdbae4e6a9c875fcb2b4e929672f2dbc5d15d2/scripts/governance/contango/arbitrum/replaceContangoWitch.sh

Configuration applied:

export interface AuctionLineAndLimit {
  baseId: string
  ilkId: string
  duration: number
  vaultProportion: BigNumber
  collateralProportion: BigNumber
  max: BigNumber
}
export const auctionLineAndLimits: AuctionLineAndLimit[] = [
  // ETH
  {
    baseId: ETH,
    ilkId: FYUSDC2209,
    duration: 600,
    vaultProportion: parseUnits('0.5'),
    collateralProportion: parseUnits('0.75'), // 105 / 140
    max: parseUnits('500'),
  },
  {
    baseId: ETH,
    ilkId: FYDAI2209,
    duration: 600,
    vaultProportion: parseUnits('0.5'),
    collateralProportion: parseUnits('0.75'), // 105 / 140
    max: parseUnits('1000000'),
  },
  // USDC
  {
    baseId: USDC,
    ilkId: FYETH2209,
    duration: 600,
    vaultProportion: parseUnits('0.5'),
    collateralProportion: parseUnits('0.75'), // 105 / 140
    max: parseUnits('500'),
  },
  {
    baseId: USDC,
    ilkId: FYDAI2209,
    duration: 600,
    vaultProportion: parseUnits('1'),
    collateralProportion: parseUnits('0.9545454545'), // 105 / 110
    max: parseUnits('1000000'),
  },
  // DAI
  {
    baseId: DAI,
    ilkId: FYETH2209,
    duration: 600,
    vaultProportion: parseUnits('0.5'),
    collateralProportion: parseUnits('0.75'), // 105 / 140
    max: parseUnits('500'),
  },
  {
    baseId: DAI,
    ilkId: FYUSDC2209,
    duration: 600,
    vaultProportion: parseUnits('1'),
    collateralProportion: parseUnits('0.9545454545'), // 105 / 110
    max: parseUnits('1000000'),
  },
]

The contracts have been deployed to Arbitrum mainnet and the proposal sent to the multisig.

Testing

The proposal approval & execution were tested on tenderly: https://dashboard.tenderly.co/Yield/v2-arbitrum/fork/66e972fb-b726-46a9-9d2d-281a28e5967d

Proposal log

➜  environments-v2 git:(deploy-contango-cauldron) ✗ sh scripts/governance/contango/arbitrum/replaceContangoWitch.sh
++ dirname scripts/governance/contango/arbitrum/replaceContangoWitch.sh
+ HERE=scripts/governance/contango/arbitrum
+ export CONF=/Users/egillhreinsson/dev/environments-v2/scripts/governance/contango/arbitrum/contango.arb_mainnet.config
+ CONF=/Users/egillhreinsson/dev/environments-v2/scripts/governance/contango/arbitrum/contango.arb_mainnet.config
+ RUN='npx hardhat run --network arb_mainnet'
+ npx hardhat run --network arb_mainnet scripts/governance/contango/arbitrum/replaceContangoWitch.ts
cauldron.revokeRoles(witch)
cauldron.revokeRole(witch)
witch.grantRoles(timelock)
cauldron.grantRoles(witch)
cloak.plan(witch): 0xb8bedd88d796f974237e6277bce3c5e984ea749d4e024778fa3eb5ac93c72998
cloak.plan(witch, join(01)): 0x06212fd5b8f1e403a7247603b113348ad0d90eb9d3f6e203573936ca1ab6368d
cloak.plan(witch, join(02)): 0x4470b57dc8c3ad7d48b46853765fbf8f34d62b27189f880bd0ba32c5b17a8810
cloak.plan(witch, join(00)): 0xb649e34699ed9abf3f659595271febf554d748723cbefb9da7e5d6703eb90132
cloak.plan(witch, burn(0107)): 0x9910ca0536c0567827b9ab6d5224a58d51a0599f8111736228c2a0903a3844ca
cloak.plan(witch, burn(0207)): 0x66d6e3d618dbbb7421d7cdb3ecad38b27ec7f83411522c3a4bd2dfd71cbf6b28
cloak.plan(witch, burn(0007)): 0x889a593df3d94b6b69d6deb685629a3a2bd3ef81298ece7628d73d975ecc4979
Adding baseId: 00 - ilkId: 0207 to the Witch
Adding baseId: 00 - ilkId: 0107 to the Witch
Adding baseId: 02 - ilkId: 0007 to the Witch
Adding baseId: 02 - ilkId: 0107 to the Witch
Adding baseId: 01 - ilkId: 0007 to the Witch
Adding baseId: 01 - ilkId: 0207 to the Witch
cloak.plan(witch, exit(0207)): 0x91d5d44dcdb493c13e1bbb39178a318da5ee2c52ff49484b2be6a9700de3ec22
cloak.plan(witch, exit(0107)): 0x2498d5a818d69b562e183d835750e2833b861bf81da1a7e080b5b0e6092a8e15
cloak.plan(witch, exit(0007)): 0x3d65eaa647a663dcfdf5264dd6b5d3690d9cc2dc30424d648a24f1c201e6f199
Proposal: 0x1f10bb223ea3dd31ad77a85ea6515f37f459961f5d08eb71e85f3d6c837ccd51
Proposing
Developer: 0x02f73B54ccfBA5c91bf432087D60e4b3a781E497