MoC
Referenced by: MoCSettlement
References/uses: SafeMath, MoCLibConnection, DocToken, BProToken, PriceProvider, MoCBProxManager, MoCState, MoCConverter, MoCSettlement, MoCExchange, base/MoCBase
Inherits from: MoCEvents, MoCLibConnection, MoCBase, Stoppable
MoC is the main contract of the MoC ecosystem, it's the entry point of almost every public interaction with it and it articulates the main logic and relations between the rest of the contracts. It is also the only one that receives RBTC and holds the actual value of the system. The only methods marked as
payable
belongs to this contract and corresponds with the actual two ways of adding "value" to the system minting BitPro and DoC: -function mintBProVendors() public payable transitionState() { ... }
-function mintDocVendors() public payable transitionState() atLeastState(MoCState.States.AboveCobj) { ... }
You'll also notice that many of it's methods just "redirects" to a more specif contract, abstracting it from themsg.sender
andmsg.value
; for example:
MoC also handles the System states by a series of modifiers:
atState: requires certain state to allow execution
atLeastState: as states have a progressive order, we can require certain state or higher (where higher indicates a healthier system state)
notInProtectionMode: system can enter in protection mode when coverage is below protected threshold, thus preventing the execution of operations which make use of this modifier
bucketStateTransition: Any method that can potentially modify a bucket values is require to first verify if current conditions doesn't demand that bucket liquidation.
transitionState: As liquidation (as a way to maintain the USD PEG) is a fundamental commitment of the system, we want to ensure that no operation could ever be done without triggering it if the conditions are met. This is why every method that may change the system inner state, is annotated with this modifier.
Last updated