ILaunchpad

Interface of launchpad staking reward. Basic structs, events and errors to be used in the launchpad contract are defined in this interface.

PoolInfo

The staking pool information. Each token to be staked should be mapped one pool information.

struct PoolInfo {
  uint256 allocation;
  uint256 lastUpdatedBlock;
  uint256 rewardPerTokenStored;
  uint256 totalSupply;
  bool isActive;
}

DepositInfo

The deposit information. One deposit information should be mapped for each staking pool in which each account has deposited.

struct DepositInfo {
  uint256 amount;
  uint256 userRewardPerTokenPaid;
  uint256 reward;
}

Depositparams

Parameters required when depositing into a staking pool.

struct Depositparams {
  address token;
  uint256 amount;
  uint8 refundOption;
}

AdjustDepositParams

Parameters required when adjusting the return option for what has already been deposited in the staking pool.

struct AdjustDepositParams {
  address token;
  uint8 currentOption;
  uint8 replacementOption;
}

PoolInfoResponse

The response to be returned when requesting staking pool information.

struct PoolInfoResponse {
  uint256 totalSupply;
  uint256 dailyAllocation;
}

DepositInfoResponse

The response to be returned when requesting deposit information.

struct DepositInfoResponse {
  uint256 amount;
  uint256 rewards;
  uint256 dailyRewards;
  uint8 refundOption;
}

MiningMultiplierParams

The parameter required when set mining multiplier.

struct MiningMultiplierParams {
  uint8 refundOption;
  uint256 multiplier;
}

PoolConfig

The parameter required when set pool information.

struct PoolConfig {
  address stakingToken;
  uint256 allocation;
}

ClaimConfig

The parameter required when set claim schedule.

struct ClaimConfig {
  uint256 countLimit;
  uint256 startBlock;
  uint256 cycle;
}

InitializeParams

The parameter required when initialize.

struct InitializeParams {
  uint256 miningStartBlock;
  uint256 miningEndBlock;
  uint256 bonusSupply;
  struct ILaunchpadStaking.PoolConfig[] poolList;
  struct ILaunchpadStaking.MiningMultiplierParams[] miningMultipliers;
  struct ILaunchpadStaking.ClaimConfig claimSchedule;
}

CreatePool

event CreatePool(address token, uint256 allocation)

This event should be emit when create staking pool.

Parameters

NameTypeDescription

token

address

The staking token contract address.

allocation

uint256

The allocation of reward per block.

Deposit

event Deposit(address user, address token, uint8 refundOption, uint256 amount)

This event should be emit when user deposit to staking pool.

Parameters

NameTypeDescription

user

address

The user's account address.

token

address

The staking token contract address.

refundOption

uint8

The deposited refund options.

amount

uint256

The amount of token for deposit.

Withdraw

event Withdraw(address user, address token, uint8 refundOption, uint256 amount)

This event should be emit when user withdraw from staking pool.

Parameters

NameTypeDescription

user

address

The user's account address.

token

address

The staking token contract address.

refundOption

uint8

The deposited refund options.

amount

uint256

The amount of token for witdraw.

EmergencyWithdraw

event EmergencyWithdraw(address user, address token, uint256 amount)

This event should be emit when user emergency withdraw from staking pool.

Parameters

NameTypeDescription

user

address

The user's account address.

token

address

The staking token contract address.

amount

uint256

The amount of token for withdraw.

Refund

event Refund(address user, address token, uint256 amount)

This event should be emit when user refunded from staking pool.

Parameters

NameTypeDescription

user

address

The user's account address.

token

address

the staking token contract address.

amount

uint256

The amount of token for withdraw.

Claim

event Claim(address user, uint256 count, uint256 reward)

This event should be emit when user claim rewards.

Parameters

NameTypeDescription

user

address

The user's account address.

count

uint256

The claim count.

reward

uint256

The amount of reward.

Collect

event Collect(address user, address token, uint256 amount)

This event should be emit when transfer token to collector.

Parameters

NameTypeDescription

user

address

The user's account address.

token

address

The staking token contract address.

amount

uint256

The amount of token for withdraw.

FixRewards

event FixRewards(address user, uint256 amount)

This event should be emit when fixed user's total rewards.

Parameters

NameTypeDescription

user

address

The user's account address.

amount

uint256

Total claimable rewards.

InvalidPeriod

error InvalidPeriod(uint256 startBlock, uint256 endBlock)

It was not executed within the valid period.

Parameters

NameTypeDescription

startBlock

uint256

The starting block number.

endBlock

uint256

The end block number.

InvalidPool

error InvalidPool(address token)

The pool of token does not exist.

Parameters

NameTypeDescription

token

address

The staking token contract address.

InvalidDepositInfo

error InvalidDepositInfo(address user, address token, uint8 refundOption)

The deposit information does not exist.

Parameters

NameTypeDescription

user

address

The user's account address.

token

address

The staking token contract address.

refundOption

uint8

The deposited refund option.

InvalidDepositedPool

error InvalidDepositedPool(address user, address token)

The deposited pool by token dose not exist.

Parameters

NameTypeDescription

user

address

The user's account address.

token

address

The staking token contract address.

OutOfRange

error OutOfRange(uint256 first, uint256 last, uint256 input)

The input value is not a valid range value.

Parameters

NameTypeDescription

first

uint256

The first value in range.

last

uint256

The last value in range.

input

uint256

The input value.

ClaimUnauthorized

error ClaimUnauthorized(address user)

The user is not authorized to claim. To claim reward, the user must first withdraw deposit.

Parameters

NameTypeDescription

user

address

The user's account address.

NotYetStarted

error NotYetStarted(uint256 startingPoint)

The starting block number has not yet been reached.

Parameters

NameTypeDescription

startingPoint

uint256

The starting block number.

NotExistRewardOf

error NotExistRewardOf(address user)

The user's reward does not exist.

Parameters

NameTypeDescription

user

address

The user's account address.

OverTheLimit

error OverTheLimit(uint256 limit, uint256 required)

The required value is exceeds the limit value.

Parameters

NameTypeDescription

limit

uint256

The limit value.

required

uint256

The required value.

OverTheDeadline

error OverTheDeadline(uint256 deadline)

Over the deadline. No more execute the function.

Parameters

NameTypeDescription

deadline

uint256

The block number for deadline.

BelowStandard

error BelowStandard(uint256 standard, uint256 required)

The required value is below the standard value.

Parameters

NameTypeDescription

standard

uint256

The standard value.

required

uint256

The required value.

ERC20TransferFailure

error ERC20TransferFailure(address to, address from, address token, uint256 amount)

The ERC20 token transfer is failed.

Parameters

NameTypeDescription

to

address

The address of receiver.

from

address

The address of sender.

token

address

The token contract address for transfer.

amount

uint256

The amount for transfer.

ETHTransferFailure

error ETHTransferFailure(address to, address from, uint256 amount)

The Native token transfer is failed.

Parameters

NameTypeDescription

to

address

The address of receiver.

from

address

The address of sender.

amount

uint256

The amount for transfer.