Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Latest commit

 

History

History
244 lines (212 loc) · 6.68 KB

FakeAaveLendingPool.md

File metadata and controls

244 lines (212 loc) · 6.68 KB

FakeAaveLendingPool.sol

View Source: contracts/fakes/FakeAaveLendingPool.sol

↗ Extends: IAaveV2LendingPoolLike, ERC20

FakeAaveLendingPool

Contract Members

Constants & Variables

contract FakeToken public aToken;

Functions

function (FakeToken _aToken) public nonpayable ERC20 

Arguments

Name Type Description
_aToken FakeToken
Source Code
constructor(FakeToken _aToken) ERC20("aDAI", "aDAI") {
    aToken = _aToken;
  }

deposit

function deposit(address asset, uint256 amount, address , uint16 ) external nonpayable

Arguments

Name Type Description
asset address
amount uint256
address
uint16
Source Code
function deposit(
    address asset,
    uint256 amount,
    address,
    uint16
  ) external override {
    IERC20(asset).transferFrom(msg.sender, address(this), amount);
    aToken.mint(msg.sender, amount);
  }

withdraw

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

Arguments

Name Type Description
asset address
amount uint256
to address
Source Code
function withdraw(
    address asset,
    uint256 amount,
    address to
  ) external override returns (uint256) {
    aToken.transferFrom(msg.sender, address(this), amount);

    FakeToken dai = FakeToken(asset);

    uint256 interest = (amount * 10) / 100;
    dai.mint(address(this), interest);

    dai.transfer(to, amount + interest);

    return amount;
  }

Contracts