pragma solidity ^0.5.16;
contract IComptroller {
/**
* @notice Calculate the remaining available credit limit for the specified user. At most one of the remaining credit limit and the owed credit limit is greater than 0. When the owed credit limit is greater than 0, the user can be liquidated.
* @return error,0= success,
Remaining credit limit
* Overflow credit limit
*/
function getAccountLiquidity(address account) public view returns (uint, uint, uint);
/**
* @notice Obtain user collateral funds pool
* @param account
* @param index
* @return Fund pool address
*/
function accountAssets(adress account, uint index) public vew returns(address);
}
pragma solidity ^0.5.16;
contract IDmToken {
/**
* @notice Liquidation of debts of current assets
* @param borrower
* @param repayAmount
* @param dmTokenCollateral
* @return 0 = success
*/
function liquidateBorrow(address borrower, uint repayAmount, address dmTokenCollateral) external returns (uint);
/**
* @notice Get the deposit of the specified user in the current fund pool
* @param owner
* @return Deposit amount
*/
function balanceOfUnderlying(address owner) external returns (uint);
}
pragma solidity ^0.5.16;
contract IDUSDUnitroller {
/**
* @notice Liquidation of stable currency debt
* @param borrower
* @param repayAmount
* @param dmTokenCollateral
* @return 0 = success, The liquidator actually repays the amount of stablecoins
*/
function liquidateDUSD(address borrower, uint repayAmount, address dmTokenCollateral) external returns (uint, uint);
}
Notes
Scan the chain, collect the user list
IComptroller.getAccountLiquidity: Check whether the specified user can be liquidated
IComptroller.accountAssets: Get user pledged asset pool
IDmToken.balanceOfUnderlying: Get the user's deposit in the designated fund pool
IDmToken.liquidateBorrow: Liquidation (repayment of borrowings)
IDUSDUnitroller.liquidateDUSD: Liquidation (repayment of stablecoins)