Skip to main content

ReserveCurrencyDisputer

ReserveCurrencyDisputer#

Helper contract to enable a disputer to hold one reserver currency and dispute against any number of financial contracts. Is assumed to be called by a DSProxy which holds reserve currency.

Functions#

swapDispute(address uniswapRouter, address financialContract, address reserveCurrency, uint256 liquidationId, address sponsor, uint256 maxReserveTokenSpent, uint256 deadline) (public)

Swaps required amount of reserve currency to collateral currency which is then used to dispute a liquidation.

Any collateral the contract has will be used before anything is purchased on Uniswap.

Parameters:#

  • uniswapRouter: address of the uniswap router used to facilitate trades.
  • financialContract: address of the financial contract on which the liquidation is occurring.
  • reserveCurrency: address of the token to swap for collateral. This is the common currency held by the DSProxy.
  • sponsor: address of the sponsor who's liquidation is disputed.
  • liquidationId: index of the liquidation for the given sponsor.
  • maxReserveTokenSpent: maximum number of reserve tokens to spend in the trade. Bounds slippage.
  • deadline: abort the trade and dispute if the transaction is mined after this timestamp.
subOrZero(struct FixedPoint.Unsigned a, struct FixedPoint.Unsigned b) → struct FixedPoint.Unsigned (internal)
getCollateralBalance(contract IFinancialContract fc) → struct FixedPoint.Unsigned (internal)