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:
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.
const campaign = {
id: '0x025f649ea6b44845875be9971b133e1e', // generated uuid as hex generated from the API
contractAddress: '0x923b523B8cA37c5ea7BD990D1A98293495812Be6', // the token claim campaign address (Sepolia)
manager: '0x0C4FAb8d9DBE774708EeC313bf0295278E307bcD', // the wallet address for the token claim manager (can cancel)
token: '0xE13FB676E9bdd7AFda91495eC4e027FC63212FC3', // the token address
amount: '8700000000', // amount of tokens
start: '1719138856', // start date of the campaign in unix time
end: '1712139217', // end date of the campaign in unix time
tokenLockup: 0, // 0 unlocked, 1 locked, 2 vesting
root: tree.root, // the root of the merkle tree generated from the API
delegating: true, // if delegation is possible
}