Skip to content

CollateralManager

Description

Source: contracts/CollateralManager.sol

Variables

CONTRACT_NAME

Source

Type: bytes32

baseBorrowRate

Source

Type: uint256

baseShortRate

Source

Type: uint256

maxDebt

Source

Type: uint256

maxSkewRate

Source

Type: uint256

shortableSynthsByKey

Source

Type: mapping(bytes32 => bytes32)

state

Source

Type: contract CollateralManagerState

synthsByKey

Source

Type: mapping(bytes32 => bytes32)

utilisationMultiplier

Source

Type: uint256

Constructor

constructor

Source

Details

Signature

constructor(contract CollateralManagerState _state, address _owner, address _resolver, uint256 _maxDebt, uint256 _maxSkewRate, uint256 _baseBorrowRate, uint256 _baseShortRate)

Visibility

public

State Mutability

``

Views

areShortableSynthsSet

Source

Details

Signature

areShortableSynthsSet(bytes32[] requiredSynthNamesInResolver, bytes32[] synthKeys) view returns (bool)

Visibility

external

State Mutability

view

Requires

areSynthsAndCurrenciesSet

Source

Details

Signature

areSynthsAndCurrenciesSet(bytes32[] requiredSynthNamesInResolver, bytes32[] synthKeys) view returns (bool)

Visibility

external

State Mutability

view

exceedsDebtLimit

Source

Details

Signature

exceedsDebtLimit(uint256 amount, bytes32 currency) view returns (bool canIssue, bool anyRateIsInvalid)

Visibility

external

State Mutability

view

getBorrowRate

Source

Details

Signature

getBorrowRate() view returns (uint256 borrowRate, bool anyRateIsInvalid)

Visibility

public

State Mutability

view

getRatesAndTime

Source

Details

Signature

getRatesAndTime(uint256 index) view returns (uint256 entryRate, uint256 lastRate, uint256 lastUpdated, uint256 newIndex)

Visibility

public

State Mutability

view

getShortRate

Source

Details

Signature

getShortRate(bytes32 synthKey) view returns (uint256 shortRate, bool rateIsInvalid)

Visibility

public

State Mutability

view

getShortRatesAndTime

Source

Details

Signature

getShortRatesAndTime(bytes32 currency, uint256 index) view returns (uint256 entryRate, uint256 lastRate, uint256 lastUpdated, uint256 newIndex)

Visibility

public

State Mutability

view

hasAllCollaterals

Source

Details

Signature

hasAllCollaterals(address[] collaterals) view returns (bool)

Visibility

public

State Mutability

view

hasCollateral

Source

Details

Signature

hasCollateral(address collateral) view returns (bool)

Visibility

public

State Mutability

view

isSynthManaged

Source

Details

Signature

isSynthManaged(bytes32 currencyKey) view returns (bool)

Visibility

external

State Mutability

view

long

Source

Details

Signature

long(bytes32 synth) view returns (uint256 amount)

Visibility

external

State Mutability

view

resolverAddressesRequired

Source

Details

Signature

resolverAddressesRequired() view returns (bytes32[] addresses)

Visibility

public

State Mutability

view

short

Source

Details

Signature

short(bytes32 synth) view returns (uint256 amount)

Visibility

external

State Mutability

view

totalLong

Source

Details

Signature

totalLong() view returns (uint256 susdValue, bool anyRateIsInvalid)

Visibility

public

State Mutability

view

totalLongAndShort

Source

Details

Signature

totalLongAndShort() view returns (uint256 susdValue, bool anyRateIsInvalid)

Visibility

public

State Mutability

view

totalShort

Source

Details

Signature

totalShort() view returns (uint256 susdValue, bool anyRateIsInvalid)

Visibility

public

State Mutability

view

Restricted Functions

accrueInterest

Source

Details

Signature

accrueInterest(uint256 interestIndex, bytes32 currency, bool isShort) returns (uint256 difference, uint256 index)

Visibility

external

State Mutability

``

Requires

Modifiers

addCollaterals

Source

Details

Signature

addCollaterals(address[] collaterals)

Visibility

external

State Mutability

``

Modifiers

addShortableSynths

Source

Details

Signature

addShortableSynths(bytes32[] requiredSynthNamesInResolver, bytes32[] synthKeys)

Visibility

external

State Mutability

``

Requires

Modifiers

addSynths

Source

Details

Signature

addSynths(bytes32[] synthNamesInResolver, bytes32[] synthKeys)

Visibility

external

State Mutability

``

Requires

Modifiers

decrementLongs

Source

Details

Signature

decrementLongs(bytes32 synth, uint256 amount)

Visibility

external

State Mutability

``

Modifiers

decrementShorts

Source

Details

Signature

decrementShorts(bytes32 synth, uint256 amount)

Visibility

external

State Mutability

``

Modifiers

getNewLoanId

Source

Details

Signature

getNewLoanId() returns (uint256 id)

Visibility

external

State Mutability

``

Modifiers

incrementLongs

Source

Details

Signature

incrementLongs(bytes32 synth, uint256 amount)

Visibility

external

State Mutability

``

Modifiers

incrementShorts

Source

Details

Signature

incrementShorts(bytes32 synth, uint256 amount)

Visibility

external

State Mutability

``

Modifiers

removeCollaterals

Source

Details

Signature

removeCollaterals(address[] collaterals)

Visibility

external

State Mutability

``

Modifiers

removeShortableSynths

Source

Details

Signature

removeShortableSynths(bytes32[] synths)

Visibility

external

State Mutability

``

Modifiers

removeSynths

Source

Details

Signature

removeSynths(bytes32[] synthNamesInResolver, bytes32[] synthKeys)

Visibility

external

State Mutability

``

Requires

Modifiers

setBaseBorrowRate

Source

Details

Signature

setBaseBorrowRate(uint256 _baseBorrowRate)

Visibility

public

State Mutability

``

Modifiers

Emits

setBaseShortRate

Source

Details

Signature

setBaseShortRate(uint256 _baseShortRate)

Visibility

public

State Mutability

``

Modifiers

Emits

setMaxDebt

Source

Details

Signature

setMaxDebt(uint256 _maxDebt)

Visibility

public

State Mutability

``

Requires

Modifiers

Emits

setMaxSkewRate

Source

Details

Signature

setMaxSkewRate(uint256 _maxSkewRate)

Visibility

public

State Mutability

``

Modifiers

Emits

setUtilisationMultiplier

Source

Details

Signature

setUtilisationMultiplier(uint256 _utilisationMultiplier)

Visibility

public

State Mutability

``

Requires

Modifiers

Emits

updateBorrowRatesCollateral

Source

Details

Signature

updateBorrowRatesCollateral(uint256 rate)

Visibility

external

State Mutability

``

Modifiers

updateShortRatesCollateral

Source

Details

Signature

updateShortRatesCollateral(bytes32 currency, uint256 rate)

Visibility

external

State Mutability

``

Modifiers

Internal Functions

_exchangeRates

Source

Details

Signature

_exchangeRates() view returns (contract IExchangeRates)

Visibility

internal

State Mutability

view

_issuer

Source

Details

Signature

_issuer() view returns (contract IIssuer)

Visibility

internal

State Mutability

view

_synth

Source

Details

Signature

_synth(bytes32 synthName) view returns (contract ISynth)

Visibility

internal

State Mutability

view

updateBorrowRates

Source

Details

Signature

updateBorrowRates(uint256 rate)

Visibility

internal

State Mutability

``

updateShortRates

Source

Details

Signature

updateShortRates(bytes32 currency, uint256 rate)

Visibility

internal

State Mutability

``

Modifiers

onlyCollateral

Source

Events

BaseBorrowRateUpdated

Source

Signature: BaseBorrowRateUpdated(uint256 baseBorrowRate)

BaseShortRateUpdated

Source

Signature: BaseShortRateUpdated(uint256 baseShortRate)

CollateralAdded

Source

Signature: CollateralAdded(address collateral)

CollateralRemoved

Source

Signature: CollateralRemoved(address collateral)

LiquidationPenaltyUpdated

Source

Signature: LiquidationPenaltyUpdated(uint256 liquidationPenalty)

MaxDebtUpdated

Source

Signature: MaxDebtUpdated(uint256 maxDebt)

MaxSkewRateUpdated

Source

Signature: MaxSkewRateUpdated(uint256 maxSkewRate)

ShortableSynthAdded

Source

Signature: ShortableSynthAdded(bytes32 synth)

ShortableSynthRemoved

Source

Signature: ShortableSynthRemoved(bytes32 synth)

SynthAdded

Source

Signature: SynthAdded(bytes32 synth)

SynthRemoved

Source

Signature: SynthRemoved(bytes32 synth)

UtilisationMultiplierUpdated

Source

Signature: UtilisationMultiplierUpdated(uint256 utilisationMultiplier)