Storage and types overview

token_type

type fa12_type          is address

type fa2_type           is [@layout:comb] record [
  token                   : address;
  id                      : token_id_type;
]

type token_type         is
  FA12                    of fa12_type
| FA2                     of fa2_type

fees_type

FieldTypeHintDescription

harvest_fee

nat

Float value multiplied by 1e+16

Fee that applies in time of rewards claiming

withdrawal_fee

nat

Float value multiplied by 1e+16

Fee that applies in time of withdrawing (unstaking) tokens only in farms with timelock. Applies only in case of early withdrawal

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

stake_params_type

FieldTypeDescription

staked_token

FA1.2/FA2 staked token

is_v1_lp

bool

Flag that indicates: QuipuSwap V1 LP token staked or not

w

farm_type

FieldTypeDescription

fees

Fees that applies to the farming

upd

timestamp

Last time of farm's rewards updating

stake_params

Staking parameters

reward_token

FA1.2/FA2 token

timelock

nat

Timelock in seconds (0 for farms without timelock)

current_delegated

key_hash

A baker account TEZ tokens are currently delegated for

next_candidate

key_hash

A best candidate to become current delegated

paused

bool

Flag that indicates: farm is paused or not

reward_per_second

nat

Reward per second

reward_per_share

nat

Accumulator for reward per 1 staked token's unit

staked

nat

Total count of staked tokens in farm

claimed

nat

Total count of claimed tokens

start_time

timestamp

Farm's start time

end_time

timestamp

Farm's end time

fid

fid_type (nat)

Farm's ID

type farm_type          is [@layout:comb] record [
  fees                    : fees_type;
  upd                     : timestamp;
  stake_params            : stake_params_type;
  reward_token            : token_type;
  timelock                : nat;
  current_delegated       : key_hash;
  next_candidate          : key_hash;
  paused                  : bool;
  reward_per_second       : nat;
  reward_per_share        : nat;
  staked                  : nat;
  claimed                 : nat;
  start_time              : timestamp;
  end_time                : timestamp;
  fid                     : fid_type;
]

user_info_type

FieldTypeDescription

last_staked

timestamp

Last time when user staked tokens

staked

nat

Total amount of tokens staked by user

earned

nat

Amount of tokens earned by user

claimed

nat

A mount of tokens claimed by user per all time

prev_earned

nat

Amount of tokens staked by user multiplied by rewards per share

prev_staked

nat

Total amount of tokens staked by user in previous contract call

allowances

set(address)

Set of user's allowances for staked tokens transfer

type user_info_type     is [@layout:comb] record [
  last_staked             : timestamp;
  staked                  : nat;
  earned                  : nat;
  claimed                 : nat;
  prev_earned             : nat;
  prev_staked             : nat;
  allowances              : set(address);
]

baker_type

FieldTypeDescription

period

nat

Period during which baker will be banned (in seconds)

start

timestamp

Ban start time

type baker_type         is [@layout:comb] record [
  period                  : nat;
  start                   : timestamp;
]

tok_meta_type

FieldTypeDescription

token_id

nat

Token ID

token_info

map(string, bytes)

Mapping of token's keys to token's info

type tok_meta_type      is [@layout:comb] record [
  token_id                : nat;
  token_info              : map(string, bytes);
]

storage_type - main contract storage

FieldTypeDescription

farms

big_map(fid_type, farm_type)

Mapping of all farmings on the contract

referrers

big_map(address, address)

Mapping of users' addresses to their referrers' addresses

users_info

big_map((fid_type * address), user_info_type)

Mapping of farms' IDs and users' addresses (in pair) to users' info

votes

big_map((fid_type * key_hash), nat)

Mapping of farms' IDs and bakers' addresses (in pair) to votes for this bakers

candidates

big_map((fid_type * address), key_hash)

Mapping of farms' IDs and users' addresses (in pair) to users' candidates in voting

banned_bakers

big_map(key_hash, baker_type)

Mapping of banned bakers' addresses to their ban info

token_metadata

big_map(fid_type, tok_meta_type)

Mapping of tokens' IDs to tokens' metadata

qsgov

fa2_type

QuipuSwap Governance token info (address and token ID)

qsgov_lp

address

Address of the QUIPU/TEZ LP token on QuipuSwap DEX

admin

address

Administrator of the contract

pending_admin

address

Pending administrator that should accept his new administrator role (if it is possible)

burner

address

Burner contract address

baker_registry

address

BakerRegistry contract address

farms_count

nat

Number of farms created on this contract

type storage_type       is [@layout:comb] record [
  farms                   : big_map(fid_type, farm_type);
  referrers               : big_map(address, address);
  users_info              : big_map((fid_type * address), user_info_type);
  votes                   : big_map((fid_type * key_hash), nat);
  candidates              : big_map((fid_type * address), key_hash);
  banned_bakers           : big_map(key_hash, baker_type);
  token_metadata          : big_map(fid_type, tok_meta_type);
  qsgov                   : fa2_type;
  qsgov_lp                : address;
  admin                   : address;
  pending_admin           : address;
  burner                  : address;
  baker_registry          : address;
  farms_count             : nat;
]

full_storage_type - storage root

FieldTypeDescription

storage

Actual storage of the contract

t_farm_lambdas

big_map(nat, bytes)

Contract's lambda-methods

metadata

big_map(string, bytes)

Contract's metadata according to TZIP-016

type full_storage_type  is [@layout:comb] record [
  storage                 : storage_type;
  t_farm_lambdas          : big_map(nat, bytes);
  metadata                : big_map(string, bytes);
]

Last updated