ILeo
Inherits: ILeoEvents
Functions
vestPosition
vest a position that the caller owns.
function vestPosition(address pool, uint256 id, address recipient) external;
Parameters
Name | Type | Description |
---|---|---|
pool | address | to take the position from |
id | uint256 | of the position to take |
recipient | address | to receive the vested position |
createCampaign
create a campaign with the parameters given.
takes extraMax from the user of the token given
function createCampaign(
bytes8 campaignId,
address pool,
int32 tickLower,
int32 tickUpper,
uint64 perSecond,
address token,
uint256 extraMax,
uint64 starting,
uint64 ending
) external;
Parameters
Name | Type | Description |
---|---|---|
campaignId | bytes8 | to modify for the pool given |
pool | address | to reward positions that participate in with |
tickLower | int32 | to reward positions in this range with |
tickUpper | int32 | to reward positions in this range with |
perSecond | uint64 | distribution to send |
token | address | to give out |
extraMax | uint256 | to start the pool amount with for this pool |
starting | uint64 | to when to start the token distribution with |
ending | uint64 | for when to stop the token distribution |
cancelCampaign
cancel an ongoing campaign by amending it to have 0
only usable by the admin of the campaign
function cancelCampaign(address pool, bytes8 campaignId) external;
Parameters
Name | Type | Description |
---|---|---|
pool | address | to modify the campaign for |
campaignId | bytes8 | to modify |
campaignDetails
details of a campaign
function campaignDetails(bytes8 campaignId)
external
returns (
int32 tickLower,
int32 tickUpper,
uint256 perSecond,
address token,
uint256 distributed,
uint256 maximum,
uint64 startingTimestamp,
uint64 endingTimestamp
);
Parameters
Name | Type | Description |
---|---|---|
campaignId | bytes8 | to identify this campaign |
poolLp
pool LP tokens vested to Leo for this pool
function poolLp(address pool) external returns (uint256 lp);
Parameters
Name | Type | Description |
---|---|---|
pool | address | to check |
Returns
Name | Type | Description |
---|---|---|
lp | uint256 | tokens to return |
collect
collect rewards for a position vested in a pool with the campaigns given
function collect(PositionDetails[] memory positionDetails, bytes8[] memory campaignIds, address recipient)
external
returns (CollectRewards memory collectRewards);
Parameters
Name | Type | Description |
---|---|---|
positionDetails | PositionDetails[] | to check |
campaignIds | bytes8[] | to check |
recipient | address | of the returned amounts |
divestPosition
divest a position, returning the position ID to the user
function divestPosition(uint256 positionId, address recipient) external;
Parameters
Name | Type | Description |
---|---|---|
positionId | uint256 | to move out |
recipient | address | to send this to |
Structs
PositionDetails
struct PositionDetails {
address token;
uint256 id;
}
PoolRewards
struct PoolRewards {
address pool;
uint128 amount0Lp;
uint128 amount1Lp;
}
CampaignRewards
struct CampaignRewards {
uint256 positionId;
address campaignToken;
uint256 rewards;
}
CollectRewards
struct CollectRewards {
PoolRewards[] poolRewards;
CampaignRewards[] campaignRewards;
}