PermissionedLendingPool
PermissionedLendingPool
The PermissionedLendingPool
contract is the main contract adding the "permissions" layer to Aave Arc. It exposes all the user-oriented actions that can be invoked using either Solidity or Web3 libraries.
The source code can be found on Github here.
Contract API reference
Write Methods
deposit()
Allows whitelisted depositors to deposit amount
of an asset
into the market, minting the same amount
of corresponding aTokens, and transferring them to the onBehalfOf
address.
asset
address of the underlying asset
amount
amount deposited, expressed in wei units
onBehalfOf
address whom will receive the aTokens. Use msg.sender when the aTokens should be sent to the caller.
referralCode
referral code for 3rd party referral program integration. Use 0 for no referral.
withdraw()
Allows whitelisted depositors to withdraw amount
of the underlying asset
, i.e. burn aToken to redeem the underlying token.
asset
address of the underlying asset, not the aToken
amount
amount deposited, expressed in wei units. Use type(uint).max to withdraw the entire balance.
to
address that will receive the asset
borrow()
Allows whitelisted Borrowers amount
of asset
with interestRateMode
, sending the borrowed amount
to msg.sender
and the debt incurred by onBehalfOf
.
asset
address of the underlying asset
amount
amount to be borrowed, expressed in wei units
interestRateMode
the type of borrow debt. Stable: 1, Variable: 2
referralCode
referral code for our referral program. Use 0 for no referral code.
onBehalfOh
address of user who will incur the debt. Use msg.sender when not calling on behalf of a different user.
repay()
Repays onBehalfOf
's debtamount
of asset
which has a rateMode
.
asset
address of the underlying asset
amount
amount to be borrowed, expressed in wei units. Use uint(-1) to repay the entire debt, ONLY when the repayment is not executed on behalf of a 3rd party. In case of repayments on behalf of another user, it's recommended to send an _amount slightly higher than the current borrowed amount.
rateMode
the type of borrow debt. Stable: 1, Variable: 2
onBehalfOf
address of user who will incur the debt. Use msg.sender when not calling on behalf of a different user.
swapBorrowRateMode()
Swaps the msg.sender
's borrow rate modes between stable and variable.
asset
address of the underlying asset
rateMode
the rate mode the user is swapping from. Stable: 1, Variable: 2
setUserUseReserveAsCollateral()
Sets the asset
of msg.sender
to be used as collateral or not.
asset
address of the underlying asset
useAsCollateral
true
if the asset should be used as collateral
liquidationCall()
Allows, whitelisted liquidators to liquidate positions with health factor below 1.
Also, see our Liquidations guide and LendingPool liquidationCall for more details.
Error Codes
In order to reduce gas usage and code size, Aave contracts return numbered errors. If you are making calls to the protocol and receive numbered errors, you can use our error code reference guide to know what the error number means. Alternatively, you can also find what the numbers represent by checking the Errors.sol
Last updated