Skip to main content

MockAave

MockAave

reserveToAToken

mapping(address => address) reserveToAToken

pool

address pool

core

address payable core

factor

uint256 factor

addAToken

function addAToken(address _aToken, address _underlying) public

setFactor

function setFactor(uint256 factor_) public

deposit

function deposit(address _reserve, uint256 _amount, address _to, uint16) external

withdraw

function withdraw(address asset, uint256 amount, address to) external returns (uint256)

Withdraws an amount of underlying asset from the reserve, burning the equivalent aTokens owned E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC

Parameters

NameTypeDescription
assetaddressThe address of the underlying asset to withdraw
amountuint256The underlying amount to be withdrawn - Send the value type(uint256).max in order to withdraw the whole aToken balance
toaddressAddress that will receive the underlying, same as msg.sender if the user wants to receive it on his own wallet, or a different address if the beneficiary is a different wallet

Return Values

NameTypeDescription
[0]uint256The final amount withdrawn

getLendingPool

function getLendingPool() external view returns (address)

Get the current address for Aave LendingPool

Lending pool is the core contract on which to call deposit