Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
FloppyDisck committed Jan 15, 2022
1 parent c5f5bfb commit 479f7c0
Showing 1 changed file with 43 additions and 7 deletions.
50 changes: 43 additions & 7 deletions contracts/airdrop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
* Messages
* [CreateAccount](#CreateAccount)
* [UpdateAccount](#UpdateAccount)
* [DisablePermitKey](#DisablePermitKey)
* [Claim](#Claim)
* Queries
* [GetConfig](#GetConfig)
* [GetDates](#GetDates)
* [GetAccount](#GetAccount)
* [Config](#Config)
* [Dates](#Dates)
* [TotalClaimed](#TotalClaimed)
* [Account](#Account)

# Introduction
Contract responsible to handle snip20 airdrop
Expand All @@ -42,6 +44,7 @@ Contract responsible to handle snip20 airdrop
|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

Expand All @@ -57,13 +60,15 @@ Updates the given values
|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 |

#### AddTasks
Adds more tasks to complete
##### Request
|Name |Type |Description | optional |
|------|-------|---------------------------|----------|
|Tasks | Tasks | The new tasks to be added | no |
|tasks | Tasks | The new tasks to be added | no |
|padding | string | Allows for enforcing constant length messages | yes |

##### Response
```json
Expand Down Expand Up @@ -96,6 +101,7 @@ 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 |

##### Response
```json
Expand All @@ -117,6 +123,7 @@ Creates an account from which the user will claim all of his given addresses' re
|-----------|----------------------------------|------------------------------------------|----------|
| addresses | Array of [AddressProofPermit](#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 |

##### Response
```json
Expand All @@ -134,6 +141,7 @@ Updates a users accounts with more addresses
|-----------|-----------------------------|------------------------------------------|----------|
| addresses | Array of [AddressProofPermit](#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 |

##### Response
```json
Expand All @@ -144,6 +152,23 @@ Updates a users accounts with more addresses
}
```

### DisablePermitKey
Disables that permit's key. Any permit that has that key for that address will be declined.
##### Request
| Name | Type | Description | optional |
|-----------|-----------------------------|------------------------------------------|----------|
| key | string | Permit key | no |
|padding | string | Allows for enforcing constant length messages | yes |

##### Response
```json
{
"disable_permit_key": {
"status": "success"
}
}
```

#### Claim
Claim the user's available claimable amount

Expand All @@ -169,7 +194,7 @@ Gets the contract's config
}
```

## GetDates
## Dates
Get the contracts airdrop timeframe, can calculate the decay factor if a time is given
##### Request
|Name |Type |Description | optional |
Expand All @@ -186,7 +211,18 @@ Get the contracts airdrop timeframe, can calculate the decay factor if a time is
}
```

## GetAccount
## TotalClaimed
Shows the total amount of the token that has been claimed. If airdrop hasn't ended then it'll just show an estimation.
##### Request
```json
{
"total_claimed": {
"claimed": "Claimed amount"
}
}
```

## Account
Get the account's information
##### Request
|Name |Type |Description | optional |
Expand All @@ -195,7 +231,7 @@ Get the account's information
|current_date | u64 | Current time in UNIT format | yes |
```json
{
"eligibility": {
"account": {
"total": "Total airdrop amount",
"claimed": "Claimed amount",
"unclaimed": "Amount available to claim",
Expand Down

0 comments on commit 479f7c0

Please sign in to comment.