- Introduction
- Sections
- Init
- Admin
- Messages
- Task_Admin
- Messages
- User
- Messages
- Queries
Contract responsible to handle snip20 airdrop
| Name | Type | Description | optional |
|---|---|---|---|
| admin | String | New contract owner; SHOULD be a valid bech32 address | yes |
| dump_address | String | Where the decay amount will be sent | yes |
| airdrop_token | Contract | The token that will be airdropped | no |
| airdrop_amount | String | Total airdrop amount to be claimed | no |
| start_date | u64 | When the airdrop starts in UNIX time | yes |
| end_date | u64 | When the airdrop ends in UNIX time | yes |
| decay_start | u64 | When the airdrop decay starts in UNIX time | yes |
| merkle_root | String | Base 64 encoded merkle root of the airdrop data tree | no |
| total_accounts | u32 | Total accounts in airdrop (needed for merkle proof) | no |
| max_amount | String | Used to limit the user permit amounts (lowers exploit possibility) | no |
| default_claim | String | The default amount to be gifted regardless of tasks | no |
| task_claim | RequiredTasks | The amounts per tasks to gift | no |
| query_rounding | string | To prevent leaking information, total claimed is rounded off to this value | no |
##Admin
Updates the given values
| Name | Type | Description | optional |
|---|---|---|---|
| admin | string | New contract admin; SHOULD be a valid bech32 address | yes |
| dump_address | string | Sets the dump address if there isnt any | yes |
| query_rounding | String | To prevent leaking information | yes |
| start_date | u64 | When the airdrop starts in UNIX time | yes |
| end_date | u64 | When the airdrop ends in UNIX time | yes |
| decay_start | u64 | When the airdrop decay starts in UNIX time | yes |
| padding | string | Allows for enforcing constant length messages | yes |
Adds another task that can unlock the users claim percentage, total task percentage cannot exceed 100%
| Name | Type | Description | optional |
|---|---|---|---|
| address | String | The address that will grant the task to accounts | no |
| percent | string | The percent to be unlocked when completed | no |
| Name | Type | Description | optional |
|---|---|---|---|
| tasks | Tasks | The new tasks to be added | no |
| padding | string | Allows for enforcing constant length messages | yes |
{
"add_tasks": {
"status": "success"
}
}Drains the decayed amount of airdrop into the specified dump_address
{
"claim_decay": {
"status": "success"
}
}##Task Admin
Complete that address' tasks for a given user
| Name | Type | Description | optional |
|---|---|---|---|
| address | String | The address that completed the task | no |
| padding | string | Allows for enforcing constant length messages | yes |
{
"complete_task": {
"status": "success"
}
}##User
(Creates / Updates) an account from which the user will claim all of his given addresses' rewards
| Name | Type | Description | optional |
|---|---|---|---|
| addresses | Array of AddressProofPermit | Proof that the user owns those addresses | no |
| partial_tree | Array of string | An array of nodes that serve as a proof for the addresses | no |
| padding | string | Allows for enforcing constant length messages | yes |
{
"account": {
"status": "success",
"total": "Total airdrop amount",
"claimed": "Claimed amount",
"finished_tasks": "All of the finished tasks",
"addresses": ["claimed addresses"]
}
}Disables that permit's key. Any permit that has that key for that address will be declined.
| Name | Type | Description | optional |
|---|---|---|---|
| key | string | Permit key | no |
| padding | string | Allows for enforcing constant length messages | yes |
{
"disable_permit_key": {
"status": "success"
}
}Sets a viewing key for the account, useful for when the network is congested because of permits.
| Name | Type | Description | optional |
|---|---|---|---|
| key | string | Viewing key | no |
| padding | string | Allows for enforcing constant length messages | yes |
{
"set_viewing_key": {
"status": "success"
}
}Claim the user's available claimable amount
{
"claim": {
"status": "success",
"total": "Total airdrop amount",
"claimed": "Claimed amount",
"finished_tasks": "All of the finished tasks",
"addresses": ["claimed addresses"]
}
}Gets the contract's config
{
"config": {
"config": "Contract's config"
}
}Get the contracts airdrop timeframe, can calculate the decay factor if a time is given
| Name | Type | Description | optional |
|---|---|---|---|
| current_date | u64 | The current time in UNIX format | yes |
{
"dates": {
"start": "Airdrop start",
"end": "Airdrop end",
"decay_start": "Airdrop start of decay",
"decay_factor": "Decay percentage"
}
}Shows the total amount of the token that has been claimed. If airdrop hasn't ended then it'll just show an estimation.
{
"total_claimed": {
"claimed": "Claimed amount"
}
}Get the account's information
| Name | Type | Description | optional |
|---|---|---|---|
| permit | AccountProofPermit | Address's permit | no |
| current_date | u64 | Current time in UNIT format | yes |
{
"account": {
"total": "Total airdrop amount",
"claimed": "Claimed amount",
"unclaimed": "Amount available to claim",
"finished_tasks": "All of the finished tasks",
"addresses": ["claimed addresses"]
}
}Get the account's information using a viewing key
| Name | Type | Description | optional |
|---|---|---|---|
| account | String | Accounts address | yes |
| key | String | Address's viewing key | no |
| current_date | u64 | Current time in UNIT format | yes |
{
"account_with_key": {
"total": "Total airdrop amount",
"claimed": "Claimed amount",
"unclaimed": "Amount available to claim",
"finished_tasks": "All of the finished tasks",
"addresses": ["claimed addresses"]
}
}This is a structure used to prove that the user has permission to query that address's information (when querying account info). This is also used to prove that the user owns that address (when creating/updating accounts) and the given amount is in the airdrop. This permit is written differently from the rest since its made taking into consideration many of Terra's limitations compared to Keplr's flexibility.
NOTE: The parameters must be in order
| Name | Type | Description | optional |
|---|---|---|---|
| params | FillerMsg | Filler params accounting for Terra Ledgers limitations | no |
| memo | String | Base64Encoded AddressProofMsg | no |
| chain_id | String | Chain ID of the network this proof will be used in | no |
| signature | PermitSignature | Signature of the permit | no |
{
"coins": [],
"contract": "",
"execute_msg": "",
"sender": ""
}The information inside permits that validate the airdrop eligibility and validate the account holder's key.
NOTE: The parameters must be in order
| Name | Type | Description | optional |
|---|---|---|---|
| address | String | Address of the signer (might be redundant) | no |
| amount | String | Airdrop amount | no |
| contract | String | Airdrop contract | no |
| index | Integer | Index of airdrop data in reference to the original tree | no |
| key | String | Some permit key | no |
The information inside permits that validate account ownership
NOTE: The parameters must be in order
| Name | Type | Description | optional |
|---|---|---|---|
| contract | String | Airdrop contract | no |
| key | String | Some permit key | no |
The signature that proves the validity of the data
NOTE: The parameters must be in order
| Name | Type | Description | optional |
|---|---|---|---|
| pub_key | pubkey | Signer's public key | no |
| signature | String | Base 64 encoded signature | no |
Public key
NOTE: The parameters must be in order
| Name | Type | Description | optional |
|---|---|---|---|
| type | String | Must be tendermint/PubKeySecp256k1 | no |
| value | String | The base 64 key | no |