forked from neptune-mutual-blue/protocol
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ILendingStrategy.sol
37 lines (27 loc) · 1.56 KB
/
ILendingStrategy.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
// Neptune Mutual Protocol (https://neptunemutual.com)
// SPDX-License-Identifier: BUSL-1.1
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./IMember.sol";
pragma solidity ^0.8.0;
interface ILendingStrategy is IMember {
struct LendingStrategyInfoType {
uint256 deposits;
uint256 withdrawals;
}
event LogDeposit(bytes32 indexed name, uint256 counter, uint256 amount, uint256 certificateReceived, uint256 depositTotal, uint256 withdrawalTotal);
event Deposited(bytes32 indexed key, address indexed onBehalfOf, uint256 stablecoinDeposited, uint256 certificateTokenIssued);
event LogWithdrawal(bytes32 indexed name, uint256 counter, uint256 stablecoinWithdrawn, uint256 certificateRedeemed, uint256 depositTotal, uint256 withdrawalTotal);
event Withdrawn(bytes32 indexed key, address indexed sendTo, uint256 stablecoinWithdrawn, uint256 certificateTokenRedeemed);
event Drained(IERC20 indexed asset, uint256 amount);
function getKey() external pure returns (bytes32);
function getWeight() external pure returns (uint256);
function getDepositAsset() external view returns (IERC20);
function getDepositCertificate() external view returns (IERC20);
/**
* @dev Gets info of this strategy by cover key
* @param coverKey Enter the cover key
*/
function getInfo(bytes32 coverKey) external view returns (LendingStrategyInfoType memory info);
function deposit(bytes32 coverKey, uint256 amount) external returns (uint256 certificateReceived);
function withdraw(bytes32 coverKey) external returns (uint256 stablecoinWithdrawn);
}