Using the Launchpad
contract-owner
calls create-pool
with the following parameters.launch-token-trait
: the trait reference ofproject token
(e.g. ALEX)payment-token-trait
: trait reference ofpayment token
(e.g. sUSDT)launch-owner
: address of the project that launches theproject token
launch-tokens-per-ticket
: number ofproject token
perticket
price-per-ticket-in-fixed
:payment token
deposit required perticket
(in 8-digit fixed notation)activation-threshold
: number of tickets required to activate the launchregistration-start-height
: start (inclusive) block-height of registration periodregistration-end-height
: end (inclusive) block-height of registration periodclaim-end-height
: end (inclusive) block-height of claim (i.e. lottery) periodapower-per-ticket-in-fixed
:apower
required for eachticket
(can be a list, in 8-digit fixed notation)registration-max-tickets
: maximum number ofticket
an address can registerfee-per-ticket-in-fixed
: listingfee
charged by the platform as percentage ofprice-per-ticket-in-fixed
(in 8-digit fixed notation)
Launch price of
project token
in payment token
= launch-tokens-per-ticket
/ price-per-ticket-in-fixed
Once the pool is created, and before the registration period starts,
launch-owner
must call add-to-position
with the following parameters:launch-id
: id of the launchtickets
: number oftickets
launch-owner
wants to allocate tolaunch-token-trait
: trait reference ofproject token
Total raise for
project token
= tickets
x launch-tokens-per-ticket
x Launch price of token
.Upon calling
add-to-position
, (tickets
x launch-tokens-per-ticket
) of project token
will be transferred from launch-owner
to the contract.Participants call
register
with the following parameters:launch-id
: id of the launchtickets
: number ofticket
the participant wants to registerpayment-token-trait
: trait reference ofpayment token
Assuming (1) registration period has started, (2) registration period has not ended and (3) the participant is not already registered, the contract will register the participant and:
- burn the required number of
apower
from the participant's wallet, and - transfer
tickets
xprice-per-ticket-in-fixed
ofpayment token
from the participant's wallet to the contract.
The lottery will be drawn one block after the registration ended. The claim/lottery period ends at
claim-end
block-height. contract-owner
or launch-owner
will draw the lottery off-chain using the prescribed rule and call claim
repeatedly with the following parameterslaunch-id
: id of the launchinput
: list of participants who won the lottery (up to 200)launch-token-trait
: trait reference ofproject token
payment-token-trait
: trait reference ofpayment token
Upon calling
claim
, assuming (1) registration period has ended, (2) not all tickets are already won, (3) the launch is activated and (4) the claim/lottery period has not ended yet, the contract will verify the validity of input
and - transfer the proceeds of
payment token
, net offee
, tolaunch-owner
, - transfer
fee
to the platform, and - transfer the appropriate number of
project token
to the winners.
Refund will be processed by either
contract-owner
or launch-owner
in a similar manner to the claim.