Skip to content

Collateral

Description

Source: contracts/Collateral.sol

Variables

canOpenLoans

Source

Type: bool

collateralKey

Source

Type: bytes32

interactionDelay

Source

Type: uint256

issueFeeRate

Source

Type: uint256

manager

Source

Type: address

maxLoansPerAccount

Source

Type: uint256

minCollateral

Source

Type: uint256

minCratio

Source

Type: uint256

shortingRewards

Source

Type: mapping(bytes32 => address)

state

Source

Type: contract CollateralState

synths

Source

Type: bytes32[]

synthsByKey

Source

Type: mapping(bytes32 => bytes32)

Constructor

constructor

Source

Details

Signature

constructor(contract CollateralState _state, address _owner, address _manager, address _resolver, bytes32 _collateralKey, uint256 _minCratio, uint256 _minCollateral)

Visibility

public

State Mutability

``

Views

areSynthsAndCurrenciesSet

Source

Details

Signature

areSynthsAndCurrenciesSet(bytes32[] _synthNamesInResolver, bytes32[] _synthKeys) view returns (bool)

Visibility

external

State Mutability

view

collateralRatio

Source

Details

Signature

collateralRatio(struct ICollateralLoan.Loan loan) view returns (uint256 cratio)

Visibility

public

State Mutability

view

collateralRedeemed

Source

Details

Signature

collateralRedeemed(bytes32 currency, uint256 amount) view returns (uint256 collateral)

Visibility

public

State Mutability

view

liquidationAmount

Source

Details

Signature

liquidationAmount(struct ICollateralLoan.Loan loan) view returns (uint256 amount)

Visibility

public

State Mutability

view

maxLoan

Source

Details

Signature

maxLoan(uint256 amount, bytes32 currency) view returns (uint256 max)

Visibility

public

State Mutability

view

resolverAddressesRequired

Source

Details

Signature

resolverAddressesRequired() view returns (bytes32[] addresses)

Visibility

public

State Mutability

view

Restricted Functions

addRewardsContracts

Source

Details

Signature

addRewardsContracts(address rewardsContract, bytes32 synth)

Visibility

external

State Mutability

``

Modifiers

addSynths

Source

Details

Signature

addSynths(bytes32[] _synthNamesInResolver, bytes32[] _synthKeys)

Visibility

external

State Mutability

``

Requires

Modifiers

setCanOpenLoans

Source

Details

Signature

setCanOpenLoans(bool _canOpenLoans)

Visibility

external

State Mutability

``

Modifiers

Emits

setInteractionDelay

Source

Details

Signature

setInteractionDelay(uint256 _interactionDelay)

Visibility

external

State Mutability

``

Requires

Modifiers

Emits

setIssueFeeRate

Source

Details

Signature

setIssueFeeRate(uint256 _issueFeeRate)

Visibility

external

State Mutability

``

Modifiers

Emits

setManager

Source

Details

Signature

setManager(address _newManager)

Visibility

external

State Mutability

``

Modifiers

Emits

setMinCratio

Source

Details

Signature

setMinCratio(uint256 _minCratio)

Visibility

external

State Mutability

``

Requires

Modifiers

Emits

Internal Functions

_checkLoanAvailable

Source

Details

Signature

_checkLoanAvailable(struct ICollateralLoan.Loan _loan) view

Visibility

internal

State Mutability

view

Requires

_checkSynthBalance

Source

Details

Signature

_checkSynthBalance(address payer, bytes32 key, uint256 amount) view

Visibility

internal

State Mutability

view

Requires

_exchangeRates

Source

Details

Signature

_exchangeRates() view returns (contract IExchangeRates)

Visibility

internal

State Mutability

view

_exchanger

Source

Details

Signature

_exchanger() view returns (contract IExchanger)

Visibility

internal

State Mutability

view

_feePool

Source

Details

Signature

_feePool() view returns (contract IFeePool)

Visibility

internal

State Mutability

view

_manager

Source

Details

Signature

_manager() view returns (contract ICollateralManager)

Visibility

internal

State Mutability

view

_payFees

Source

Details

Signature

_payFees(uint256 amount, bytes32 synth)

Visibility

internal

State Mutability

``

_processPayment

Source

Details

Signature

_processPayment(struct ICollateralLoan.Loan loanBefore, uint256 payment) returns (struct ICollateralLoan.Loan loanAfter)

Visibility

internal

State Mutability

``

_synth

Source

Details

Signature

_synth(bytes32 synthName) view returns (contract ISynth)

Visibility

internal

State Mutability

view

_synthsUSD

Source

Details

Signature

_synthsUSD() view returns (contract ISynth)

Visibility

internal

State Mutability

view

_systemStatus

Source

Details

Signature

_systemStatus() view returns (contract ISystemStatus)

Visibility

internal

State Mutability

view

accrueInterest

Source

Details

Signature

accrueInterest(struct ICollateralLoan.Loan loan) returns (struct ICollateralLoan.Loan loanAfter)

Visibility

internal

State Mutability

``

Requires

closeByLiquidationInternal

Source

Details

Signature

closeByLiquidationInternal(address borrower, address liquidator, struct ICollateralLoan.Loan loan) returns (uint256 collateral)

Visibility

internal

State Mutability

``

Requires

Emits

closeInternal

Source

Details

Signature

closeInternal(address borrower, uint256 id) returns (uint256 collateral)

Visibility

internal

State Mutability

``

Requires

Modifiers

Emits

depositInternal

Source

Details

Signature

depositInternal(address account, uint256 id, uint256 amount)

Visibility

internal

State Mutability

``

Requires

Modifiers

Emits

drawInternal

Source

Details

Signature

drawInternal(uint256 id, uint256 amount)

Visibility

internal

State Mutability

``

Requires

Modifiers

Emits

issuanceRatio

Source

Details

Signature

issuanceRatio() view returns (uint256 ratio)

Visibility

internal

State Mutability

view

liquidateInternal

Source

Details

Signature

liquidateInternal(address borrower, uint256 id, uint256 payment) returns (uint256 collateralLiquidated)

Visibility

internal

State Mutability

``

Requires

Modifiers

Emits

openInternal

Source

Details

Signature

openInternal(uint256 collateral, uint256 amount, bytes32 currency, bool short) returns (uint256 id)

Visibility

internal

State Mutability

``

Requires

Modifiers

Emits

repayInternal

Source

Details

Signature

repayInternal(address borrower, address repayer, uint256 id, uint256 payment)

Visibility

internal

State Mutability

``

Requires

Modifiers

Emits

withdrawInternal

Source

Details

Signature

withdrawInternal(uint256 id, uint256 amount) returns (uint256 withdraw)

Visibility

internal

State Mutability

``

Requires

Modifiers

Emits

Modifiers

rateIsValid

Source

Events

CanOpenLoansUpdated

Source

Signature: CanOpenLoansUpdated(bool canOpenLoans)

CollateralDeposited

Source

Signature: CollateralDeposited(address account, uint256 id, uint256 amountDeposited, uint256 collateralAfter)

CollateralWithdrawn

Source

Signature: CollateralWithdrawn(address account, uint256 id, uint256 amountWithdrawn, uint256 collateralAfter)

InteractionDelayUpdated

Source

Signature: InteractionDelayUpdated(uint256 interactionDelay)

IssueFeeRateUpdated

Source

Signature: IssueFeeRateUpdated(uint256 issueFeeRate)

LoanClosed

Source

Signature: LoanClosed(address account, uint256 id)

LoanClosedByLiquidation

Source

Signature: LoanClosedByLiquidation(address account, uint256 id, address liquidator, uint256 amountLiquidated, uint256 collateralLiquidated)

LoanCreated

Source

Signature: LoanCreated(address account, uint256 id, uint256 amount, uint256 collateral, bytes32 currency, uint256 issuanceFee)

LoanDrawnDown

Source

Signature: LoanDrawnDown(address account, uint256 id, uint256 amount)

LoanPartiallyLiquidated

Source

Signature: LoanPartiallyLiquidated(address account, uint256 id, address liquidator, uint256 amountLiquidated, uint256 collateralLiquidated)

LoanRepaymentMade

Source

Signature: LoanRepaymentMade(address account, address repayer, uint256 id, uint256 amountRepaid, uint256 amountAfter)

ManagerUpdated

Source

Signature: ManagerUpdated(address manager)

MaxLoansPerAccountUpdated

Source

Signature: MaxLoansPerAccountUpdated(uint256 maxLoansPerAccount)

MinCollateralUpdated

Source

Signature: MinCollateralUpdated(uint256 minCollateral)

MinCratioRatioUpdated

Source

Signature: MinCratioRatioUpdated(uint256 minCratio)