MoCExchange
View Source: contracts/MoCExchange.sol
↗ Extends: MoCExchangeEvents, MoCBase, MoCLibConnection, IMoCExchange
MoCExchange - version: 0.1.12
Structs
RiskProxRedeemStruct
RiskProxMintStruct
RiskProRedeemStruct
FreeStableTokenRedeemStruct
RiskProMintStruct
StableTokenMintStruct
CommissionParamsStruct
CommissionReturnStruct
StableTokenRedeemStruct
Contract Members
Constants & Variables
RiskProMint
Parameters
RiskProWithDiscountMint
Parameters
RiskProRedeem
Parameters
StableTokenMint
Parameters
StableTokenRedeem
Parameters
FreeStableTokenRedeem
Parameters
RiskProxMint
Parameters
RiskProxRedeem
Parameters
Functions
initialize
Initializes the contract
Arguments
getMoCTokenBalance
⤾ overrides IMoCExchange.getMoCTokenBalance
Converts MoC commission from RBTC to MoC price
Returns
MoC balance of owner and MoC allowance of spender
Arguments
calculateCommissionsWithPrices
Calculates commissions in MoC and BTC
Returns
Commissions calculated in MoC price and bitcoin price; and Bitcoin and MoC prices
Arguments
bproDiscToBtc
BTC equivalent for the amount of bpro given applying the spotDiscountRate
Returns
BTC amount
Arguments
mintBPro
⤾ overrides IMoCExchange.mintBPro
Mint BPros and give it to the msg.sender
Arguments
redeemBPro
⤾ overrides IMoCExchange.redeemBPro
Sender burns his BProS and redeems the equivalent BTCs
Returns
bitcoins to transfer to the redeemer and commission spent (in BTC and MoC), using [using reservePrecision]
Arguments
redeemFreeDoc
⤾ overrides IMoCExchange.redeemFreeDoc
Redeems the requested amount for the account, or the max amount of free docs possible.
Returns
bitcoins to transfer to the redeemer and commission spent (in BTC and MoC), using [using reservePrecision]
Arguments
mintDoc
⤾ overrides IMoCExchange.mintDoc
Mint Max amount of Docs and give it to the msg.sender
Returns
the actual amount of btc used and the btc commission (in BTC and MoC) for them [using rbtPresicion]
Arguments
redeemDocWithPrice
⤾ overrides IMoCExchange.redeemDocWithPrice
User DoCs get burned and he receives the equivalent BTCs in return
Returns
true and commission spent (in BTC and MoC) if btc send was completed, false if fails.
Arguments
redeemAllDoc
⤾ overrides IMoCExchange.redeemAllDoc
Allow redeem on liquidation state, user DoCs get burned and he receives the equivalent RBTCs according to liquidationPrice
Returns
The amount of RBTC in sent for the redemption or 0 if send does not succed
Arguments
mintBProx
⚠ 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.
⚠ See the approved technical proposal to understand how the behavior of this function has changed.
⤾ overrides IMoCExchange.mintBProx
BUCKET Bprox minting. Mints Bprox for the specified bucket
Returns
total RBTC Spent (btcToMint more interest) and commission spent (in BTC and MoC) [using reservePrecision]
Arguments
redeemBProx
⚠ 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.
⤾ overrides IMoCExchange.redeemBProx
Sender burns his BProx, redeems the equivalent amount of BPros, return the "borrowed" DOCs and recover pending interests
Returns
the actual amount of btc to redeem and the btc commission (in BTC and MoC) for them [using reservePrecision]
Arguments
forceRedeemBProx
⚠ 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.
⤾ overrides IMoCExchange.forceRedeemBProx
Burns user BProx and sends the equivalent amount of RBTC to the account without caring if transaction succeeds
Returns
result of the RBTC sending transaction [using reservePrecision]
Arguments
burnBProxFor
⚠ 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.
Burns user BProx
Returns
Bitcoin total value of the redemption [using reservePrecision]
Arguments
redeemBProxInternal
⚠ 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.
Internal function to avoid stack too deep errors
Arguments
mintBProInternal
Internal function to avoid stack too deep errors
Arguments
mintBProxInternal
⚠ 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.
⚠ See the approved technical proposal to understand how the behavior of this function has changed.
Internal function to avoid stack too deep errors
Arguments
mintDocInternal
Internal function to avoid stack too deep errors
Arguments
redeemFreeDocInternal
Internal function to avoid stack too deep errors
Arguments
redeemBProInternal
Internal function to avoid stack too deep errors
Arguments
redeemDocWithPriceInternal
Internal function to avoid stack too deep errors
Arguments
moveExtraFundsToBucket
Calculates the amount of RBTC that one bucket should move to another in BProx minting/redemption. This extra makes BProx more leveraging than BPro.
Arguments
recoverInterests
Returns RBTCs for user in concept of interests refund
Returns
Interests [using reservePrecision]
Arguments
doDocRedeem
Arguments
initializeContracts
Arguments
Last updated