set_fees

An entrypoint that setups fee for the specified farm. Also can setup fees for a group of farms in one transaction.

Call parameters

type fees_type          is [@layout:comb] record [
  harvest_fee             : nat;
  withdrawal_fee          : nat;
  burn_reward             : nat;
]

type set_fee_type       is [@layout:comb] record [
  fid                     : fid_type;
  fees                    : fees_type;
]

type set_fees_type      is list(set_fee_type)

fees_type

set_fee_type

Usage

const farmId = 1;
const harvestFee = 0.05 * 10 ** 16; // 0.05%
const withdrawalFee = 0.25 * 10 ** 16; // 0.25%
const burnReward = 3 * 10 ** 16; // 3%
const qFarmAddress = "KT1...";
const fees = [
    {
        fid: farmId,
        fees: {
            harvest_fee: harvestFee,
            withdrawal_fee: withdrawalFee,
            burn_reward: burnReward,
        },
    },
    ...
];
const qFarm = await tezos.contract.at(qFarmAddress);
const operation = await qFarm.methods.set_fees(fees).send();

await operation.confirmation();

Errors

  • Not-admin - sender of the transaction is not current administrator.

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

Last updated