Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IShareXAirdrop

Git Source

Title: IShareXAirdrop

Interface for the ShareX token airdrop contract

Functions

setAllocation

Set allocation for a single address

function setAllocation(address account, uint256 amount) external;

Parameters

NameTypeDescription
accountaddressThe address to set allocation for
amountuint256The amount of SHARE tokens allocated

setAllocations

Set allocations for multiple addresses in batch

function setAllocations(address[] calldata accounts, uint256[] calldata amounts) external;

Parameters

NameTypeDescription
accountsaddress[]Array of addresses
amountsuint256[]Array of allocation amounts

setAirdropTime

Set the airdrop time window

function setAirdropTime(uint64 startTime_, uint64 endTime_) external;

Parameters

NameTypeDescription
startTime_uint64Timestamp when claims start
endTime_uint64Timestamp when claims end

withdrawUnclaimedTokens

Withdraw unclaimed tokens after airdrop ends

function withdrawUnclaimedTokens(uint256 amount) external;

Parameters

NameTypeDescription
amountuint256Amount of tokens to withdraw

claim

Claim a specific amount of tokens

function claim(uint256 amount) external;

Parameters

NameTypeDescription
amountuint256Amount of tokens to claim

claimAll

Claim all available tokens

function claimAll() external;

getAllocation

Get allocation info for an address

function getAllocation(address account) external view returns (AllocationInfo memory info);

Parameters

NameTypeDescription
accountaddressThe address to query

Returns

NameTypeDescription
infoAllocationInfoAllocationInfo struct with allocated and claimed amounts

getClaimableAmount

Get claimable amount for an address

function getClaimableAmount(address account) external view returns (uint256 claimable);

Parameters

NameTypeDescription
accountaddressThe address to query

Returns

NameTypeDescription
claimableuint256Amount that can be claimed

getAirdropInfo

Get airdrop configuration and status

function getAirdropInfo() external view returns (AirdropInfo memory info);

Returns

NameTypeDescription
infoAirdropInfoAirdropInfo struct with all details

isClaimActive

Check if claim period is currently active

function isClaimActive() external view returns (bool active);

Returns

NameTypeDescription
activeboolTrue if claims are allowed

shareToken

Get the SHARE token address

function shareToken() external view returns (address token);

Returns

NameTypeDescription
tokenaddressThe token address

startTime

Get the claim start time

function startTime() external view returns (uint64 startTime);

Returns

NameTypeDescription
startTimeuint64The start timestamp

endTime

Get the claim end time

function endTime() external view returns (uint64 endTime);

Returns

NameTypeDescription
endTimeuint64The end timestamp

totalAllocated

Get total allocated amount

function totalAllocated() external view returns (uint256 total);

Returns

NameTypeDescription
totaluint256The total allocated

totalClaimed

Get total claimed amount

function totalClaimed() external view returns (uint256 total);

Returns

NameTypeDescription
totaluint256The total claimed

Structs

AllocationInfo

Allocation information for a user

struct AllocationInfo {
    uint128 allocated; // Total amount allocated to user
    uint128 claimed; // Amount already claimed
}

AirdropInfo

Airdrop configuration and status

struct AirdropInfo {
    address token; // SHARE token address
    uint64 startTime; // Claim start timestamp
    uint64 endTime; // Claim end timestamp
    uint256 totalAllocated; // Total tokens allocated
    uint256 totalClaimed; // Total tokens claimed
}