ILeo

Git Source

Inherits: ILeoEvents

Functions

vestPosition

vest a position that the caller owns.

function vestPosition(address pool, uint256 id, address recipient) external;

Parameters

NameTypeDescription
pooladdressto take the position from
iduint256of the position to take
recipientaddressto 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

NameTypeDescription
campaignIdbytes8to modify for the pool given
pooladdressto reward positions that participate in with
tickLowerint32to reward positions in this range with
tickUpperint32to reward positions in this range with
perSeconduint64distribution to send
tokenaddressto give out
extraMaxuint256to start the pool amount with for this pool
startinguint64to when to start the token distribution with
endinguint64for 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

NameTypeDescription
pooladdressto modify the campaign for
campaignIdbytes8to 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

NameTypeDescription
campaignIdbytes8to identify this campaign

poolLp

pool LP tokens vested to Leo for this pool

function poolLp(address pool) external returns (uint256 lp);

Parameters

NameTypeDescription
pooladdressto check

Returns

NameTypeDescription
lpuint256tokens 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

NameTypeDescription
positionDetailsPositionDetails[]to check
campaignIdsbytes8[]to check
recipientaddressof the returned amounts

divestPosition

divest a position, returning the position ID to the user

function divestPosition(uint256 positionId, address recipient) external;

Parameters

NameTypeDescription
positionIduint256to move out
recipientaddressto 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;
}