CollateralManager¶
Description¶
Source: contracts/CollateralManager.sol
Variables¶
CONTRACT_NAME
¶
Type: bytes32
baseBorrowRate
¶
Type: uint256
baseShortRate
¶
Type: uint256
maxDebt
¶
Type: uint256
maxSkewRate
¶
Type: uint256
shortableSynthsByKey
¶
Type: mapping(bytes32 => bytes32)
state
¶
Type: contract CollateralManagerState
synthsByKey
¶
Type: mapping(bytes32 => bytes32)
utilisationMultiplier
¶
Type: uint256
Constructor¶
constructor
¶
Details
Signature
constructor(contract CollateralManagerState _state, address _owner, address _resolver, uint256 _maxDebt, uint256 _maxSkewRate, uint256 _baseBorrowRate, uint256 _baseShortRate)
Visibility
public
State Mutability
``
Views¶
areShortableSynthsSet
¶
Details
Signature
areShortableSynthsSet(bytes32[] requiredSynthNamesInResolver, bytes32[] synthKeys) view returns (bool)
Visibility
external
State Mutability
view
Requires
areSynthsAndCurrenciesSet
¶
Details
Signature
areSynthsAndCurrenciesSet(bytes32[] requiredSynthNamesInResolver, bytes32[] synthKeys) view returns (bool)
Visibility
external
State Mutability
view
exceedsDebtLimit
¶
Details
Signature
exceedsDebtLimit(uint256 amount, bytes32 currency) view returns (bool canIssue, bool anyRateIsInvalid)
Visibility
external
State Mutability
view
getBorrowRate
¶
Details
Signature
getBorrowRate() view returns (uint256 borrowRate, bool anyRateIsInvalid)
Visibility
public
State Mutability
view
getRatesAndTime
¶
Details
Signature
getRatesAndTime(uint256 index) view returns (uint256 entryRate, uint256 lastRate, uint256 lastUpdated, uint256 newIndex)
Visibility
public
State Mutability
view
getShortRate
¶
Details
Signature
getShortRate(bytes32 synthKey) view returns (uint256 shortRate, bool rateIsInvalid)
Visibility
public
State Mutability
view
getShortRatesAndTime
¶
Details
Signature
getShortRatesAndTime(bytes32 currency, uint256 index) view returns (uint256 entryRate, uint256 lastRate, uint256 lastUpdated, uint256 newIndex)
Visibility
public
State Mutability
view
hasAllCollaterals
¶
Details
Signature
hasAllCollaterals(address[] collaterals) view returns (bool)
Visibility
public
State Mutability
view
hasCollateral
¶
Details
Signature
hasCollateral(address collateral) view returns (bool)
Visibility
public
State Mutability
view
isSynthManaged
¶
Details
Signature
isSynthManaged(bytes32 currencyKey) view returns (bool)
Visibility
external
State Mutability
view
long
¶
Details
Signature
long(bytes32 synth) view returns (uint256 amount)
Visibility
external
State Mutability
view
resolverAddressesRequired
¶
Details
Signature
resolverAddressesRequired() view returns (bytes32[] addresses)
Visibility
public
State Mutability
view
short
¶
Details
Signature
short(bytes32 synth) view returns (uint256 amount)
Visibility
external
State Mutability
view
totalLong
¶
Details
Signature
totalLong() view returns (uint256 susdValue, bool anyRateIsInvalid)
Visibility
public
State Mutability
view
totalLongAndShort
¶
Details
Signature
totalLongAndShort() view returns (uint256 susdValue, bool anyRateIsInvalid)
Visibility
public
State Mutability
view
totalShort
¶
Details
Signature
totalShort() view returns (uint256 susdValue, bool anyRateIsInvalid)
Visibility
public
State Mutability
view
Restricted Functions¶
accrueInterest
¶
Details
Signature
accrueInterest(uint256 interestIndex, bytes32 currency, bool isShort) returns (uint256 difference, uint256 index)
Visibility
external
State Mutability
``
Requires
Modifiers
addCollaterals
¶
Details
Signature
addCollaterals(address[] collaterals)
Visibility
external
State Mutability
``
Modifiers
addShortableSynths
¶
Details
Signature
addShortableSynths(bytes32[] requiredSynthNamesInResolver, bytes32[] synthKeys)
Visibility
external
State Mutability
``
Requires
Modifiers
addSynths
¶
Details
Signature
addSynths(bytes32[] synthNamesInResolver, bytes32[] synthKeys)
Visibility
external
State Mutability
``
Requires
Modifiers
decrementLongs
¶
Details
Signature
decrementLongs(bytes32 synth, uint256 amount)
Visibility
external
State Mutability
``
Modifiers
decrementShorts
¶
Details
Signature
decrementShorts(bytes32 synth, uint256 amount)
Visibility
external
State Mutability
``
Modifiers
getNewLoanId
¶
Details
Signature
getNewLoanId() returns (uint256 id)
Visibility
external
State Mutability
``
Modifiers
incrementLongs
¶
Details
Signature
incrementLongs(bytes32 synth, uint256 amount)
Visibility
external
State Mutability
``
Modifiers
incrementShorts
¶
Details
Signature
incrementShorts(bytes32 synth, uint256 amount)
Visibility
external
State Mutability
``
Modifiers
removeCollaterals
¶
Details
Signature
removeCollaterals(address[] collaterals)
Visibility
external
State Mutability
``
Modifiers
removeShortableSynths
¶
Details
Signature
removeShortableSynths(bytes32[] synths)
Visibility
external
State Mutability
``
Modifiers
removeSynths
¶
Details
Signature
removeSynths(bytes32[] synthNamesInResolver, bytes32[] synthKeys)
Visibility
external
State Mutability
``
Requires
Modifiers
setBaseBorrowRate
¶
Details
Signature
setBaseBorrowRate(uint256 _baseBorrowRate)
Visibility
public
State Mutability
``
Modifiers
Emits
setBaseShortRate
¶
Details
Signature
setBaseShortRate(uint256 _baseShortRate)
Visibility
public
State Mutability
``
Modifiers
Emits
setMaxDebt
¶
Details
Signature
setMaxDebt(uint256 _maxDebt)
Visibility
public
State Mutability
``
Requires
Modifiers
Emits
setMaxSkewRate
¶
Details
Signature
setMaxSkewRate(uint256 _maxSkewRate)
Visibility
public
State Mutability
``
Modifiers
Emits
setUtilisationMultiplier
¶
Details
Signature
setUtilisationMultiplier(uint256 _utilisationMultiplier)
Visibility
public
State Mutability
``
Requires
Modifiers
Emits
updateBorrowRatesCollateral
¶
Details
Signature
updateBorrowRatesCollateral(uint256 rate)
Visibility
external
State Mutability
``
Modifiers
updateShortRatesCollateral
¶
Details
Signature
updateShortRatesCollateral(bytes32 currency, uint256 rate)
Visibility
external
State Mutability
``
Modifiers
Internal Functions¶
_exchangeRates
¶
Details
Signature
_exchangeRates() view returns (contract IExchangeRates)
Visibility
internal
State Mutability
view
_issuer
¶
Details
Signature
_issuer() view returns (contract IIssuer)
Visibility
internal
State Mutability
view
_synth
¶
Details
Signature
_synth(bytes32 synthName) view returns (contract ISynth)
Visibility
internal
State Mutability
view
updateBorrowRates
¶
Details
Signature
updateBorrowRates(uint256 rate)
Visibility
internal
State Mutability
``
updateShortRates
¶
Details
Signature
updateShortRates(bytes32 currency, uint256 rate)
Visibility
internal
State Mutability
``
Modifiers¶
onlyCollateral
¶
Events¶
BaseBorrowRateUpdated
¶
Signature: BaseBorrowRateUpdated(uint256 baseBorrowRate)
BaseShortRateUpdated
¶
Signature: BaseShortRateUpdated(uint256 baseShortRate)
CollateralAdded
¶
Signature: CollateralAdded(address collateral)
CollateralRemoved
¶
Signature: CollateralRemoved(address collateral)
LiquidationPenaltyUpdated
¶
Signature: LiquidationPenaltyUpdated(uint256 liquidationPenalty)
MaxDebtUpdated
¶
Signature: MaxDebtUpdated(uint256 maxDebt)
MaxSkewRateUpdated
¶
Signature: MaxSkewRateUpdated(uint256 maxSkewRate)
ShortableSynthAdded
¶
Signature: ShortableSynthAdded(bytes32 synth)
ShortableSynthRemoved
¶
Signature: ShortableSynthRemoved(bytes32 synth)
SynthAdded
¶
Signature: SynthAdded(bytes32 synth)
SynthRemoved
¶
Signature: SynthRemoved(bytes32 synth)
UtilisationMultiplierUpdated
¶
Signature: UtilisationMultiplierUpdated(uint256 utilisationMultiplier)