Comment on page
MoC
MoC - version: 0.1.12
Constants & Variables
address internal docToken;
address internal bproToken;
contract MoCBProxManager internal bproxManager;
contract IMoCState internal mocState;
address internal DEPRECATED_mocConverter;
contract IMoCSettlement internal settlement;
contract IMoCExchange internal mocExchange;
contract IMoCInrate internal mocInrate;
bool internal liquidationExecuted;
address public DEPRECATED_mocBurnout;
uint256[50] private upgradeGap;
Parameters
Name | Type | Description |
---|---|---|
bucket | bytes32 | |
Parameters
Name | Type | Description |
---|---|---|
mocAddress | address | |
modifier whenSettlementReady() internal
Arguments
modifier atState(enum IMoCState.States _state) internal
Arguments
Name | Type | Description |
---|---|---|
_state | enum IMoCState.States | |
modifier atLeastState(enum IMoCState.States _state) internal
Arguments
Name | Type | Description |
---|---|---|
_state | enum IMoCState.States | |
modifier atMostState(enum IMoCState.States _state) internal
Arguments
Name | Type | Description |
---|---|---|
_state | enum IMoCState.States | |
modifier notInProtectionMode() internal
Arguments
modifier bucketStateTransition(bytes32 bucket) internal
Arguments
Name | Type | Description |
---|---|---|
bucket | bytes32 | |
modifier availableBucket(bytes32 bucket) internal
Arguments
Name | Type | Description |
---|---|---|
bucket | bytes32 | |
modifier notBaseBucket(bytes32 bucket) internal
Arguments
Name | Type | Description |
---|---|---|
bucket | bytes32 | |
modifier transitionState() internal
Arguments
⤾ overrides IMoC.
Fallback function
function () external payable whenNotPaused transitionState
Arguments
Initializes the contract
function initialize(address connectorAddress, address governorAddress, address stopperAddress, bool startStoppable) public nonpayable initializer
Arguments
Name | Type | Description |
---|---|---|
connectorAddress | address | MoCConnector contract address |
governorAddress | address | Governor contract address |
stopperAddress | address | Stopper contract address |
startStoppable | bool | Indicates if the contract starts being unstoppable or not |
⚠ This has been deprecated since the Proposal to remove leveraged positions from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
Gets the BProx balance of an address
function bproxBalanceOf(bytes32 bucket, address account) public view
returns(uint256)
Returns
BProx balance of the address
Arguments
Name | Type | Description |
---|---|---|
bucket | bytes32 | Name of the bucket |
account | address | Address |
Gets the RedeemRequest at the queue index position
function getRedeemRequestAt(uint256 index) public view
returns(address, uint256)
Returns
redeemer's address and amount he submitted
Arguments
Name | Type | Description |
---|---|---|
index | uint256 | queue position to get |
Returns current redeem queue size
function redeemQueueSize() public view
returns(uint256)
Returns
redeem queue size
Arguments
Returns the total amount of Docs in the redeem queue for redeemer
function docAmountToRedeem(address redeemer) public view
returns(uint256)
Returns
total amount of Docs in the redeem queue for redeemer
Arguments
Name | Type | Description |
---|---|---|
redeemer | address | address for which ^ is computed |
Creates or updates the amount of a Doc redeem Request from the msg.sender
function redeemDocRequest(uint256 docAmount) public nonpayable whenNotPaused whenSettlementReady
Arguments
Name | Type | Description |
---|---|---|
docAmount | uint256 | Amount of Docs to redeem on settlement [using mocPrecision] |
Alters the redeem amount position for the redeemer
function alterRedeemRequestAmount(bool isAddition, uint256 delta) public nonpayable whenNotPaused whenSettlementReady
Arguments
Name | Type | Description |
---|---|---|
isAddition | bool | true if adding amount to redeem, false to substract. |
delta | uint256 | the amount to add/substract to current position |
Mints BPRO and pays the comissions of the operation (retrocompatible function).
function mintBPro(uint256 btcToMint) public payable
Arguments
Name | Type | Description |
---|---|---|
btcToMint | uint256 | Amount in BTC to mint |
Mints BPRO and pays the comissions of the operation.
function mintBProVendors(uint256 btcToMint, address payable vendorAccount) public payable whenNotPaused transitionState notInProtectionMode
Arguments
Name | Type | Description |
---|---|---|
btcToMint | uint256 | Amount in BTC to mint |
vendorAccount | address payable | Vendor address |
Redeems Bpro Tokens and pays the comissions of the operation (retrocompatible function).
function redeemBPro(uint256 bproAmount) public nonpayable
Arguments
Name | Type | Description |
---|---|---|
bproAmount | uint256 | Amount in Bpro |
Redeems Bpro Tokens and pays the comissions of the operation
function redeemBProVendors(uint256 bproAmount, address payable vendorAccount) public nonpayable whenNotPaused transitionState atLeastState
Arguments
Name | Type | Description |
---|---|---|
bproAmount | uint256 | Amount in Bpro |
vendorAccount | address payable | Vendor address |
Mint Doc tokens and pays the commisions of the operation (retrocompatible function).
function mintDoc(uint256 btcToMint) public payable
Arguments
Name | Type | Description |
---|---|---|
btcToMint | uint256 | Amount in RBTC to mint |
Mint Doc tokens and pays the commisions of the operation
function mintDocVendors(uint256 btcToMint, address payable vendorAccount) public payable whenNotPaused transitionState atLeastState
Arguments
Name | Type | Description |
---|---|---|
btcToMint | uint256 | Amount in RBTC to mint |
vendorAccount | address payable | Vendor address |
⚠ This has been deprecated since the Proposal to remove leveraged positions from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
Redeems Bprox Tokens and pays the comissions of the operation in RBTC (retrocompatible function).
function redeemBProx(bytes32 bucket, uint256 bproxAmount) public nonpayable
Arguments
Name | Type | Description |
---|---|---|
bucket | bytes32 | Bucket to reedem, for example X2 |
bproxAmount | uint256 | Amount in Bprox |
⚠ This has been deprecated since the Proposal to remove leveraged positions from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
Redeems Bprox Tokens and pays the comissions of the operation in RBTC
function redeemBProxVendors(bytes32 bucket, uint256 bproxAmount, address payable vendorAccount) public nonpayable whenNotPaused whenSettlementReady availableBucket notBaseBucket transitionState bucketStateTransition
Arguments
Name | Type | Description |
---|---|---|
bucket | bytes32 | Bucket to reedem, for example X2 |
bproxAmount | uint256 | Amount in Bprox |
vendorAccount | address payable | Vendor address |
⚠ This has been deprecated since the Proposal to remove leveraged positions from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
BUCKET bprox minting (retrocompatible function).
function mintBProx(bytes32 bucket, uint256 btcToMint) public payable
Arguments
Name | Type | Description |
---|---|---|
bucket | bytes32 | Name of the bucket used |
btcToMint | uint256 | amount to mint on RBTC |
⚠ This has been deprecated since the Proposal to remove leveraged positions from the protocol was approved, however it is necessary to maintain the contracts and their documentation for legacy support.
BUCKET bprox minting
function mintBProxVendors(bytes32 bucket, uint256 btcToMint, address payable vendorAccount) public payable whenNotPaused whenSettlementReady availableBucket notBaseBucket transitionState bucketStateTransition
Arguments
Name | Type | Description |
---|---|---|
bucket | bytes32 | Name of the bucket used |
btcToMint | uint256 | amount to mint on RBTC |
vendorAccount | address payable | Vendor address |
Redeems the requested amount for the msg.sender, or the max amount of free docs possible (retrocompatible function).
function redeemFreeDoc(uint256 docAmount) public nonpayable
Arguments
Name | Type | Description |
---|---|---|
docAmount | uint256 | Amount of Docs to redeem. |
Redeems the requested amount for the msg.sender, or the max amount of free docs possible.
function redeemFreeDocVendors(uint256 docAmount, address payable vendorAccount) public nonpayable whenNotPaused transitionState notInProtectionMode
Arguments
Name | Type | Description |
---|---|---|
docAmount | uint256 | Amount of Docs to redeem. |
vendorAccount | address payable | Vendor address |
Allow redeem on liquidation state, user DoCs get burned and he receives the equivalent BTCs if can be covered, or the maximum available
function redeemAllDoc() public nonpayable atState
Arguments
Moves the daily amount of interest rate to C0 bucket
function dailyInratePayment() public nonpayable whenNotPaused
Arguments
Pays the BitPro interest and transfers it to the address mocInrate.bitProInterestAddress BitPro interests = Nb (bucket 0) * bitProRate.
function payBitProHoldersInterestPayment() public nonpayable whenNotPaused
Arguments
Calculates BitPro holders holder interest by taking the total amount of RBTCs available on Bucket 0. BitPro interests = Nb (bucket 0) * bitProRate.
function calculateBitProHoldersInterest() public view
returns(uint256, uint256)
Arguments
Gets the target address to transfer BitPro Holders rate
function getBitProInterestAddress() public view
returns(address payable)
Returns
Target address to transfer BitPro Holders interest
Arguments
Gets the rate for BitPro Holders
function getBitProRate() public view
returns(uint256)
Returns
BitPro Rate
Arguments
Gets the blockspan of BPRO that represents the frecuency of BitPro holders interest payment
function getBitProInterestBlockSpan() public view
returns(uint256)
Returns
returns power of bitProInterestBlockSpan
Arguments
function isDailyEnabled() public view
returns(bool)
Arguments
function isBitProInterestEnabled() public view
returns(bool)
Arguments
Indicates if settlement is enabled
function isSettlementEnabled() public view
returns(bool)
Returns
Returns true if blockSpan number of blocks has passed since last execution; otherwise false
Arguments
Checks if bucket liquidation is reached.
function isBucketLiquidationReached(bytes32 bucket) public view
returns(bool)
Returns
true if bucket liquidation is reached, false otherwise
Arguments
Name | Type | Description |
---|---|---|
bucket | bytes32 | Name of bucket. |
function evalBucketLiquidation(bytes32 bucket) public nonpayable availableBucket notBaseBucket whenSettlementReady
Arguments
Name | Type | Description |
---|---|---|
bucket | bytes32 | |
Evaluates if liquidation state has been reached and runs liq if that's the case
function evalLiquidation() public nonpayable transitionState
Arguments
Runs all settlement process
function runSettlement(uint256 steps) public nonpayable whenNotPaused transitionState
Arguments
Name | Type | Description |
---|---|---|
steps | uint256 | Number of steps |
⤾ overrides IMoC.sendToAddress
Send RBTC to a user and update RbtcInSystem in MoCState