PermissionedLendingPool
Last updated
Last updated
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 .
Allows 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.
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
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.
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.
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
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
Allows, whitelisted liquidators to liquidate positions with health factor below 1.
Allows to withdraw amount
of the underlying asset
, i.e. burn aToken to redeem the underlying token.
msg.sender
must be whitelisted for role.
Allows amount
of asset
with interestRateMode
, sending the borrowed amount
to msg.sender
and the debt incurred by onBehalfOf
.
msg.sender
and onBehalfOf
must be whitelisted for role. permissionAdmin
that whitelisted onBehalfOf
must be still valid.
onBehalfOf
must have enough collateral supplied to the pool via deposit() or have delegated credit to msg.sender
via
OnBehalfOf
must be whitelisted for role.
msg.sender
must be whitelisted for role.
msg.sender
must be whitelisted for role.
msg.sender
must be whitelisted for role.
Also, see our and for more details.
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 to know what the error number means. Alternatively, you can also find what the numbers represent by checking the