Skip to content

Latest commit

 

History

History
54 lines (45 loc) · 2.16 KB

LUSDCBTASKS.md

File metadata and controls

54 lines (45 loc) · 2.16 KB

LUSD ChickenBonds

TODO List

Initialization

  • 50:50 split upon the very first chicken-in to initialize the bTKN/TKN pool.
  • Market price = redemption price = 1
  • Forbid chicken-ins during 1 week (tbd)
  • Forbid redemptions during 1 month (tbd)

Base functionality

  • BondNFT

  • sLUSDToken
  • mock Curve pool
  • mock Yearn LUSD and Curve vaults
  • createBond
  • chickenIn

  • chickenOut
  • redeem

  • Change accrual function to asymptotic curve, remove cap constraint
  • refund functionality inside chickenIn
  • Shifting functions
  • Replace refund functionality with permanent bucket
  • Liquity-like redemption fee
  • Extract common functionality in core contracts
  • Extract common setup functionality in unit tests
  • Basic math function for converting to/from 18 digit fractions
  • Implement main events
  • Settle on best Solidity version to use (OZ contracts are v8+, and Slither detects v8+)
  • Add return values to all state-changing functions for integrations
  • Tax on chicken in + incentive for bTKN/TKN pool
  • Adapt shifting function: revert when Curve price crosses boundary

External contracts integrations


  • Determine most accurate way to compute totalAccruedLUSD from Yearn and Curve
  • Determine Curve trade quantity calculation for shifting functions (we simply revert if the price crosses the $1.0 boundary)
  • Implement Yearn Registry check for latest vaults
 and migration functionality
  • Connect to real Yearn and Curve contracts
  • Mainnet hard fork testing



Security

  • Create thorough unit test plan: negative tests, multiple bonds per user, etc.

  • Create list of system properties/invariants and add asserts
  • More extensive testing for edge cases (e.g. pending harvests, harvest losses, external calls to Yearn/Curve reverting, etc)
  • Run Slither / MythX
  • Systemic fuzzing (Dani?)

Design

  • Determine redemption fee formula

  • Determine sLUSD accrual function
 / controller
  • Decide on NFT enumeration (i.e. getting all of a user's bonds), and/or extra trade functionality