Validator Management Contract

endrmng.xsat

This contract manages staking and rewards claiming operations for Validators and Stakers.

Actions

  • Add evm proxy account

  • Delete evm proxy account

  • Add whitelist (proxyreg or evmcaller)

  • Delete whitelist (proxyreg or evmcaller)

  • Staking, unstaking, changing staking, and claiming rewards on native chains and EVM

  • Validator claiming rewards

  • Batch allocation of validator rewards from rwddist.xsat

TABLE globalid

scope

endrmng.xsat

params

  • {uint64_t} staking_id - the latest staking id

example

{
  "staking_id": 1
}

TABLE config

scope

endrmng.xsat

params

  • {string} donation_account - the account designated for receiving donations

example

{
  "donation_account": "donate.xsat"
}

TABLE whitelist

scope

proxyreg or evmcaller

params

  • {name} account - whitelist account

example

{
  "account": "alice"
}

TABLE evmproxies

scope

whitelist of evmcaller

params

  • {uint64_t} id - evm proxy id

  • {checksum160} proxy - evm proxy account

example

{
  "id": 1,
  "proxy": "bb776ae86d5996908af46482f24be8ccde2d4c41"
}

TABLE creditproxy

scope

The account whose scope is evmcaller in the whitelist table

params

  • {uint64_t} id - evm proxy id

  • {checksum160} proxy - evm proxy account

example

{
  "id": 1,
  "proxy": "bb776ae86d5996908af46482f24be8ccde2d4c41"
}

TABLE evmstakers

scope

endrmng.xsat

params

  • {uint64_t} id - evm staker id

  • {checksum160} proxy - proxy account

  • {checksum160} staker - staker account

  • {name} validator - validator account

  • {asset} quantity - total number of staking

  • {asset} xsat_quantity - the amount of XSAT tokens staked

  • {asset} total_donated - the total amount of XSAT that has been donated

  • {uint64_t} stake_debt - amount of requested stake debt

  • {asset} staking_reward_unclaimed - amount of stake unclaimed rewards

  • {asset} staking_reward_claimed - amount of stake claimed rewards

  • {uint64_t} consensus_debt - amount of requested consensus debt

  • {asset} consensus_reward_unclaimed - amount of consensus unclaimed rewards

  • {asset} consensus_reward_claimed - amount of consensus claimed rewards

example

{
  "id": 4,
  "proxy": "bb776ae86d5996908af46482f24be8ccde2d4c41",
  "staker": "e4d68a77714d9d388d8233bee18d578559950cf5",
  "validator": "alice",
  "quantity": "0.10000000 BTC",
  "xsat_quantity": "0.10000000 XSAT",
  "total_donated": "1.00000000 XSAT",
  "stake_debt": 1385452,
  "staking_reward_unclaimed": "0.00000000 XSAT",
  "staking_reward_claimed": "0.00000000 XSAT",
  "consensus_debt": 173181,
  "consensus_reward_unclaimed": "0.00000000 XSAT",
  "consensus_reward_claimed": "0.00000000 XSAT"
}

TABLE stakers

scope

endrmng.xsat

params

  • {uint64_t} id - staker id

  • {name} staker - staker account

  • {name} validator - validator account

  • {asset} quantity - total number of staking

  • {asset} xsat_quantity - the amount of XSAT tokens staked

  • {asset} total_donated - the total amount of XSAT that has been donated

  • {uint64_t} stake_debt - amount of requested stake debt

  • {asset} staking_reward_unclaimed - amount of stake unclaimed rewards

  • {asset} staking_reward_claimed - amount of stake claimed rewards

  • {uint64_t} consensus_debt - amount of requested consensus debt

  • {asset} consensus_reward_unclaimed - amount of consensus unclaimed rewards

  • {asset} consensus_reward_claimed - amount of consensus claimed rewards

example

{
  "id": 2,
  "staker": "alice",
  "validator": "alice",
  "quantity": "0.10000000 BTC",
  "xsat_quantity": "0.10000000 XSAT",
  "total_donated": "1.00000000 XSAT",
  "stake_debt": 1385452,
  "staking_reward_unclaimed": "0.00000000 XSAT",
  "staking_reward_claimed": "0.00000000 XSAT",
  "consensus_debt": 173181,
  "consensus_reward_unclaimed": "0.00000000 XSAT",
  "consensus_reward_claimed": "0.00000000 XSAT"
}

TABLE validators

scope

endrmng.xsat

params

  • {name} owner - staker id

  • {name} reward_recipient - receiving account for receiving rewards

  • {string} memo - memo when receiving reward transfer

  • {uint16_t} commission_rate - commission ratio, decimal is 10^4

  • {asset} quantity - the amount of BTC staked by the validator

  • {asset} qualification - the qualification of the validator

  • {asset} xsat_quantity - the amount of XSAT tokens staked by the validator

  • {uint16_t} donate_rate - the donation rate, represented as a percentage, ex: 500 means 5.00%

  • {asset} total_donated - the total amount of XSAT that has been donated

  • {uint128_t} stake_acc_per_share - staking rewards earnings per share

  • {uint128_t} consensus_acc_per_share - consensus reward earnings per share

  • {asset} staking_reward_unclaimed - unclaimed staking rewards

  • {asset} staking_reward_claimed - amount of stake claimed rewards

  • {asset} consensus_reward_unclaimed - amount of consensus unclaimed rewards

  • {asset} consensus_reward_claimed - amount of consensus claimed rewards

  • {asset} total_consensus_reward - total consensus rewards

  • {asset} consensus_reward_balance - consensus reward balance

  • {asset} total_staking_reward - total staking rewards

  • {asset} staking_reward_balance - staking reward balance

  • {time_point_sec} latest_staking_time - latest staking or unstaking time

  • {uint64_t} latest_reward_block - latest reward block

  • {time_point_sec} latest_reward_time - latest reward time

  • {bool} disabled_staking - whether to disable staking

example

{
  "owner": "alice",
  "reward_recipient": "erc2o.xsat",
  "memo": "0x5EB954fB68159e0b7950936C6e1947615b75C895",
  "commission_rate": 0,
  "quantity": "102.10000000 BTC",
  "qualification": "102.10000000 BTC",
  "xsat_quantity": "1000.10000000 XSAT",
  "donate_rate": 100,
  "total_donated": "100.00000000 XSAT",
  "stake_acc_per_share": "39564978",
  "consensus_acc_per_share": "4945621",
  "staking_reward_unclaimed": "0.00000000 XSAT",
  "staking_reward_claimed": "0.00000000 XSAT",
  "consensus_reward_unclaimed": "0.00000000 XSAT",
  "consensus_reward_claimed": "0.00000000 XSAT",
  "total_consensus_reward": "5.04700642 XSAT",
  "consensus_reward_balance": "5.04700642 XSAT",
  "total_staking_reward": "40.37605144 XSAT",
  "staking_reward_balance": "40.37605144 XSAT",
  "latest_staking_time": "2024-07-13T09:16:26",
  "latest_reward_block": 840001,
  "latest_reward_time": "2024-07-13T14:29:32",
  "disabled_staking": 0
 }

TABLE stat

scope

endrmng.xsat

params

  • {asset} total_staking - btc total staking amount

  • {asset} xsat_total_staking - the total amount of XSAT staked

  • {asset} xsat_total_donated - the cumulative amount of XSAT donated

example

{
  "total_staking": "100.40000000 BTC",
  "xsat_total_staking": "100.40000000 XSAT",
  "xsat_total_donated": "100.40000000 XSAT"
}

ACTION setdonateacc

  • authority: endrmng.xsat

Update donation account.

params

  • {string} donation_account - account to receive donations

ACTION addwhitelist

  • authority: endrmng.xsat

Add whitelist account

params

  • {name} type - whitelist type @see WHITELIST_TYPES

  • {name} account - whitelist account

ACTION delwhitelist

  • authority: endrmng.xsat

Delete whitelist account

params

  • {name} type - whitelist type @see WHITELIST_TYPES

  • {name} account - whitelist account

ACTION addevmproxy

  • authority: endrmng.xsat

Add evm proxy account

params

  • {name} caller - caller account

  • {checksum160} proxy - proxy account

ACTION delevmproxy

  • authority: endrmng.xsat

Delete evm proxy account

params

  • {name} caller - caller account

  • {checksum160} proxy - proxy account

ACTION addcrdtproxy

  • authority: endrmng.xsat

Add credit proxy account

params

  • {checksum160} proxy - proxy account

ACTION delcrdtproxy

  • authority: endrmng.xsat

Delete credit proxy account

params

  • {checksum160} proxy - proxy account

ACTION setstatus

  • authority: endrmng.xsat

Set validator staking status

params

  • {name} validator - validator account

  • {bool} disabled_staking - whether to disable staking

ACTION regvalidator

  • authority: validator

Registering a validator

params

  • {name} validator - validator account

  • {name} financial_account - financial accounts

  • {uint16_t} commission_rate - commission ratio, decimal is 10^4

ACTION proxyreg

  • authority: proxy

Proxy account registration validator

params

  • {name} proxy - proxy account

  • {name} validator - validator account

  • {string} financial_account - financial accounts

  • {uint16_t} commission_rate - commission ratio, decimal is 10^4

ACTION config

  • authority: validator

Validator sets commission ratio and financial account

params

  • {name} validator - validator account

  • {optional<uint16_t>} commission_rate - commission ratio, decimal is 10^4

  • {optional<string>} financial_account - financial accounts

ACTION setdonate

  • authority: validator

Configure donate rate.

params

  • {name} validator - synchronizer account

  • {uint16_t} donate_rate - the donation rate, represented as a percentage, ex: 500 means 5.00%

ACTION stake

  • authority: staking.xsat

Staking BTC to validator

params

  • {name} staker - staker account

  • {name} validator - validator account

  • {asset} quantity - staking amount

ACTION unstake

  • authority: staking.xsat

Unstaking BTC from a validator

params

  • {name} staker - staker account

  • {name} validator - validator account

  • {asset} quantity - cancel staking amount

ACTION newstake

  • authority: staker

Staking BTC to a new validator

params

  • {name} staker - staker account

  • {name} old_validator - old validator account

  • {name} new_validator - new validator account

  • {asset} quantity - the amount of stake transferred to the new validator

ACTION claim

  • authority: staker

Claim staking rewards

params

  • {name} staker - staker account

  • {name} validator - validator account

ACTION evmstake

  • authority: caller

Staking BTC to validator via evm

params

  • {name} caller - caller account

  • {checksum160} proxy - evm proxy account

  • {checksum160} staker - evm staker account

  • {name} validator - validator account

  • {asset} quantity - staking amount

ACTION evmunstake

  • authority: caller

Unstake BTC from validator via evm

params

  • {name} caller - caller account

  • {checksum160} proxy - evm proxy account

  • {checksum160} staker - evm staker account

  • {name} validator - validator account

  • {asset} quantity - staking amount

ACTION evmnewstake

  • authority: caller

Staking BTC to a new validator via evm

params

  • {name} caller - caller account

  • {checksum160} proxy - evm proxy account

  • {checksum160} staker - evm staker account

  • {name} old_validator - old validator account

  • {name} new_validator - new validator account

  • {asset} quantity - staking amount

ACTION evmclaim

  • authority: caller

Claim staking rewards through evm

params

  • {name} caller - caller account

  • {checksum160} proxy - evm proxy account

  • {checksum160} staker - evm staker account

  • {name} validator - validator account

ACTION evmclaim2

  • authority: caller

Claim staking rewards through evm

params

  • {name} caller - caller account

  • {checksum160} proxy - evm proxy account

  • {checksum160} staker - evm staker account

  • {name} validator - validator account

  • {uint16_t} donate_rate - the donation rate, represented as a percentage, ex: 500 means 5.00%

ACTION vdrclaim

  • authority: validator->reward_recipient or evmutil.xsat

Validator Receive Rewards

params

  • {name} validator - validator account

STRUCT reward_details_row

params

  • {name} validator - validator account

  • {asset} staking_rewards - staking rewards

  • {asset} consensus_rewards - consensus rewards

example

{
  "validator": "alice",
  "staking_rewards": "0.00000010 XSAT",
  "consensus_rewards": "0.00000020 XSAT"
}

ACTION distribute

  • authority: rwddist.xsat

Distributing validator rewards

params

  • {uint64_t} height - validator account

  • {vector<reward_details_row>} rewards - validator account

ACTION stakexsat

  • authority: xsatstk.xsat

Staking XSAT to validator

params

  • {name} staker - staker account

  • {name} validator - validator account

  • {asset} quantity - staking amount

ACTION unstakexsat

  • authority: xsatstk.xsat

Unstaking XSAT from a validator

params

  • {name} staker - staker account

  • {name} validator - validator account

  • {asset} quantity - cancel staking amount

ACTION restakexsat

  • authority: staker

Staking XSAT to a new validator

params

  • {name} staker - staker account

  • {name} old_validator - old validator account

  • {name} new_validator - new validator account

  • {asset} quantity - the amount of stake transferred to the new validator

ACTION evmstakexsat

  • authority: caller

Staking XSAT to validator via evm

params

  • {name} caller - caller account

  • {checksum160} proxy - evm proxy account

  • {checksum160} staker - evm staker account

  • {name} validator - validator account

  • {asset} quantity - staking amount

ACTION evmunstkxsat

  • authority: caller

Unstake XSAT from validator via evm

params

  • {name} caller - caller account

  • {checksum160} proxy - evm proxy account

  • {checksum160} staker - evm staker account

  • {name} validator - validator account

  • {asset} quantity - staking amount

ACTION evmrestkxsat

  • authority: caller

Staking XSAT to a new validator via evm

params

  • {name} caller - caller account

  • {checksum160} proxy - evm proxy account

  • {checksum160} staker - evm staker account

  • {name} old_validator - old validator account

  • {name} new_validator - new validator account

  • {asset} quantity - staking amount

ACTION creditstake

  • authority: custody.xsat

Unstake BTC from validator via credit

params

  • {checksum160} proxy - evm proxy account

  • {checksum160} staker - evm staker account

  • {name} validator - validator account

  • {asset} quantity - staking amount

Last updated