Skip to content

Collateral

Description

Source: contracts/Collateral.sol

Variables

canOpenLoans

Source

Type: bool

collateralKey

Source

Type: bytes32

issueFeeRate

Source

Type: uint256

loans

Source

Type: mapping(uint256 => struct ICollateralLoan.Loan)

manager

Source

Type: contract ICollateralManager

minCollateral

Source

Type: uint256

minCratio

Source

Type: uint256

shortingRewards

Source

Type: mapping(bytes32 => address)

synths

Source

Type: bytes32[]

synthsByKey

Source

Type: mapping(bytes32 => bytes32)

Constructor

constructor

Source

Details

Signature

constructor(address _owner, contract ICollateralManager _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(uint256 id) view returns (uint256 cratio)

Visibility

public

State Mutability

view

liquidationAmount

Source

Details

Signature

liquidationAmount(uint256 id) view returns (uint256 liqAmount)

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

setIssueFeeRate

Source

Details

Signature

setIssueFeeRate(uint256 _issueFeeRate)

Visibility

external

State Mutability

``

Modifiers

Emits

setMinCollateral

Source

Details

Signature

setMinCollateral(uint256 _minCollateral)

Visibility

external

State Mutability

``

Modifiers

Emits

Internal Functions

_accrueInterest

Source

Details

Signature

_accrueInterest(struct ICollateralLoan.Loan loan)

Visibility

internal

State Mutability

``

_checkLoanAvailable

Source

Details

Signature

_checkLoanAvailable(struct ICollateralLoan.Loan loan) view

Visibility

internal

State Mutability

view

Requires

_checkLoanRatio

Source

Details

Signature

_checkLoanRatio(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

_close

Source

Details

Signature

_close(address borrower, uint256 id) returns (uint256 amount, uint256 collateral)

Visibility

internal

State Mutability

``

Modifiers

Emits

_closeByLiquidation

Source

Details

Signature

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

Visibility

internal

State Mutability

``

Emits

_closeLoan

Source

Details

Signature

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

Visibility

internal

State Mutability

``

_closeLoanByRepayment

Source

Details

Signature

_closeLoanByRepayment(address borrower, uint256 id) returns (uint256 amount, uint256 collateral)

Visibility

internal

State Mutability

``

Emits

_collateralUtil

Source

Details

Signature

_collateralUtil() view returns (contract ICollateralUtil)

Visibility

internal

State Mutability

view

_deposit

Source

Details

Signature

_deposit(address account, uint256 id, uint256 amount) returns (uint256, uint256)

Visibility

internal

State Mutability

``

Requires

Modifiers

Emits

_draw

Source

Details

Signature

_draw(uint256 id, uint256 amount) returns (uint256, uint256)

Visibility

internal

State Mutability

``

Modifiers

Emits

_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

_getLoanAndAccrueInterest

Source

Details

Signature

_getLoanAndAccrueInterest(uint256 id, address owner) returns (struct ICollateralLoan.Loan loan)

Visibility

internal

State Mutability

``

Requires

_isLoanOpen

Source

Details

Signature

_isLoanOpen(uint256 interestIndex) pure

Visibility

internal

State Mutability

pure

Requires

_liquidate

Source

Details

Signature

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

Visibility

internal

State Mutability

``

Requires

Modifiers

Emits

_open

Source

Details

Signature

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

Visibility

internal

State Mutability

``

Requires

Modifiers

Emits

_payFees

Source

Details

Signature

_payFees(uint256 amount, bytes32 synth)

Visibility

internal

State Mutability

``

_processPayment

Source

Details

Signature

_processPayment(struct ICollateralLoan.Loan loan, uint256 payment)

Visibility

internal

State Mutability

``

Requires

_recordLoanAsClosed

Source

Details

Signature

_recordLoanAsClosed(struct ICollateralLoan.Loan loan)

Visibility

internal

State Mutability

``

_repay

Source

Details

Signature

_repay(address borrower, address repayer, uint256 id, uint256 payment) returns (uint256, uint256)

Visibility

internal

State Mutability

``

Modifiers

Emits

_repayWithCollateral

Source

Details

Signature

_repayWithCollateral(address borrower, uint256 id, uint256 payment) returns (uint256 amount, uint256 collateral)

Visibility

internal

State Mutability

``

Requires

Modifiers

Emits

_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

_withdraw

Source

Details

Signature

_withdraw(uint256 id, uint256 amount) returns (uint256, uint256)

Visibility

internal

State Mutability

``

Modifiers

Emits

Modifiers

issuanceIsActive

Source

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)

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)

LoanClosedByRepayment

Source

Signature: LoanClosedByRepayment(address account, uint256 id, uint256 amountRepaid, uint256 collateralAfter)

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)

MinCollateralUpdated

Source

Signature: MinCollateralUpdated(uint256 minCollateral)