Storage and types overview

user_reward_info_t

FieldTypeHintDescription

reward_f

nat

Float value multiplied by 1e+18

Reward that must be paid to a user

reward_paid_f

nat

Float value multiplied by 1e+18

Reward that is already paid to a user

type user_reward_info_t is [@layout:comb] record [
  reward_f                : nat;
  reward_paid_f           : nat;
]

baker_t

FieldTypeDescription

ban_start_time

timestamp

Start timestamp of baker's banning period

ban_period

nat

Banning period duration (in seconds)

votes

nat

Amount of votes delegated to baker by all users

type baker_t            is [@layout:comb] record [
  ban_start_time          : timestamp;
  ban_period              : nat;
  votes                   : nat;
]

user_t

FieldTypeDescription

candidate

option(key_hash)

Baker candidate of a user

votes

nat

Amount of votes delegated to the user's candidate

type user_t             is [@layout:comb] record [
  candidate               : option(key_hash);
  votes                   : nat;
]

storage_t - main contract storage

FieldTypeDescription

users

big_map(address, user_t)

Mapping of users' addresses to theirs info

bakers

big_map(key_hash, baker_t)

Mapping of bakers' addresses to theirs info

users_rewards

big_map(address, user_reward_info_t)

Mapping of users' addresses to theirs reward info

previous_delegated

key_hash

Previous delegate

current_delegated

key_hash

Current delegate

next_candidate

key_hash

Next possible delegate

baker_registry

address

BakerRegistry contract address

dex_core

address

DexCore contract address

pair_id

token_id_t

Pair ID on DexCore contract to which the current contract is linked

next_reward

nat

Accumulator for bakers' rewards that will be distributed between all voters

total_reward

nat

Total rewards that will be distributed among all voters

reward_paid

nat

Amount of paid to users bakers' rewards

reward_per_share

nat

Accumulator for reward per 1 staked token's unit

reward_per_block

nat

Reward per 1 block

last_update_level

nat

Level when a rewards were updated last time

collecting_period_end

nat

Level when rewards will be collected and distributed among all voters

type storage_t          is [@layout:comb] record [
  users                   : big_map(address, user_t);
  bakers                  : big_map(key_hash, baker_t);
  users_rewards           : big_map(address, user_reward_info_t);
  previous_delegated      : key_hash;
  current_delegated       : key_hash;
  next_candidate          : key_hash;
  baker_registry          : address;
  dex_core                : address;
  pair_id                 : token_id_t;
  next_reward             : nat;
  total_reward            : nat;
  reward_paid             : nat;
  reward_per_share        : nat;
  reward_per_block        : nat;
  last_update_level       : nat;
  collecting_period_end   : nat;
]

Last updated