Skip to content

Latest commit

 

History

History
206 lines (188 loc) · 7.71 KB

Notes.md

File metadata and controls

206 lines (188 loc) · 7.71 KB
  • Core (ICore, Permissions, Initializable)

    • [Ext] init #
      • modifiers: initializer
      • Why upgradable? Could make volt immutable if not upgradable.
    • [Ext] setVcon #
      • modifiers: onlyGovernor
  • PriceBoundPSM (PegStabilityModule, IPriceBound)

    • [Pub] #
      • modifiers: PegStabilityModule
    • [Ext] setOracleFloorBasisPoints #
      • modifiers: onlyGovernorOrAdmin
    • [Ext] setOracleCeilingBasisPoints #
      • modifiers: onlyGovernorOrAdmin
    • [Ext] isPriceValid
    • [Int] _allocate #
      • Not clear where this method is used. In PegStabilityModule (?).
    • [Int] _setCeilingBasisPoints #
      • The check that ceiling is != 0 is not needed.
    • [Int] _setFloorBasisPoints #
    • [Int] _validPrice
      • Consider using greaterThanOrEqualTo/lessThanOrEqualTo. Will reduce awkward floor/ceiling values like 0.079999999999.
    • [Int] _validatePriceRange
  • L2Core (ICore, Permissions)

    • [Pub] #
      • Compare Core.init with L2Core.constructor and find out why volt is immutable in this case.
    • [Ext] setVcon #
      • modifiers: onlyGovernor
  • VoltSystemOracle (IVoltSystemOracle)

    • [Pub] #

    • [Pub] getCurrentOraclePrice

      • Check this math
    • [Ext] compoundInterest #

      • Can cache value of getCurrentOraclePrice() to save gas; useful when emitting the event.
      • Can use value of periodEndTime instead of periodStartTime to save gas; useful when emitting the event.
    • Why is timeframe 30.42 days? Can this be exploited? 365 / 12 = 30.42

  • OraclePassThrough (IOraclePassThrough, Ownable)

    • [Pub] #
      • modifiers: Ownable
    • [Pub] update #
    • [Ext] read
      • Have to understand the .div(1e18) part.
      • Consider having try/catch. Might block system.
    • [Ext] getCurrentOraclePrice
      • Why does it exist? Historical reasons.
    • [Ext] currPegPrice
      • Why does it exist? Historical reasons.
    • [Ext] updateScalingPriceOracle #
      • modifiers: onlyOwner
      • Should this force an update? Can someone backrun the oracle update without a price change? Not really, value not cached.
  • PCVGuardian (IPCVGuardian, CoreRef)

    • [Pub] #
      • modifiers: CoreRef
    • [Pub] isWhitelistAddress
    • [Pub] getWhitelistAddresses
    • [Ext] addWhitelistAddress #
      • modifiers: onlyGovernor
    • [Ext] addWhitelistAddresses #
      • modifiers: onlyGovernor
    • [Ext] removeWhitelistAddress #
      • modifiers: onlyGuardianOrGovernor
    • [Ext] removeWhitelistAddresses #
      • modifiers: onlyGuardianOrGovernor
    • [Ext] withdrawToSafeAddress #
      • modifiers: hasAnyOfThreeRoles,onlyWhitelist
    • [Ext] withdrawAllToSafeAddress #
      • modifiers: hasAnyOfThreeRoles,onlyWhitelist
      • Make sure .balance() reports a correct value. Are there any burned tokens on tranfser? Any conversion not linear?
    • [Ext] withdrawERC20ToSafeAddress #
      • modifiers: hasAnyOfThreeRoles,onlyWhitelist
    • [Ext] withdrawAllERC20ToSafeAddress #
      • modifiers: hasAnyOfThreeRoles,onlyWhitelist
      • Make sure .balance() reports a correct value. Are there any burned tokens on tranfser? Any conversion not linear?
      • Why is it allowed to withdraw ANY erc20 token?
    • [Int] _withdrawToSafeAddress #
      • Unpauses PCVDeposit if it's paused to allow withdraw.
    • [Int] _withdrawERC20ToSafeAddress #
      • Handles ANY erc20 token. Is this safe? Doesn't do any accounting, so it's safe.
    • [Int] _addWhitelistAddress #
    • [Int] _removeWhitelistAddress #
  • PausableLib is a bit awkward. Why not use an interface?
  • PCVGuardAdmin (IPCVGuardAdmin, CoreRef)

    • [Pub] #
      • modifiers: CoreRef
    • [Ext] grantPCVGuardRole #
      • modifiers: onlyGovernor
    • [Ext] revokePCVGuardRole #
      • modifiers: onlyGuardianOrGovernor
  • CoreRef (ICoreRef, Pausable)

    • [Pub] #

    • [Int] _initialize #

    • [Ext] setContractAdminRole #

      • modifiers: onlyGovernor
    • [Pub] isContractAdmin

    • [Pub] pause #

      • modifiers: onlyGuardianOrGovernor
    • [Pub] unpause #

      • modifiers: onlyGuardianOrGovernor
    • [Pub] core

    • [Pub] volt

    • [Pub] vcon

    • [Pub] voltBalance

    • [Pub] vconBalance

    • [Int] _burnVoltHeld #

      • Not used. Remove?
    • [Int] _mintVolt #

      • Not used. Remove?
    • [Int] _setContractAdminRole #

    • hasAnyOf{number}Roles could be replaced with an array of roles.

  • OracleRef (IOracleRef, CoreRef)

    • [Pub] #

      • modifiers: CoreRef
    • [Ext] setOracle #

      • modifiers: onlyGovernor
    • [Ext] setDoInvert #

      • modifiers: onlyGovernor
      • Add comment saying that decimals normalizer is updated.
    • [Ext] setDecimalsNormalizer #

      • modifiers: onlyGovernor
    • [Ext] setBackupOracle #

      • modifiers: onlyGovernorOrAdmin
      • Should check _oracle != _backupOracle.
    • [Pub] invert

    • [Pub] updateOracle #

    • [Pub] readOracle

      • Consider try/catch in readOracle.
      • Will lose precision on scaling down.
    • [Int] _setOracle #

    • [Int] _setBackupOracle #

    • [Int] _setDoInvert #

      • Confuses me since seems to work in tandem with decimalsNormalizer
    • [Int] _setDecimalsNormalizer #

    • [Int] _setDecimalsNormalizerFromToken #

      • Not used. Remove?
    • Discuss invert, backup oracle.

  • ERC20CompoundPCVDeposit (CompoundPCVDepositBase)

    • [Pub] #
      • modifiers: CompoundPCVDepositBase
    • [Ext] deposit #
      • modifiers: whenNotPaused
      • Don't get why approve and mint. Why not transferFrom or burn? Why is approve needed?
      • Something is weird in here
    • [Int] _transferUnderlying #
      • Not used. Remove?
    • [Pub] balanceReportedIn
      • Is this really connected to CompoundPCVDepositBase.balance()? It looks like it's not strongly connected.
  • ERC20Allocator (IERC20Allocator, CoreRef, RateLimitedV2)

    • [Pub] #
      • modifiers: CoreRef,RateLimitedV2
    • [Ext] connectPSM #
      • modifiers: onlyGovernor
    • [Ext] editPSMTargetBalance #
      • modifiers: onlyGovernor
    • [Ext] disconnectPSM #
      • modifiers: onlyGovernor
    • [Ext] connectDeposit #
      • modifiers: onlyGovernor
    • [Ext] deleteDeposit #
      • modifiers: onlyGovernor
    • [Ext] sweep #
      • modifiers: onlyGovernor
    • [Ext] skim #
      • modifiers: whenNotPaused
    • [Int] _skim #
    • [Ext] drip #
      • modifiers: whenNotPaused
    • [Int] _drip #
    • [Ext] doAction #
      • modifiers: whenNotPaused
    • [Ext] targetBalance
    • [Pub] getAdjustedAmount
    • [Pub] getSkimDetails
      • Check this again
    • [Pub] getDripDetails
    • [Ext] checkDripCondition
    • [Ext] checkSkimCondition
    • [Ext] checkActionAllowed
    • [Int] _checkDripCondition
      • Is .balance() always in sync with .balanceOf()?
    • [Int] _checkSkimCondition
      • Is .balance() always in sync with .balanceOf()?

($) = payable function

= non-constant function