harvest

An entrypoint that harvests (claims) user's rewards. Rewards are transferred from the contract to the user and to the referrer (harvest_fee).

Call parameters

type harvest_type       is [@layout:comb] record [
  fid                     : fid_type;
  rewards_receiver        : address;
]
FieldTypeDescription

fid

fid_type (nat)

Farm's ID

rewards_receiver

address

Receiver of earned tokens

Usage

const tFarmAddress = "KT1...";
const params = {
    fid: 1,
    rewards_receiver: "tz1.../KT1...",
};
const tFarm = await tezos.contract.at(tFarmAddress);
const operation = await tFarm.methodsObject.harvest(params).send();

await operation.confirmation();

Errors

  • QSystem/farm-not-set - farming with fid parameter doesn't exist.

  • TFarm/timelock-is-not-finished - timelock after last user's deposit (stake) is not finished.

Last updated