Reward Distribution Contract

rwddist.xsat

This contract mints $XSAT and distributes it to Synchronizers and Validators.

Actions

  • Mint XSAT and distribute it to validators

TABLE rewardlogs

scope height

params

  • {uint64_t} height - block height

  • {checksum256} hash - block hash

  • {asset} synchronizer_rewards - the synchronizer assigns the number of rewards

  • {asset} consensus_rewards - the consensus validator allocates the number of rewards

  • {asset} staking_rewards - the validator assigns the number of rewards

  • {uint32_t} num_validators - the number of validators who pledge more than 100 BTC

  • {std::vector<validator_info> } provider_validators - list of endorsed validators

  • {uint64_t} endorsed_staking - total endorsed staking amount

  • {uint64_t} reached_consensus_staking - the total staking amount to reach consensus is (number of validators * 2/3+ 1 staking amount)

  • {uint32_t} num_validators_assigned - the number of validators that have been allocated rewards

  • {name} synchronizer -synchronizer account

  • {name} miner - miner account

  • {name} parser - parse the account of the block

  • {checksum256} tx_id - tx_id of the reward after distribution

  • {time_point_sec} latest_exec_time - latest reward distribution time

example

{
  "height": 840000,
  "hash": "0000000000000000000320283a032748cef8227873ff4872689bf23f1cda83a5",
  "synchronizer_rewards": "5.00000000 XSAT",
  "consensus_rewards": "5.00000000 XSAT",
  "staking_rewards": "40.00000000 XSAT",
  "num_validators": 2,
  "provider_validators": [{
      "account": "alice",
      "staking": "10010000000"
      },{
      "account": "bob",
      "staking": "10200000000"
      }
  ],
  "endorsed_staking": "20210000000",
  "reached_consensus_staking": "20210000000",
  "num_validators_assigned": 2,
  "synchronizer": "alice",
  "miner": "",
  "parser": "alice",
  "tx_id": "0000000000000000000000000000000000000000000000000000000000000000",
  "latest_exec_time": "2024-07-13T09:06:56"
}

TABLE rewardbal

scope

rwddist.xsat

params

  • {uint64_t} height - block height

  • {asset} synchronizer_rewards_unclaimed - unclaimed synchronizer rewards

  • {asset} consensus_rewards_unclaimed - unclaimed consensus rewards

  • {asset} staking_rewards_unclaimed - unclaimed staking rewards

example

{
  "height": 840000,
  "synchronizer_rewards_unclaimed": "5.00000000 XSAT",
  "consensus_rewards_unclaimed": "5.00000000 XSAT",
  "staking_rewards_unclaimed": "40.00000000 XSAT"
}

STRUCT validator_info

  • {name} account - validator account

  • {uint64_t} staking - the validator's staking amount

example

{
  "account": "test.xsat",
  "staking": "10200000000"
}

ACTION distribute

  • authority: utxomng.xsat

Allocate rewards and record allocation information.

params

  • {uint64_t} height - Block height for allocating rewards

ACTION endtreward

  • authority: utxomng.xsat

Allocate rewards and record allocation information.

params

  • {uint64_t} height - block height

  • {uint32_t} from_index - the starting reward index of provider_validators

  • {uint32_t} to_index - end reward index of provider_validators

Last updated