This major version release changes the ABI for the liquidate
function on the Escrow contract. A new parameter has been added called maxLiquidateAmount
which sets the maximum amount of local currency that will be liquidated.
This PR resolves a few issues found while developing as well as raised by Gauntlet Networks.
- Adds a max liquidate amount to the liquidate function call on Escrow.sol. For extremely large debts this allows for a partial liquidation.
- Removes trading on the AMM during fCash settlement and liquidation due to a potential vulnerability to flash loans during those scenarios.
- Adds the
settledMaturedAssets
call to thesettleReserve
function to ensure that CashPayer assets are converted to negative cash balances before settlement.
Also fixes a couple UX issues:
- Allows for rolling of debts to future maturities by changing the
_withdraw
function slightly on the Escrow.sol contract. Withdraw will withdraw down to a zero cash balance instead of failing due to an underflow. This means that borrowing while an account has a negative cash balance will repay a current cash balance first. - Adds a new function
freeCollateralViewAggregateOnly
which returns less data and therefore is slightly more gas efficient.