MoCBucketContainer

View Source: contracts/MoCBucketContainer.sol

↗ Extends: MoCBase, Governed ↘ Derived Contracts: MoCRiskProxManager

MoCBucketContainer - version: 0.1.10

Structs

RiskProxBalance

âš  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.

struct RiskProxBalance {
 uint256 value,
 uint256 index
}

MoCBucket

struct MoCBucket {
 bytes32 name,
 bool isBase,
 uint256 nStable,
 uint256 nRiskPro,
 uint256 nReserve,
 uint256 cobj,
 mapping(address => struct MoCBucketContainer.RiskProxBalance) riskProxBalances,
 address payable[] activeBalances,
 uint256 activeBalancesLength,
 uint256 inrateBag,
 bool available
}

Contract Members

Constants & Variables



BucketMovement

Parameters

Name
Type
Description

from

bytes32

to

bytes32

reserves

uint256

stableTokens

uint256

BucketCreation

Parameters

Name
Type
Description

name

bytes32

cobj

uint256

BucketStateUpdate

Parameters

Name
Type
Description

name

bytes32

nReserve

uint256

nStable

uint256

nRiskProx

uint256

inrateBag

uint256

Modifiers

onlyBaseBucket

Arguments

Name
Type
Description

bucket

bytes32

bucketStateUpdate

Arguments

Name
Type
Description

bucket

bytes32

Functions

getBucketNReserve

Arguments

Name
Type
Description

bucket

bytes32

getBucketNRiskPro

Arguments

Name
Type
Description

bucket

bytes32

getBucketNStableToken

Arguments

Name
Type
Description

bucket

bytes32

getBucketCobj

Arguments

Name
Type
Description

bucket

bytes32

getInrateBag

Arguments

Name
Type
Description

bucket

bytes32

setBucketCobj

Sets the objective coverage (cobj) on an specficied bucket.

Arguments

Name
Type
Description

_bucket

bytes32

_cobj

uint256

isBucketBase

returns true if the bucket is a base bucket

Arguments

Name
Type
Description

bucket

bytes32

Name of the bucket*

isBucketEmpty

returns true if the bucket have stableTokens in it

Arguments

Name
Type
Description

bucket

bytes32

Name of the bucket*

getActiveAddresses

Returns all the address that currently have riskProx position for this bucket

Arguments

Name
Type
Description

bucket

bytes32

bucket of the active address

getActiveAddressesCount

Returns the number of addresses that currently have riskProx position for this bucket

Arguments

Name
Type
Description

bucket

bytes32

bucket of the active address

addValuesToBucket

Add values to all variables of the bucket

Arguments

Name
Type
Description

bucketName

bytes32

Name of the bucket

reserveTokens

uint256

ReserveToken amount [using reservePrecision]

stableToken

uint256

StableToken amount [using mocPrecision]

riskProx

uint256

RiskProx amount [using mocPrecision]

substractValuesFromBucket

Substract values to all variables of the bucket

Arguments

Name
Type
Description

bucketName

bytes32

Name of the bucket

reserve

uint256

ReserveToken amount [using reservePrecision]

stableToken

uint256

StableToken amount [using mocPrecision]

riskProx

uint256

RiskProx amount [using mocPrecision]

deliverInrate

Moves ReserveTokens from inrateBag to main ReserveTokens bucket bag

Arguments

Name
Type
Description

bucketName

bytes32

Name of the bucket to operate

amount

uint256

value to move from inrateBag to main bag [using reservePrecision]

recoverInrate

Removes Interests rate from Inrate bag

Returns

Retrieved value

Arguments

Name
Type
Description

bucketName

bytes32

Name of the bucket to operate

amount

uint256

value to move from inrateBag to main bag [using reservePrecision]

payInrate

Moves ReserveTokens from origin bucket to destination bucket inrateBag

Arguments

Name
Type
Description

bucketName

bytes32

name of the bucket to from which takes

reserveAmount

uint256

value to add to main bag [using reservePrecision]

moveResTokensAndStableTokens

Move ReserveTokens and StableTokens from one bucket to another

Arguments

Name
Type
Description

from

bytes32

Name of bucket from where the ReserveTokens will be removed

to

bytes32

Name of bucket from where the ReserveTokens will be added

reserve

uint256

ReserveTokens amount [using reservePrecision]

stableTokens

uint256

StableTokens amount [using mocPrecision]*

liquidateBucket

Clears completely the origin bucket, removing all StableTokens, ReserveTokens and riskProxs

Arguments

Name
Type
Description

toLiquidate

bytes32

Bucket to be cleared out

destination

bytes32

Bucket that will receive the StableTokens and ReserveTokens

emptyBucket

Clears StableTokens and ReserveTokens from bucket origin and sends them to destination bucket

Arguments

Name
Type
Description

origin

bytes32

Bucket to clear out

destination

bytes32

Destination bucket*

isAvailableBucket

checks if a bucket exists

Arguments

Name
Type
Description

bucket

bytes32

name of the bucket

clearBucketBalances

Put all bucket RiskProx balances in zero

Arguments

Name
Type
Description

bucketName

bytes32

Bucket to clear out

createBucket

Creates bucket

Arguments

Name
Type
Description

name

bytes32

Name of the bucket

cobj

uint256

Target Coverage of the bucket

isBase

bool

Indicates if it is a base bucket (true) or not (false)

Last updated