Liquidator
\
Functions
collateralAsset
collateralAsset
Returns the address of the collateral asset.
Return Values:
0
address
address
\
collateralRemaining
collateralRemaining
Returns the amount of collateral yet to be liquidated.
Return Values:
0
uint256
uint256
\
factory
factory
The address of the proxy factory.
Return Values:
0
factory_
address
address
\
fundsAsset
fundsAsset
Returns the address of the funding asset.
Return Values:
0
address
address
\
getExpectedAmount
getExpectedAmount
Returns the expected amount to be returned from a flash loan given a certain amount of `collateralAsset`.
Parameters:
0
swapAmount_
uint256
uint256
Amount of `collateralAsset` to be flash-borrowed.
Return Values:
0
expectedAmount_
uint256
uint256
Amount of `fundsAsset` that must be returned in the same transaction.
\
globals
globals
Return Values:
0
globals_
address
address
\
governor
governor
Return Values:
0
governor_
address
address
\
implementation
implementation
The address of the implementation contract being proxied.
Return Values:
0
implementation_
address
address
\
liquidatePortion
liquidatePortion
Flash loan function that: 1. Transfers a specified amount of `collateralAsset` to `msg.sender`. 2. Performs an arbitrary call to `msg.sender`, to trigger logic necessary to get `fundsAsset` (e.g., AMM swap). 3. Performs a `transferFrom`, taking the corresponding amount of `fundsAsset` from the user. If the required amount of `fundsAsset` is not returned in step 3, the entire transaction reverts.
Parameters:
0
collateralAmount_
uint256
uint256
1
maxReturnAmount_
uint256
uint256
Max amount of `fundsAsset` that can be returned to the liquidator contract.
2
data_
bytes
bytes
ABI-encoded arguments to be used in the low-level call to perform step 2.
\
loanManager
loanManager
Returns the address of the loan manager contract.
Return Values:
0
address
address
\
migrate
migrate
Modifies the proxy's storage by delegate-calling a migrator contract with some arguments. Access control logic critical since caller can force a selfdestruct via a malicious `migrator_` which is delegatecalled.
Parameters:
0
migrator_
address
address
The address of a migrator contract.
1
arguments_
bytes
bytes
Some encoded arguments to use for the migration.
\
poolDelegate
poolDelegate
Return Values:
0
poolDelegate_
address
address
\
pullFunds
pullFunds
Pulls a specified amount of ERC-20 tokens from the contract. Can only be called by `owner`.
Parameters:
0
token_
address
address
The ERC-20 token contract address.
1
destination_
address
address
The destination of the transfer.
2
amount_
uint256
uint256
The amount to transfer.
\
setCollateralRemaining
setCollateralRemaining
Sets the initial amount of collateral to be liquidated.
Parameters:
0
collateralAmount_
uint256
uint256
The amount of collateral to be liquidated.
\
setImplementation
setImplementation
Modifies the proxy's implementation address.
Parameters:
0
implementation_
address
address
\
upgrade
upgrade
Upgrades a contract implementation to a specific version. Access control logic critical since caller can force a selfdestruct via a malicious `migrator_` which is delegatecalled.
Parameters:
0
version_
uint256
uint256
1
arguments_
bytes
bytes
Some encoded arguments to use for the upgrade.
\
Events
FundsPulled
FundsPulled
Funds were withdrawn from the liquidator.
Parameters:
0
token_
address
address
Address of the token that was withdrawn.
1
destination_
address
address
Address of where tokens were sent.
2
amount_
uint256
uint256
Amount of tokens that were sent.
\
PortionLiquidated
PortionLiquidated
Portion of collateral was liquidated.
Parameters:
0
swapAmount_
uint256
uint256
Amount of collateralAsset that was liquidated.
1
returnedAmount_
uint256
uint256
Amount of fundsAsset that was returned.
\
Upgraded
Upgraded
The instance was upgraded.
Parameters:
0
toVersion_
uint256
uint256
The new version of the loan.
1
arguments_
bytes
bytes
The upgrade arguments, if any.
\
Last updated