Holder Creating a Token Claim using the Hedgey APIs
Reference: https://github.com/hedgey-finance/DelegatedTokenClaims/blob/master/contracts/DelegatedClaimCampaigns.sol The Hedgey smart contract for token claims.
The token claim contract uses a merkle tree to efficiently manage many thousands of addresses and amounts that can claim.
This merkle tree can be created manually using something like the following library
https://github.com/OpenZeppelin/merkle-tree
Or the Hedgey API can be used, if the API is used a CSV file is uploaded and Hedgey will manage the process of creating the merkle tree and storing the proofs (which are needed for claiming).
Generate a UUID
Each claim is identified by a UUID. You can generate a UUID by calling the following endpoint:
https://api.hedgey.finance/token-claims/uuidThis will return a UUID in the following format:
{
"uuid": "a6a05f79-ea04-4565-9852-285e0520fd1c",
"hex": "0xa6a05f79ea0445659852285e0520fd1c"
}The hex value is used to identify the claim in the smart contract.
Prepare the entry and generate a PUT URL
POST request to https://api.hedgey.finance/token-claims
{
"uuid": "a6a05f79-ea04-4565-9852-285e0520fd1c",
"startDate": {start date},
"endDate": {end date},
"decimals": 18,
"title": "",
"html": "",
"headerImage": "",
"source": ""
}This will return a pre signed URL that can be used to upload the CSV file.
The CSV file should contain a list with two columns: address and amount:
Checks done on CSV:
Duplicate addresses are combined
Addresses are check summed, if there is an invalid address the entire CSV is rejected
Lowercase addresses are accepted
Amounts are in ETH, e.g. to send 1 wETH the value would be 1, to send 0.1 wETH the value would be 0.1
The CSV should be uploaded using PUT to the presigned URL returned in the previous step.
Claim info
GET request to https://api.hedgey.finance/token-claims/info/{uuid} will return the status of the claim
For larger claims (500,000 addresses or more) the generating proofs step may take some time, the progress can be checked by calling the endpoint above.
The root and uuid are needed to create a token claim on the hedgey contract.
Create locked claim
When users claim the tokens will be locked for a period of time, they will be receiving an NFT that gives the ability to unlock the tokens according to the vesting schedule.
Last updated