Lockdrop
Introduction
This ADO is another part of the toolkit of allowing a user to setup their own CW20 token. The lockdrop ADO allows users to deposit a native token in exchange for a given CW20 token.
There are two phases:
The first phase is the deposit phase in which users can deposit a native denom. They can also freely withdraw in this time.
The second phase is the withdrawal phase, in which for the first half, users can withdraw up to half of their deposit, and in the second half, the amount they can withdraw decreases linearly from 50% to 0%. Users can only withdraw once during the withdrawal phase.
After the deposit phase is over, each user gets the token in proportion to how much of the native denom they put in (claims need to be enabled first.)
Ado_type: lockdrop
Version: 2.0.1-beta.1
InstantiateMsg
Withdrawal window should be greater than 0.
Deposit window should be greater than 0.
Withdrawal window should be less than deposit window.
Name | Type | Description |
---|---|---|
| Timestamp in milliseconds till when deposits can be made. | |
| Number of milliseconds for which lockup deposits will be accepted. | |
| Number of milliseconds for which lockup withdrawals will be allowed. Cannot exceed the | |
| The CW20 token being given as incentive. | |
| String | The native token being deposited. |
| String | Contract address of the kernel contract to be used for AMP messaging. Kernel contract address can be found in our deployed contracts. |
| Option<String> | Optional address to specify as the owner of the ADO being created. Defaults to the sender if not specified. |
ExecuteMsg
Receive
Receives CW20 tokens that will be used as incentive for the lockdrop.
The sender needs to be the CW20 contract of the incentive token (Same as the one specified in instantiation).
Needs to be sent before the withdrawal period.
Cw20ReceiveMsg
The msg
in Cw20ReceiveMsg
should be a Cw20HookMsg
of type IncreaseIncentives
IncreaseIstncentives
DepositNative
Deposit native fund in the contract in exchange for receiving a proportion of the Cw-20 incentive tokens.
Deposit window should be open.
A single type of native coins should be attached with the same denom specified in the instantiation by native_denom
.
WithdrawNative
Withdraw native funds from the lockup position.
Withdrawal window needs to be open.
The amount should not exceed the maximum withdrawal allowed.
Name | Type | Description |
---|---|---|
| Option<Uint128> | The amount of native funds to withdraw. |
EnableClaims
EnableClaims
can be called by anyone after the deposit and withdrawing phases have ended.
ClaimRewards
Claims the CW20 incentive tokens from the lockdrop.
Base Executes
The rest of the execute messages can be found in the ADO Base section.
QueryMsg
Config
Queries the config of the contract.
ConfigResponse
lockdrop_incentives
is the total amount of lockdrop incentive tokens (Cw20 tokens) to be distributed among the users.
The rest of the field definitions are the same as the one in the InstantiateMsg.
State
Queries the current state of the contract.
StateResponse
Name | Type | Description |
---|---|---|
| Uint128 | Total native coins deposited at the end of Lockdrop window. This value remains unchanged post the lockdrop window. |
| bool | Boolean value indicating if the user can withdraw their token rewards or not. |
UserInfo
Gets information for the user with the address
specified.
Name | Type | Description |
---|---|---|
| String | The user address to get the info for. |
UserInfoResponse
Name | Type | Description |
---|---|---|
| Uint128 | Total UST amount deposited by the user across all his lockup positions. |
| Uint128 | The total amount of incentive tokens for the user. |
| bool | Whether the lockdrop tokens have been claimed by the user or not. |
| bool | Whether or not the user has withdrawn during the withdrawal phase. |
WithdrawalPercentAllowed
Returns the max withdrawable percent for a position.
The provided timestamp cannot be in the past.
Name | Type | Description |
---|---|---|
| Option<u64> | The timestamp in milliseconds to check the maximum withdrawal allowed for. If not specified, the current timestamp will be used. |
Returns a number of type Decimal representing the percentage allowed to withdraw.
Base Queries
The rest of the query messages can be found in the ADO Base section.