Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

fix natspec documentation of liquidate() to indicate that amounts mus… #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contracts/modules/Liquidation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ contract Liquidation is BaseLogic {
/// @param violator Address that may be in collateral violation
/// @param underlying Token that is to be repayed
/// @param collateral Token that is to be seized
/// @param repay The amount of underlying DTokens to be transferred from violator to sender, in units of underlying
/// @param minYield The minimum acceptable amount of collateral ETokens to be transferred from violator to sender, in units of collateral
/// @param repay The amount of underlying DTokens to be transferred from violator to sender, in units of underlying normalised to 18 decimals
/// @param minYield The minimum acceptable amount of collateral ETokens to be transferred from violator to sender, in units of collateral normalised to 18 decimals
function liquidate(address violator, address underlying, address collateral, uint repay, uint minYield) external nonReentrant {
require(accountLookup[violator].deferLiquidityStatus == DEFERLIQUIDITY__NONE, "e/liq/violator-liquidity-deferred");

Expand Down
6 changes: 5 additions & 1 deletion test/liquidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,12 +828,16 @@ et.testSet({
},
},

// minYield failure

{ send: 'liquidation.liquidate', args: [ctx.wallet4.address, ctx.contracts.tokens.TST.address, ctx.contracts.tokens.TST9.address, () => ctx.stash.repay, et.eth('0.81')], expectError: 'e/liq/min-yield', },

// Successful liquidation

{ call: 'eTokens.eTST.reserveBalanceUnderlying', args: [], equals: [0, '0.000000000001'], },
{ call: 'dTokens.dTST.balanceOf', args: [ctx.wallet4.address], equals: et.eth('20'), },

{ send: 'liquidation.liquidate', args: [ctx.wallet4.address, ctx.contracts.tokens.TST.address, ctx.contracts.tokens.TST9.address, () => ctx.stash.repay, 0], },
{ send: 'liquidation.liquidate', args: [ctx.wallet4.address, ctx.contracts.tokens.TST.address, ctx.contracts.tokens.TST9.address, () => ctx.stash.repay, et.eth('0.8')], },

// liquidator:
{ call: 'dTokens.dTST.balanceOf', args: [ctx.wallet.address], equals: () => ctx.stash.repay, },
Expand Down