Main Contract
  • Introduction
  • Money 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
      • MoCBProxManager
      • MoCInrate
      • MoCVendors
      • MoCWhitelist
      • MoCBase
      • OwnerBurnableToken
      • BProToken
      • DocToken
      • MoCToken
      • PriceProvider
    • Contract mocks
    • Relevant patterns and choices
    • Data dictionary
    • Getting started
  • Integration with MoC platform
    • Introduction to MoC
      • The MoC Contract
      • MoC Precisions
      • MoC State Contracts
    • Getting BPros
      • Minting BitPros
      • Redeeming BitPros
    • Getting DoCs
      • Minting DoCs
      • Redeeming DoCs
        • On Settlement: redeemDocRequest
        • On Settlement: alterRedeemRequestAmount
        • Outside Settlement: redeemFreeDocVendors
        • On Liquidation State: redeemAllDoc
        • How-to
    • Commission fees values
    • Vendors
    • Fees calculation
    • From outside the blockchain
      • Using RSK nodes
      • Using web3
      • Official Money on Chain ABIs
      • Events
      • Example code minting BPros
      • Example code minting BPros without Truffle
      • Example code redeeming BPros
      • Example code redeeming BPros without Truffle
      • Example code minting DOC
      • Example code redeeming free DOC
      • Example code redeeming DOC Request
      • Example code redeeming all DOC
  • Smart contracts
    • Contracts verification
    • ABIs documentation
      • BProToken
      • BtcPriceProviderMock
      • DocToken
      • ERC20Mintable
      • Governed
      • Initializable
      • MakeStoppable
      • MakeUnstoppable
      • MoC
      • MoCBProxManager
      • MoCBucketContainer
      • MoCConnector
      • MoCConverter
      • MoCEMACalculator
      • MoCExchange
      • MoCHelperLib
      • MoCHelperLibMock
      • MoCInrate
      • MoCLibConnection
      • MoCPriceProviderMock
      • MoCSettlement
      • MoCSettlementMock
      • MoCState
      • MoCStateMock
      • MoCToken
      • MoCVendors
      • MoCWhitelist
      • MockMakeStoppable
      • MockMakeUnstoppable
      • MockStopper
      • MockUpgradeDelegator
      • MockUpgraderTemplate
      • OwnerBurnableToken
      • Pausable
      • PriceFeed
      • PriceFeederAdder
      • PriceFeederRemover
      • PriceProvider
      • RevertingOnSend
      • Stoppable
      • Stopper
      • UpgradeDelegator
      • UpgraderTemplate
Powered by GitBook
On this page
  • Contract Members
  • Functions
  • initialize
  • bproxBalanceOf
  • hasValidBalance
  • assignBProx
  • removeBProx
  • setBProxBalanceOf
  • initializeValues
  1. Smart contracts
  2. ABIs documentation

MoCBProxManager

PreviousMoCNextMoCBucketContainer

Last updated 2 years ago

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

View Source:

↗ Extends:

MoCBProxManager - version: 0.1.12

Contract Members

Constants & Variables

uint256 internal constant MIN_ALLOWED_BALANCE;

uint256[50] private upgradeGap;

Functions

initialize

Initializes the contract

function initialize(address connectorAddress, address _governor, uint256 _c0Cobj, uint256 _x2Cobj) public nonpayable initializer 

Arguments

Name
Type
Description

connectorAddress

address

MoCConnector contract address

_governor

address

Governor contract address

_c0Cobj

uint256

Bucket C0 objective coverage

_x2Cobj

uint256

Bucket X2 objective coverage

bproxBalanceOf

returns user balance

function bproxBalanceOf(bytes32 bucket, address userAddress) public view
returns(uint256)

Returns

total balance for the userAddress

Arguments

Name
Type
Description

bucket

bytes32

BProx corresponding bucket to get balance from

userAddress

address

user address to get balance from

hasValidBalance

verifies that this user has assigned balance for the given bucket

function hasValidBalance(bytes32 bucket, address userAddress, uint256 index) public view
returns(bool)

Returns

true if the user has assigned balance

Arguments

Name
Type
Description

bucket

bytes32

corresponding Leveraged bucket to get balance from

userAddress

address

user address to verify balance for

index

uint256

index, starting from 1, where the address of the user is being kept

assignBProx

Assigns the amount of BProx

function assignBProx(bytes32 bucket, address payable account, uint256 bproxAmount, uint256 totalCost) public nonpayable onlyWhitelisted 

Arguments

Name
Type
Description

bucket

bytes32

bucket from which the BProx will be removed

account

address payable

user address to redeem for

bproxAmount

uint256

bprox amount to redeem [using mocPresicion]

totalCost

uint256

btc value of bproxAmount [using reservePrecision]

removeBProx

Removes the amount of BProx and substract BTC cost from bucket

function removeBProx(bytes32 bucket, address payable userAddress, uint256 bproxAmount, uint256 totalCost) public nonpayable onlyWhitelisted 

Arguments

Name
Type
Description

bucket

bytes32

bucket from which the BProx will be removed

userAddress

address payable

user address to redeem for

bproxAmount

uint256

bprox amount to redeem [using mocPresicion]

totalCost

uint256

btc value of bproxAmount [using reservePrecision]

setBProxBalanceOf

Sets the amount of BProx

function setBProxBalanceOf(bytes32 bucket, address payable userAddress, uint256 value) public nonpayable onlyWhitelisted 

Arguments

Name
Type
Description

bucket

bytes32

bucket from which the BProx will be setted

userAddress

address payable

user address to redeem for

value

uint256

bprox amount to redeem [using mocPresicion]

initializeValues

intializes values of the contract

function initializeValues(address _governor) internal nonpayable

Arguments

Name
Type
Description

_governor

address

Governor contract address

Proposal to remove leveraged positions
contracts/MoCBProxManager.sol
MoCBucketContainer
initialize(address connectorAddress, address _governor, uint256 _c0Cobj, uint256 _x2Cobj)
bproxBalanceOf(bytes32 bucket, address userAddress)
hasValidBalance(bytes32 bucket, address userAddress, uint256 index)
assignBProx(bytes32 bucket, address payable account, uint256 bproxAmount, uint256 totalCost)
removeBProx(bytes32 bucket, address payable userAddress, uint256 bproxAmount, uint256 totalCost)
setBProxBalanceOf(bytes32 bucket, address payable userAddress, uint256 value)
initializeValues(address _governor)