forked from neptune-mutual-blue/protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFakeAaveLendingPool.sol
42 lines (34 loc) · 1.01 KB
/
FakeAaveLendingPool.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Neptune Mutual Protocol (https://neptunemutual.com)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
import "../dependencies/aave/IAaveV2LendingPoolLike.sol";
import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
import "./FakeToken.sol";
contract FakeAaveLendingPool is IAaveV2LendingPoolLike, ERC20 {
FakeToken public aToken;
constructor(FakeToken _aToken) ERC20("aDAI", "aDAI") {
aToken = _aToken;
}
function deposit(
address asset,
uint256 amount,
address,
uint16
) external override {
IERC20(asset).transferFrom(msg.sender, address(this), amount);
aToken.mint(amount);
aToken.transfer(msg.sender, amount);
}
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(interest);
dai.transfer(to, amount + interest);
return amount;
}
}