-
Core (ICore, Permissions, Initializable)
- [Ext] init #
- modifiers: initializer
- Why upgradable? Could make
volt
immutable if not upgradable.
- [Ext] setVcon #
- modifiers: onlyGovernor
- [Ext] init #
-
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 like0.079999999999
.
- Consider using
- [Int] _validatePriceRange
- [Pub] #
-
L2Core (ICore, Permissions)
- [Pub] #
- Compare
Core.init
withL2Core.constructor
and find out whyvolt
isimmutable
in this case.
- Compare
- [Ext] setVcon #
- modifiers: onlyGovernor
- [Pub] #
-
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 ofperiodStartTime
to save gas; useful when emitting the event.
- Can cache value of
-
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.
- Have to understand the
- [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.
- [Pub] #
-
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.
- Unpauses
- [Int] _withdrawERC20ToSafeAddress #
- Handles ANY erc20 token. Is this safe? Doesn't do any accounting, so it's safe.
- [Int] _addWhitelistAddress #
- [Int] _removeWhitelistAddress #
- [Pub] #
- PausableLib is a bit awkward. Why not use an interface?
-
PCVGuardAdmin (IPCVGuardAdmin, CoreRef)
- [Pub] #
- modifiers: CoreRef
- [Ext] grantPCVGuardRole #
- modifiers: onlyGovernor
- [Ext] revokePCVGuardRole #
- modifiers: onlyGuardianOrGovernor
- [Pub] #
-
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
inreadOracle
. - Will lose precision on scaling down.
- Consider
-
[Int] _setOracle #
-
[Int] _setBackupOracle #
-
[Int] _setDoInvert #
- Confuses me since seems to work in tandem with
decimalsNormalizer
- Confuses me since seems to work in tandem with
-
[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.
- Is this really connected to
- [Pub] #
-
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()
?
- Is
- [Int] _checkSkimCondition
- Is
.balance()
always in sync with.balanceOf()
?
- Is
- [Pub] #
- Update
Whitepaper
document with https://github.com/volt-protocol/whitepaper/blob/mgov/README.md
($) = payable function