0xNODES
Search…
IIntegration
Standard interface for a yield integration contract compatible with the Kernel.
An Integration represents a single pool of funds at the system integration level. However, the integration may ultimately adapt to any number of points in the external integration.
The system will recognize an integration implementing IIntegration by denoting it as poolID 0.
1
// SPDX-License-Identifier: GPL-2.0
2
pragma solidity 0.8.4;
3
4
interface IIntegration {
5
event Deploy(address token, uint256 amount);
6
event HarvestYield(address token, uint256 amount);
7
event Deposit(address token, uint256 amount);
8
event Withdraw(address token, uint256 amount);
9
10
/// @param tokenAddress The address of the deposited token
11
/// @param amount The amount of the token being deposited
12
function deposit(address tokenAddress, uint256 amount) external;
13
14
/// @param tokenAddress The address of the withdrawal token
15
/// @param amount The amount of the token to withdraw
16
function withdraw(address tokenAddress, uint256 amount) external;
17
18
/// @dev Deploys all tokens held in the integration contract to the integrated protocol
19
function deploy() external;
20
21
/// @dev Harvests token yield from the integration
22
function harvestYield() external;
23
24
/// @dev This returns the total amount of the underlying token that
25
/// @dev has been deposited to the integration contract
26
/// @param tokenAddress The address of the deployed token
27
/// @return The amount of the underlying token that can be withdrawn
28
function getBalance(address tokenAddress) external view returns (uint256);
29
30
/// @dev Returns the total amount of yield awaiting to be harvested
31
/// @dev using the relevant integration's own function
32
/// @param amount The amount of available yield for the specified token
33
function getPendingYield(address) external view returns (uint256 amount);
34
}
35
Copied!
Copy link