Maple
Search…
Liquidator

constructor(
address owner_,
address collateralAsset_,
address fundsAsset_,
address auctioneer_,
address destination_,
address globals_
);

Index
Name
Type
Internal Type
Description
0
owner_
address
address
The address of an account that will have administrative privileges on this contract.
1
collateralAsset_
address
address
The address of the collateral asset being liquidated.
2
fundsAsset_
address
address
The address of the funds asset.
3
auctioneer_
address
address
The address of an Auctioneer.
4
destination_
address
address
The address to send funds asset after liquidation.
5
globals_
address
address
The address of a Maple Globals contract.

Getter function that returns `auctioneer`.
function auctioneer()
view
returns (
address auctioneer_
);

Index
Name
Type
Internal Type
Description
0
auctioneer_
address
address

Getter function that returns `collateralAsset`.
function collateralAsset()
view
returns (
address collateralAsset_
);

Index
Name
Type
Internal Type
Description
0
collateralAsset_
address
address

Getter function that returns `destination` - address that liquidated funds are sent to.
function destination()
view
returns (
address destination_
);

Index
Name
Type
Internal Type
Description
0
destination_
address
address

Getter function that returns `fundsAsset`.
function fundsAsset()
view
returns (
address fundsAsset_
);

Index
Name
Type
Internal Type
Description
0
fundsAsset_
address
address

Returns the expected amount to be returned from a flash loan given a certain amount of `collateralAsset`.
function getExpectedAmount(
uint256 swapAmount_
)
nonpayable
returns (
uint256 expectedAmount_
);

Index
Name
Type
Internal Type
Description
0
swapAmount_
uint256
uint256
Amount of `collateralAsset` to be flash-borrowed.

Index
Name
Type
Internal Type
Description
0
expectedAmount_
uint256
uint256
Amount of `fundsAsset` that must be returned in the same transaction.

Getter function that returns `globals`.
function globals()
view
returns (
address
);

Index
Name
Type
Internal Type
Description
0
address
address

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.
function liquidatePortion(
uint256 swapAmount_,
uint256 maxReturnAmount_,
bytes data_
)
nonpayable;

Index
Name
Type
Internal Type
Description
0
swapAmount_
uint256
uint256
Amount of `collateralAsset` that is to be borrowed in the flash loan.
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.

Getter function that returns `owner`.
function owner()
view
returns (
address owner_
);

Index
Name
Type
Internal Type
Description
0
owner_
address
address

Pulls a specified amount of ERC-20 tokens from the contract. Can only be called by `owner`.
function pullFunds(
address token_,
address destination_,
uint256 amount_
)
nonpayable;

Index
Name
Type
Internal Type
Description
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.

Set the auctioneer contract address, which is used to pull the `getExpectedAmount`. Can only be set by `owner`.
function setAuctioneer(
address auctioneer_
)
nonpayable;

Index
Name
Type
Internal Type
Description
0
auctioneer_
address
address
The auctioneer contract address.

Auctioneer was set.
event AuctioneerSet(
address auctioneer_
);

Index
Name
Type
Internal Type
Description
0
auctioneer_
address
address
Address of the auctioneer.

Funds were withdrawn from the liquidator.
event FundsPulled(
address token_,
address destination_,
uint256 amount_
);

Index
Name
Type
Internal Type
Description
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.

Portion of collateral was liquidated.
event PortionLiquidated(
uint256 swapAmount_,
uint256 returnedAmount_
);

Index
Name
Type
Internal Type
Description
0
swapAmount_
uint256
uint256
Amount of collateralAsset that was liquidated.
1
returnedAmount_
uint256
uint256
Amount of fundsAsset that was returned.
Copy link
On this page
Constructor
Functions
auctioneer [state variable]
collateralAsset [state variable]
destination [state variable]
fundsAsset [state variable]
getExpectedAmount
globals [state variable]
liquidatePortion
owner [state variable]
pullFunds
setAuctioneer
Events
AuctioneerSet
FundsPulled
PortionLiquidated