RoC Stable Platform - Collateral RIF Token
  • Introduction
  • RIF On Chain platform
    • Main concepts
    • System states
    • Public actions
      • User actions
      • Process actions
    • Contracts architecture
      • MoC
      • CommissionSplitter
      • MoCState
      • MoCBucketContainer
      • MoCSettlement
      • MoCHelperLib
      • MoCLibConnection
      • MoCConverter
      • MoCExchange
      • MoCConnector
      • MoCRiskProxManager
      • MoCInrate
      • MoCVendors
      • MoCWhitelist
      • MoCBase
      • OwnerBurnableToken
      • RiskProToken
      • StableToken
      • MoCToken
      • PriceProvider
    • Contract mocks
    • Relevant patterns and choices
    • Data dictionary
    • Getting started
  • Integration with RoC platform
    • Introduction to RoC
      • The MoC Contract
      • RoC Precisions
      • RoC State Contracts
    • Getting RIFPros
      • Minting RIFPros
      • Redeeming RIFPros
    • Getting USDRIF
      • Minting USDRIF
      • Redeeming USDRIF
        • On Settlement: redeemStableTokenRequest
        • On Settlement: alterRedeemRequestAmount
        • Outside Settlement: redeemFreeStableToken
        • On Liquidation State: redeemAllStableToken
        • How-to
    • Commission fees values
    • Vendors
    • Fees calculation
    • From outside the blockchain
      • Using RSK nodes
      • Using web3
      • Official RIF On Chain ABIs
      • Events
      • Example code minting RIFPros
      • Example code minting RIFPros without Truffle
      • Example code redeeming RIFPros
      • Example code redeeming RIFPros without Truffle
      • Example code minting USDRIF
      • Example code redeeming free USDRIF
      • Example code redeeming USDRIF Request
      • Example code redeeming all USDRIF
  • Smart contracts
    • Contracts verification
    • ABIs documentation
      • Blockable
      • Blocker
      • ERC20Mintable
      • Governed
      • Initializable
      • MakeStoppable
      • MakeUnstoppable
      • MoC
      • MoCBucketContainer
      • MoCConnector
      • MoCConverter
      • MoCEMACalculator
      • MoCExchange
      • MoCHelperLib
      • MoCHelperLibMock
      • MoCInrate
      • MoCInrateRiskproxChanger
      • MoCLibConnection
      • MoCPriceProviderMock
      • MoCReserve
      • MoCRiskProxManager
      • MoCSettlement
      • MoCSettlementMock
      • MoCState
      • MoCStateMock
      • MoCToken
      • MoCVendors
      • MoCWhitelist
      • MocInrateStableChanger
      • MockBlocker
      • MockMakeStoppable
      • MockMakeUnstoppable
      • MockStopper
      • MockUpgradeDelegator
      • MockUpgraderTemplate
      • OwnerBurnableToken
      • Pausable
      • PriceFeed
      • PriceFeederAdder
      • PriceFeederRemover
      • PriceProvider
      • PriceProviderChanger
      • PriceProviderMock
      • ReserveToken
      • RiskProToken
      • StableToken
      • Stoppable
      • Stopper
      • UpgradeDelegator
      • UpgraderTemplate
Powered by GitBook
On this page
  • Structs
  • InitializeParams
  • Contract Members
  • StateTransition
  • PriceProviderUpdated
  • MoCPriceProviderUpdated
  • MoCTokenChanged
  • MoCVendorsChanged
  • Functions
  • initialize
  • setMaxDiscountRate
  • getMaxDiscountRate
  • setDayBlockSpan
  • setPriceProvider
  • getPriceProvider
  • getDayBlockSpan
  • substractFromReserves
  • addToReserves
  • riskProTotalSupply
  • stableTokenTotalSupply
  • cobj
  • collateralReserves
  • globalCoverage
  • lockedReserveTokens
  • getResTokensInRiskPro
  • getReservesRemainder
  • coverage
  • abundanceRatio
  • currentAbundanceRatio
  • leverage
  • globalMaxStableToken
  • freeStableToken
  • maxStableToken
  • globalMaxRiskPro
  • absoluteMaxStableToken
  • maxRiskPro
  • maxRiskProx
  • maxRiskProxResTokenValue
  • absoluteMaxRiskPro
  • maxRiskProWithDiscount
  • globalLockedReserveTokens
  • riskProTecPrice
  • bucketRiskProTecPrice
  • bucketRiskProTecPriceHelper
  • riskProDiscountPrice
  • riskProUsdPrice
  • maxRiskProxRiskProValue
  • riskProxRiskProPrice
  • riskProSpotDiscountRate
  • daysToSettlement
  • blocksToSettlement
  • isLiquidationReached
  • getLiquidationPrice
  • getBucketNReserve
  • getBucketNRiskPro
  • getBucketNStableToken
  • getBucketCobj
  • getInrateBag
  • getBcons
  • getReserveTokenPrice
  • calculateReserveTokenMovingAverage
  • getLiq
  • setLiq
  • getUtpdu
  • setUtpdu
  • getPeg
  • setPeg
  • getProtected
  • setProtected
  • getLiquidationEnabled
  • setLiquidationEnabled
  • nextState
  • setMaxMintRiskPro
  • getMaxMintRiskPro
  • setMoCPriceProvider
  • getMoCPriceProvider
  • getMoCPrice
  • setMoCToken
  • getMoCToken
  • setMoCVendors
  • getMoCVendors
  • stableTokensToResToken
  • resTokenToStableToken
  • riskProxToResToken
  • riskProxToResTokenHelper
  • resTokenToRiskProx
  • setMoCTokenInternal
  • setMoCVendorsInternal
  • setLiquidationPrice
  • initializeValues
  • initializeContracts
  1. Smart contracts
  2. ABIs documentation

MoCState

PreviousMoCSettlementMockNextMoCStateMock

Last updated 2 years ago

View Source:

↗ Extends: , , , ↘ Derived Contracts:

MoCState - version: 0.1.10

Structs

InitializeParams

struct InitializeParams {
 address connectorAddress,
 address governor,
 address priceProvider,
 uint256 liq,
 uint256 utpdu,
 uint256 maxDiscRate,
 uint256 dayBlockSpan,
 uint256 ema,
 uint256 smoothFactor,
 uint256 emaBlockSpan,
 uint256 maxMintRiskPro,
 address mocPriceProvider,
 address mocTokenAddress,
 address mocVendorsAddress,
 bool liquidationEnabled,
 uint256 protected
}

Contract Members

Constants & Variables

enum IMoCState.States public state;

uint256 public dayBlockSpan;

uint256 public peg;

uint256 public riskProMaxDiscountRate;

uint256 public liq;

uint256 public utpdu;

uint256 public reserves;

uint256 public liquidationPrice;

uint256 public maxMintRiskPro;

bool public liquidationEnabled;

uint256 public protected;

contract PriceProvider internal priceProvider;

contract IMoCSettlement internal mocSettlement;

address internal DEPRECATED_mocConverter;

contract IERC20 internal stableToken;

contract RiskProToken internal riskProToken;

contract MoCRiskProxManager internal riskProxManager;

contract PriceProvider internal mocPriceProvider;

contract MoCToken internal mocToken;

address internal mocVendors;

uint256[50] private upgradeGap;

StateTransition

Parameters

Name
Type
Description

newState

enum IMoCState.States

PriceProviderUpdated

Parameters

Name
Type
Description

oldAddress

address

newAddress

address

MoCPriceProviderUpdated

Parameters

Name
Type
Description

oldAddress

address

newAddress

address

MoCTokenChanged

Parameters

Name
Type
Description

mocTokenAddress

address

MoCVendorsChanged

Parameters

Name
Type
Description

mocVendorsAddress

address

Functions

initialize

Initializes the contract

function initialize(struct MoCState.InitializeParams params) public nonpayable initializer 

Arguments

Name
Type
Description

params

struct MoCState.InitializeParams

Params defined in InitializeParams struct

setMaxDiscountRate

Sets the max discount rate.

function setMaxDiscountRate(uint256 rate) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

rate

uint256

Discount rate at liquidation level [using mocPrecision]

getMaxDiscountRate

return the value of the RiskPro max discount rate configuration param

function getMaxDiscountRate() public view
returns(uint256)

Returns

riskProMaxDiscountRate RiskPro max discount rate

Arguments

setDayBlockSpan

Defines how many blocks there are in a day

function setDayBlockSpan(uint256 blockSpan) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

blockSpan

uint256

blocks there are in a day

setPriceProvider

Sets a new PriceProvider contract

function setPriceProvider(address priceProviderAddress) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

priceProviderAddress

address

address of the price provider contract

getPriceProvider

Gets the PriceProviderAddress

function getPriceProvider() public view
returns(address)

Returns

address of the price provider contract

Arguments

getDayBlockSpan

Gets how many blocks there are in a day

function getDayBlockSpan() public view
returns(uint256)

Returns

blocks there are in a day

Arguments

substractFromReserves

⤾ overrides IMoCState.substractFromReserves

Subtract the reserve amount passed by parameter to the reserves total

function substractFromReserves(uint256 amount) public nonpayable onlyWhitelisted 

Arguments

Name
Type
Description

amount

uint256

Amount that will be subtract to reserves

addToReserves

⤾ overrides IMoCState.addToReserves

Add the reserve amount passed by parameter to the reserves total

function addToReserves(uint256 amount) public nonpayable onlyWhitelisted 

Arguments

Name
Type
Description

amount

uint256

Amount that will be added to reserves

riskProTotalSupply

All RiskPros in circulation

function riskProTotalSupply() public view
returns(uint256)

Arguments

stableTokenTotalSupply

All stableTokens in circulation

function stableTokenTotalSupply() public view
returns(uint256)

Arguments

cobj

Target coverage for complete system

function cobj() public view
returns(uint256)

Arguments

collateralReserves

Amount of ReserveTokens in the system excluding RiskProx values and interests holdings

function collateralReserves() public view
returns(uint256)

Arguments

globalCoverage

⤾ overrides IMoCState.globalCoverage

GLOBAL Coverage

function globalCoverage() public view
returns(uint256)

Returns

coverage [using mocPrecision].

Arguments

lockedReserveTokens

BUCKET lockedReserveTokens

function lockedReserveTokens(bytes32 bucket) public view
returns(uint256)

Returns

lockedReserveTokens amount [using reservePrecision].

Arguments

Name
Type
Description

bucket

bytes32

Name of the bucket used

getResTokensInRiskPro

Gets ReserveTokens in RiskPro within specified bucket

function getResTokensInRiskPro(bytes32 bucket) public view
returns(uint256)

Returns

ReserveToken amount of RiskPro in Bucket [using reservePrecision].

Arguments

Name
Type
Description

bucket

bytes32

Name of the bucket used

getReservesRemainder

⤾ overrides IMoCState.getReservesRemainder

Gets the ReserveTokens in the contract that not corresponds to StableToken collateral

function getReservesRemainder() public view
returns(uint256)

Returns

ReserveTokens remainder [using reservePrecision].

Arguments

coverage

⤾ overrides IMoCState.coverage

BUCKET Coverage

function coverage(bytes32 bucket) public view
returns(uint256)

Returns

coverage [using mocPrecision]

Arguments

Name
Type
Description

bucket

bytes32

Name of the bucket used

abundanceRatio

⤾ overrides IMoCState.abundanceRatio

Abundance ratio, receives tha amount of stableToken to use the value of stableToken0 and StableToken total supply

function abundanceRatio(uint256 stableToken0) public view
returns(uint256)

Returns

abundance ratio [using mocPrecision]

Arguments

Name
Type
Description

stableToken0

uint256

currentAbundanceRatio

⤾ overrides IMoCState.currentAbundanceRatio

Relation between stableTokens in bucket 0 and StableToken total supply

function currentAbundanceRatio() public view
returns(uint256)

Returns

abundance ratio [using mocPrecision]

Arguments

leverage

⤾ overrides IMoCState.leverage

BUCKET Leverage

function leverage(bytes32 bucket) public view
returns(uint256)

Returns

leverage [using mocPrecision]

Arguments

Name
Type
Description

bucket

bytes32

Name of the bucket used

globalMaxStableToken

GLOBAL maxStableToken

function globalMaxStableToken() public view
returns(uint256)

Returns

maxStableToken to issue [using mocPrecision]

Arguments

freeStableToken

⤾ overrides IMoCState.freeStableToken

Returns the amount of stableTokens in bucket 0, that can be redeemed outside of settlement

function freeStableToken() public view
returns(uint256)

Returns

amount of stableTokens in bucket 0, that can be redeemed outside of settlement [using mocPrecision]

Arguments

maxStableToken

BUCKET maxStableToken

function maxStableToken(bytes32 bucket) public view
returns(uint256)

Returns

maxStableToken to issue [using mocPrecision]

Arguments

Name
Type
Description

bucket

bytes32

globalMaxRiskPro

GLOBAL maxRiskPro

function globalMaxRiskPro() public view
returns(uint256)

Returns

maxRiskPro for redeem [using mocPrecision].

Arguments

absoluteMaxStableToken

⤾ overrides IMoCState.absoluteMaxStableToken

ABSOLUTE maxStableToken

function absoluteMaxStableToken() public view
returns(uint256)

Returns

maxStableToken to issue [using mocPrecision]

Arguments

maxRiskPro

BUCKET maxRiskPro to redeem / mint

function maxRiskPro(bytes32 bucket) public view
returns(uint256)

Returns

maxRiskPro for redeem [using mocPrecision].

Arguments

Name
Type
Description

bucket

bytes32

Name of the bucket used

maxRiskProx

GLOBAL max riskProx to mint

function maxRiskProx(bytes32 bucket) public view
returns(uint256)

Returns

maxRiskProx [using mocPrecision]

Arguments

Name
Type
Description

bucket

bytes32

Name of the bucket used

maxRiskProxResTokenValue

⤾ overrides IMoCState.maxRiskProxResTokenValue

GLOBAL max riskProx to mint

function maxRiskProxResTokenValue(bytes32 bucket) public view
returns(uint256)

Returns

maxRiskProx ReserveTokens value to mint [using reservePrecision]

Arguments

Name
Type
Description

bucket

bytes32

Name of the bucket used

absoluteMaxRiskPro

⤾ overrides IMoCState.absoluteMaxRiskPro

ABSOLUTE maxRiskPro

function absoluteMaxRiskPro() public view
returns(uint256)

Returns

maxStableToken to issue [using mocPrecision].

Arguments

maxRiskProWithDiscount

⤾ overrides IMoCState.maxRiskProWithDiscount

DISCOUNT maxRiskPro

function maxRiskProWithDiscount() public view
returns(uint256)

Returns

maxRiskPro for mint with discount [using mocPrecision]

Arguments

globalLockedReserveTokens

GLOBAL lockedReserveTokens

function globalLockedReserveTokens() public view
returns(uint256)

Returns

lockedReserveTokens amount [using reservePrecision].

Arguments

riskProTecPrice

⤾ overrides IMoCState.riskProTecPrice

ReserveTokens price of RiskPro

function riskProTecPrice() public view
returns(uint256)

Returns

the RiskPro Tec Price [using reservePrecision].

Arguments

bucketRiskProTecPrice

⤾ overrides IMoCState.bucketRiskProTecPrice

BUCKET ReserveTokens price of RiskPro

function bucketRiskProTecPrice(bytes32 bucket) public view
returns(uint256)

Returns

the RiskPro Tec Price [using reservePrecision]

Arguments

Name
Type
Description

bucket

bytes32

Name of the bucket used

bucketRiskProTecPriceHelper

⤾ overrides IMoCState.bucketRiskProTecPriceHelper

BUCKET ReserveTokens price of RiskPro (helper)

function bucketRiskProTecPriceHelper(bytes32 bucket) public view
returns(uint256)

Returns

the RiskPro Tec Price [using reservePrecision]

Arguments

Name
Type
Description

bucket

bytes32

Name of the bucket used

riskProDiscountPrice

⤾ overrides IMoCState.riskProDiscountPrice

ReserveTokens price of RiskPro with spot discount applied

function riskProDiscountPrice() public view
returns(uint256)

Returns

the RiskPro Tec Price [using reservePrecision].

Arguments

riskProUsdPrice

RiskPro USD PRICE

function riskProUsdPrice() public view
returns(uint256)

Returns

the RiskPro USD Price [using mocPrecision]

Arguments

maxRiskProxRiskProValue

GLOBAL max riskProx to mint

function maxRiskProxRiskProValue(bytes32 bucket) public view
returns(uint256)

Returns

max RiskPro allowed to be spent to mint RiskProx [using reservePrecision]

Arguments

Name
Type
Description

bucket

bytes32

Name of the bucket used

riskProxRiskProPrice

BUCKET RiskProx price in RiskPro

function riskProxRiskProPrice(bytes32 bucket) public view
returns(uint256)

Returns

RiskPro RiskPro Price [[using mocPrecision]Precision].

Arguments

Name
Type
Description

bucket

bytes32

Name of the bucket used

riskProSpotDiscountRate

⤾ overrides IMoCState.riskProSpotDiscountRate

GLOBAL ReserveTokens Discount rate to apply to RiskProPrice.

function riskProSpotDiscountRate() public view
returns(uint256)

Returns

RiskPro discount rate [using DISCOUNT_PRECISION].

Arguments

daysToSettlement

⤾ overrides IMoCState.daysToSettlement

Calculates the number of days to next settlement based dayBlockSpan

function daysToSettlement() public view
returns(uint256)

Returns

days to next settlement

Arguments

blocksToSettlement

Number of blocks to settlement

function blocksToSettlement() public view
returns(uint256)

Returns

Number of blocks to settlement

Arguments

isLiquidationReached

Verifies if forced liquidation is reached checking if globalCoverage <= liquidation (currently 1.04) and if liquidation is enabled

function isLiquidationReached() public view
returns(bool)

Returns

true if liquidation state is reached, false otherwise

Arguments

getLiquidationPrice

⤾ overrides IMoCState.getLiquidationPrice

Returns the price to use for stableToken redeem in a liquidation event

function getLiquidationPrice() public view
returns(uint256)

Returns

price to use for stableToken redeem in a liquidation event

Arguments

getBucketNReserve

⤾ overrides IMoCState.getBucketNReserve

function getBucketNReserve(bytes32 bucket) public view
returns(uint256)

Arguments

Name
Type
Description

bucket

bytes32

getBucketNRiskPro

function getBucketNRiskPro(bytes32 bucket) public view
returns(uint256)

Arguments

Name
Type
Description

bucket

bytes32

getBucketNStableToken

function getBucketNStableToken(bytes32 bucket) public view
returns(uint256)

Arguments

Name
Type
Description

bucket

bytes32

getBucketCobj

function getBucketCobj(bytes32 bucket) public view
returns(uint256)

Arguments

Name
Type
Description

bucket

bytes32

getInrateBag

function getInrateBag(bytes32 bucket) public view
returns(uint256)

Arguments

Name
Type
Description

bucket

bytes32

getBcons

function getBcons() public view
returns(uint256)

Arguments

getReserveTokenPrice

⤾ overrides IMoCState.getReserveTokenPrice

function getReserveTokenPrice() public view
returns(uint256)

Arguments

calculateReserveTokenMovingAverage

function calculateReserveTokenMovingAverage() public nonpayable

Arguments

getLiq

return the value of the liq threshold configuration param

function getLiq() public view
returns(uint256)

Returns

liq threshold, currently 1.04

Arguments

setLiq

sets the value of the liq threshold configuration param

function setLiq(uint256 _liq) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

_liq

uint256

liquidation threshold

getUtpdu

return the value of the utpdu threshold configuration param

function getUtpdu() public view
returns(uint256)

Returns

utpdu Universal TPro discount sales coverage threshold

Arguments

setUtpdu

sets the value of the utpdu threshold configuration param

function setUtpdu(uint256 _utpdu) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

_utpdu

uint256

Universal TPro discount sales coverage threshold

getPeg

returns the relation between StableToken and dollar. By default it is 1.

function getPeg() public view
returns(uint256)

Returns

peg relation between StableToken and dollar

Arguments

setPeg

sets the relation between StableToken and dollar. By default it is 1.

function setPeg(uint256 _peg) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

_peg

uint256

relation between StableToken and dollar

getProtected

⤾ overrides IMoCState.getProtected

return the value of the protected threshold configuration param

function getProtected() public view
returns(uint256)

Returns

protected threshold, currently 1.5

Arguments

setProtected

sets the value of the protected threshold configuration param

function setProtected(uint256 _protected) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

_protected

uint256

protected threshold

getLiquidationEnabled

returns if is liquidation enabled.

function getLiquidationEnabled() public view
returns(bool)

Returns

liquidationEnabled is liquidation enabled

Arguments

setLiquidationEnabled

returns if is liquidation enabled.

function setLiquidationEnabled(bool _liquidationEnabled) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

_liquidationEnabled

bool

is liquidation enabled

nextState

⤾ overrides IMoCState.nextState

Transitions to next state.

function nextState() public nonpayable

Arguments

setMaxMintRiskPro

Sets max mint RiskPro value

function setMaxMintRiskPro(uint256 _maxMintRiskPro) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

_maxMintRiskPro

uint256

[using mocPrecision]

getMaxMintRiskPro

return Max value posible to mint of RiskPro

function getMaxMintRiskPro() public view
returns(uint256)

Returns

maxMintRiskPro

Arguments

setMoCPriceProvider

Sets a new MoCProvider contract

function setMoCPriceProvider(address mocProviderAddress) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

mocProviderAddress

address

MoC price provider address

getMoCPriceProvider

Gets the MoCPriceProviderAddress

function getMoCPriceProvider() public view
returns(address)

Returns

MoC price provider address

Arguments

getMoCPrice

⤾ overrides IMoCState.getMoCPrice

Gets the MoCPrice

function getMoCPrice() public view
returns(uint256)

Returns

MoC price

Arguments

setMoCToken

Sets the MoC token contract address

function setMoCToken(address mocTokenAddress) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

mocTokenAddress

address

MoC token contract address

getMoCToken

⤾ overrides IMoCState.getMoCToken

Gets the MoC token contract address

function getMoCToken() public view
returns(address)

Returns

MoC token contract address

Arguments

setMoCVendors

Sets the MoCVendors contract address

function setMoCVendors(address mocVendorsAddress) public nonpayable onlyAuthorizedChanger 

Arguments

Name
Type
Description

mocVendorsAddress

address

MoCVendors contract address

getMoCVendors

⤾ overrides IMoCState.getMoCVendors

Gets the MoCVendors contract addfress

function getMoCVendors() public view
returns(address)

Returns

MoCVendors contract address

Arguments

stableTokensToResToken

⤾ overrides IMoCState.stableTokensToResToken

function stableTokensToResToken(uint256 stableTokenAmount) public view
returns(uint256)

Arguments

Name
Type
Description

stableTokenAmount

uint256

resTokenToStableToken

⤾ overrides IMoCState.resTokenToStableToken

function resTokenToStableToken(uint256 resTokensAmount) public view
returns(uint256)

Arguments

Name
Type
Description

resTokensAmount

uint256

riskProxToResToken

⤾ overrides IMoCState.riskProxToResToken

function riskProxToResToken(uint256 riskProxAmount, bytes32 bucket) public view
returns(uint256)

Arguments

Name
Type
Description

riskProxAmount

uint256

bucket

bytes32

riskProxToResTokenHelper

function riskProxToResTokenHelper(uint256 riskProxAmount, bytes32 bucket) public view
returns(uint256)

Arguments

Name
Type
Description

riskProxAmount

uint256

bucket

bytes32

resTokenToRiskProx

⤾ overrides IMoCState.resTokenToRiskProx

function resTokenToRiskProx(uint256 resTokensAmount, bytes32 bucket) public view
returns(uint256)

Arguments

Name
Type
Description

resTokensAmount

uint256

bucket

bytes32

setMoCTokenInternal

Sets the MoC token contract address (internal function)

function setMoCTokenInternal(address mocTokenAddress) internal nonpayable

Arguments

Name
Type
Description

mocTokenAddress

address

MoC token contract address

setMoCVendorsInternal

Sets the MoCVendors contract address (internal function)

function setMoCVendorsInternal(address mocVendorsAddress) internal nonpayable

Arguments

Name
Type
Description

mocVendorsAddress

address

MoCVendors contract address

setLiquidationPrice

Calculates price at liquidation event as the relation between the stableToken total supply and the amount of ReserveTokens available to distribute

function setLiquidationPrice() internal nonpayable

Arguments

initializeValues

function initializeValues(address _governor, address _priceProvider, uint256 _liq, uint256 _utpdu, uint256 _maxDiscRate, uint256 _dayBlockSpan, uint256 _maxMintRiskPro, address _mocPriceProvider, bool _liquidationEnabled, uint256 _protected) internal nonpayable

Arguments

Name
Type
Description

_governor

address

_priceProvider

address

_liq

uint256

_utpdu

uint256

_maxDiscRate

uint256

_dayBlockSpan

uint256

_maxMintRiskPro

uint256

_mocPriceProvider

address

_liquidationEnabled

bool

_protected

uint256

initializeContracts

function initializeContracts(address _mocTokenAddress, address _mocVendorsAddress) internal nonpayable

Arguments

Name
Type
Description

_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.

contracts/MoCState.sol
MoCLibConnection
MoCBase
MoCEMACalculator
IMoCState
MoCStateMock
Proposal to remove leveraged positions
Proposal to remove leveraged positions
Proposal to remove leveraged positions
Proposal to remove leveraged positions
Proposal to remove leveraged positions
Proposal to remove leveraged positions
Proposal to remove leveraged positions
initialize(struct MoCState.InitializeParams params)
setMaxDiscountRate(uint256 rate)
getMaxDiscountRate()
setDayBlockSpan(uint256 blockSpan)
setPriceProvider(address priceProviderAddress)
getPriceProvider()
getDayBlockSpan()
substractFromReserves(uint256 amount)
addToReserves(uint256 amount)
riskProTotalSupply()
stableTokenTotalSupply()
cobj()
collateralReserves()
globalCoverage()
lockedReserveTokens(bytes32 bucket)
getResTokensInRiskPro(bytes32 bucket)
getReservesRemainder()
coverage(bytes32 bucket)
abundanceRatio(uint256 stableToken0)
currentAbundanceRatio()
leverage(bytes32 bucket)
globalMaxStableToken()
freeStableToken()
maxStableToken(bytes32 bucket)
globalMaxRiskPro()
absoluteMaxStableToken()
maxRiskPro(bytes32 bucket)
maxRiskProx(bytes32 bucket)
maxRiskProxResTokenValue(bytes32 bucket)
absoluteMaxRiskPro()
maxRiskProWithDiscount()
globalLockedReserveTokens()
riskProTecPrice()
bucketRiskProTecPrice(bytes32 bucket)
bucketRiskProTecPriceHelper(bytes32 bucket)
riskProDiscountPrice()
riskProUsdPrice()
maxRiskProxRiskProValue(bytes32 bucket)
riskProxRiskProPrice(bytes32 bucket)
riskProSpotDiscountRate()
daysToSettlement()
blocksToSettlement()
isLiquidationReached()
getLiquidationPrice()
getBucketNReserve(bytes32 bucket)
getBucketNRiskPro(bytes32 bucket)
getBucketNStableToken(bytes32 bucket)
getBucketCobj(bytes32 bucket)
getInrateBag(bytes32 bucket)
getBcons()
getReserveTokenPrice()
calculateReserveTokenMovingAverage()
getLiq()
setLiq(uint256 _liq)
getUtpdu()
setUtpdu(uint256 _utpdu)
getPeg()
setPeg(uint256 _peg)
getProtected()
setProtected(uint256 _protected)
getLiquidationEnabled()
setLiquidationEnabled(bool _liquidationEnabled)
nextState()
setMaxMintRiskPro(uint256 _maxMintRiskPro)
getMaxMintRiskPro()
setMoCPriceProvider(address mocProviderAddress)
getMoCPriceProvider()
getMoCPrice()
setMoCToken(address mocTokenAddress)
getMoCToken()
setMoCVendors(address mocVendorsAddress)
getMoCVendors()
stableTokensToResToken(uint256 stableTokenAmount)
resTokenToStableToken(uint256 resTokensAmount)
riskProxToResToken(uint256 riskProxAmount, bytes32 bucket)
riskProxToResTokenHelper(uint256 riskProxAmount, bytes32 bucket)
resTokenToRiskProx(uint256 resTokensAmount, bytes32 bucket)
setMoCTokenInternal(address mocTokenAddress)
setMoCVendorsInternal(address mocVendorsAddress)
setLiquidationPrice()
initializeValues(address _governor, address _priceProvider, uint256 _liq, uint256 _utpdu, uint256 _maxDiscRate, uint256 _dayBlockSpan, uint256 _maxMintRiskPro, address _mocPriceProvider, bool _liquidationEnabled, uint256 _protected)
initializeContracts(address _mocTokenAddress, address _mocVendorsAddress)
MoCStateMock.initialize
MoCStateMock.daysToSettlement