Skip to main content

create

claim

Description:

Claims rewards from the merkle distributor V2 contract.

Arguments:

NameTypeRequiredDescription
userAddressstringYesThe address of the user initiating the action. This address will become the owner of the reward splitter and must be the vault admin
proofstring[]YesThe Merkle tree proof. Get it from sdk.distributorRewards.getRewards
tokensstring[]YesAn array of addresses of the tokens. Get it from sdk.distributorRewards.getRewards
cumulativeAmountsstring[]YesAn array of cumulative amounts of the tokens. Get it from sdk.distributorRewards.getRewards

Example:

const params = {
userAddress: '0x...',
proof: [
'0x...',
'0x...',
],
tokens: [
'0x...',
'0x...',
],
cumulativeAmounts: [
'1000000000000000000',
'2000000000000000000',
],
}

// Send transaction
const hash = await sdk.distributorRewards.claim(params)
// When you sign transactions on the backend (for custodians)
const { data, to } = await sdk.distributorRewards.claim.encode(params)
// Get an approximate gas per transaction
const gas = await sdk.distributorRewards.claim.estimateGas(params)