MoCState
Last updated
Last updated
View Source:
↗ Extends: , , , ↘ Derived Contracts:
MoCState - version: 0.1.12
Constants & Variables
Parameters
newState
enum IMoCState.States
Parameters
oldAddress
address
newAddress
address
Parameters
oldAddress
address
newAddress
address
Parameters
mocTokenAddress
address
Parameters
mocVendorsAddress
address
Initializes the contract
Arguments
params
struct MoCState.InitializeParams
Params defined in InitializeParams struct
Sets the max discount rate.
Arguments
rate
uint256
Discount rate at liquidation level [using mocPrecision]
Returns the value of the BPro max discount rate configuration param
Returns
bproMaxDiscountRate BPro max discount rate
Arguments
Defines how many blocks there are in a day
Arguments
blockSpan
uint256
blocks there are in a day
Sets a new BTCProvider contract
Arguments
btcProviderAddress
address
address of the BTC price provider contract
Gets the BTCPriceProviderAddress
Returns
address of the BTC price provider contract
Arguments
Gets how many blocks there are in a day
Returns
blocks there are in a day
Arguments
⤾ overrides IMoCState.subtractRbtcFromSystem
Subtract the btc amount passed by parameter to the total Bitcoin Amount
Arguments
btcAmount
uint256
Amount that will be subtract to rbtcInSystem
⤾ overrides IMoCState.addToRbtcInSystem
btcAmount Add the btc amount passed by parameter to the total Bitcoin Amount
Arguments
btcAmount
uint256
Amount that will be added to rbtcInSystem
All BPros in circulation
Arguments
All docs in circulation
Arguments
Target coverage for complete system
Arguments
Amount of Bitcoins in the system excluding BTCx values and interests holdings
Arguments
⤾ overrides IMoCState.globalCoverage
GLOBAL Coverage
Returns
coverage [using mocPrecision]
Arguments
BUCKET lockedBitcoin
Returns
lockedBitcoin amount [using reservePrecision]
Arguments
bucket
bytes32
Name of the bucket used
Gets RBTC in BitPro within specified bucket
Returns
Bitcoin amount of BitPro in Bucket [using reservePrecision]
Arguments
bucket
bytes32
Name of the bucket used
⤾ overrides IMoCState.getRbtcRemainder
Gets the RBTC in the contract that not corresponds to Doc collateral
Returns
RBTC remainder [using reservePrecision]
Arguments
⤾ overrides IMoCState.coverage
BUCKET Coverage
Returns
coverage [using coveragePrecision]
Arguments
bucket
bytes32
Name of the bucket used
⤾ overrides IMoCState.abundanceRatio
Abundance ratio, receives tha amount of doc to use the value of doc0 and Doc total supply
Returns
abundance ratio [using mocPrecision]
Arguments
doc0
uint256
⤾ overrides IMoCState.currentAbundanceRatio
Relation between docs in bucket 0 and Doc total supply
Returns
abundance ratio [using mocPrecision]
Arguments
⤾ overrides IMoCState.leverage
BUCKET Leverage
Returns
coverage [using mocPrecision]
Arguments
bucket
bytes32
Name of the bucket used
GLOBAL maxDoc
Returns
abundance ratio [using mocPrecision]
Arguments
⤾ overrides IMoCState.freeDoc
Returns the amount of DoCs in bucket 0, that can be redeemed outside of settlement
Returns
amount of docs in bucket 0, that can be redeemed outside of settlement [using mocPrecision]
Arguments
BUCKET maxDoc
Returns
abundance ratio [using mocPrecision]
Arguments
bucket
bytes32
GLOBAL maxBPro
Returns
maxBPro for redeem [using reservePrecision]
Arguments
⤾ overrides IMoCState.absoluteMaxDoc
ABSOLUTE maxDoc
Returns
maxDoc to issue [using mocPrecision]
Arguments
BUCKET maxBPro to redeem / mint
Returns
maxBPro for redeem [using mocPrecision]
Arguments
bucket
bytes32
Name of the bucket used
GLOBAL max bprox to mint
Returns
maxBProx [using reservePrecision]
Arguments
bucket
bytes32
Name of the bucket used
⤾ overrides IMoCState.maxBProxBtcValue
GLOBAL max bprox to mint
Returns
maxBProx BTC value to mint [using reservePrecision]
Arguments
bucket
bytes32
Name of the bucket used
⤾ overrides IMoCState.absoluteMaxBPro
ABSOLUTE maxBPro
Returns
maxDoc to issue [using mocPrecision]
Arguments
⤾ overrides IMoCState.maxBProWithDiscount
DISCOUNT maxBPro
Returns
maxBPro for mint with discount [using mocPrecision]
Arguments
GLOBAL lockedBitcoin
Returns
lockedBitcoin amount [using reservePrecision]
Arguments
⤾ overrides IMoCState.bproTecPrice
BTC price of BPro
Returns
the BPro Tec Price [using reservePrecision]
Arguments
⤾ overrides IMoCState.bucketBProTecPrice
BUCKET BTC price of BPro
Returns
the BPro Tec Price [using reservePrecision]
Arguments
bucket
bytes32
Name of the bucket used
⤾ overrides IMoCState.bucketBProTecPriceHelper
BUCKET BTC price of BPro (helper)
Returns
the BPro Tec Price [using reservePrecision]
Arguments
bucket
bytes32
Name of the bucket used
⤾ overrides IMoCState.bproDiscountPrice
BTC price of BPro with spot discount applied
Returns
the BPro Tec Price [using reservePrecision]
Arguments
BPro USD PRICE
Returns
the BPro USD Price [using mocPrecision]
Arguments
GLOBAL max bprox to mint
Returns
max BPro allowed to be spent to mint BProx [using reservePrecision]
Arguments
bucket
bytes32
Name of the bucket used
BUCKET BProx price in BPro
Returns
BProx BPro Price [using mocPrecision]
Arguments
bucket
bytes32
Name of the bucket used
⤾ overrides IMoCState.bproSpotDiscountRate
GLOBAL BTC Discount rate to apply to BProPrice.
Returns
BPro discount rate [using DISCOUNT_PRECISION].
Arguments
⤾ overrides IMoCState.daysToSettlement
Calculates the number of days to next settlement based dayBlockSpan
Returns
days to next settlement
Arguments
Calculates the number of blocks to settlement
Returns
Number of blocks to settlement
Arguments
Verifies if forced liquidation is reached checking if globalCoverage <= liquidation (currently 1.04) and if liquidation is enabled
Returns
true if liquidation state is reached, false otherwise
Arguments
⤾ overrides IMoCState.getLiquidationPrice
Gets the price to use for doc redeem in a liquidation event
Returns
price to use for doc redeem in a liquidation event
Arguments
⤾ overrides IMoCState.getBucketNBTC
Arguments
bucket
bytes32
Arguments
bucket
bytes32
Arguments
bucket
bytes32
Arguments
bucket
bytes32
Arguments
bucket
bytes32
Arguments
⤾ overrides IMoCState.getBitcoinPrice
Arguments
Arguments
return the value of the liq threshold configuration param
Returns
liq threshold, currently 1.04
Arguments
sets the value of the liq threshold configuration param
Arguments
_liq
uint256
liquidation threshold
return the value of the utpdu threshold configuration param
Returns
utpdu Universal TPro discount sales coverage threshold
Arguments
sets the value of the utpdu threshold configuration param
Arguments
_utpdu
uint256
Universal TPro discount sales coverage threshold
returns the relation between DOC and dollar. By default it is 1.
Returns
peg relation between DOC and dollar
Arguments
sets the relation between DOC and dollar. By default it is 1.
Arguments
_peg
uint256
relation between DOC and dollar
⤾ overrides IMoCState.getProtected
return the value of the protected threshold configuration param
Returns
protected threshold, currently 1.5
Arguments
sets the value of the protected threshold configuration param
Arguments
_protected
uint256
protected threshold
returns if is liquidation enabled.
Returns
liquidationEnabled is liquidation enabled
Arguments
returns if is liquidation enabled.
Arguments
_liquidationEnabled
bool
is liquidation enabled
⤾ overrides IMoCState.nextState
Transitions to next state.
Arguments
Sets max mint BPro value
Arguments
_maxMintBPro
uint256
[using mocPrecision]
return Max value posible to mint of BPro
Returns
maxMintBPro
Arguments
Sets a new MoCProvider contract
Arguments
mocProviderAddress
address
MoC price provider address
Gets the MoCPriceProviderAddress
Returns
MoC price provider address
Arguments
⤾ overrides IMoCState.getMoCPrice
Gets the MoCPrice
Returns
MoC price
Arguments
BTC equivalent for the amount of bpros given
Returns
total BTC Price of the amount BPros [using reservePrecision]
Arguments
amount
uint256
Amount of BPro to calculate the total price
⤾ overrides IMoCState.docsToBtc
Arguments
docAmount
uint256
⤾ overrides IMoCState.btcToDoc
Arguments
btcAmount
uint256
⤾ overrides IMoCState.bproxToBtc
Arguments
bproxAmount
uint256
bucket
bytes32
Arguments
bproxAmount
uint256
bucket
bytes32
⤾ overrides IMoCState.btcToBProx
Arguments
btcAmount
uint256
bucket
bytes32
Sets the MoC token contract address
Arguments
mocTokenAddress
address
MoC token contract address
⤾ overrides IMoCState.getMoCToken
Gets the MoC token contract address
Returns
MoC token contract address
Arguments
Sets the MoCVendors contract address
Arguments
mocVendorsAddress
address
MoCVendors contract address
⤾ overrides IMoCState.getMoCVendors
Gets the MoCVendors contract addfress
Returns
MoCVendors contract address
Arguments
Sets the MoC token contract address (internal function)
Arguments
mocTokenAddress
address
MoC token contract address
Sets the MoCVendors contract address (internal function)
Arguments
mocVendorsAddress
address
MoCVendors contract address
Calculates price at liquidation event as the relation between the doc total supply and the amount of RBTC available to distribute
Arguments
Arguments
_governor
address
_btcPriceProvider
address
_liq
uint256
_utpdu
uint256
_maxDiscRate
uint256
_dayBlockSpan
uint256
_maxMintBPro
uint256
_mocPriceProvider
address
_liquidationEnabled
bool
_protected
uint256
Arguments
_mocTokenAddress
address
_mocVendorsAddress
address
⤿ Overridden Implementation(s):
âš This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
âš This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
âš This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
âš This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
⤿ Overridden Implementation(s):
âš This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
âš This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
âš This has been deprecated since the from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.