Staking Contract

staking.xsat

This contract manages which assets can be used for staking, holds staked assets, and handles unstaking events.

Actions

  • Add a staking token

  • Remove a staking token

  • Set the token's staking disable status

  • Unstake tokens

  • Withdraw tokens that have reached their expiration time

TABLE globalid

scope

staking.xsat

params

  • {uint64_t} staking_id - the latest staking id

  • {uint64_t} release_id - the latest release id

example

{
  "staking_id": 1,
  "release_id": 1
}

TABLE tokens

scope

staking.xsat

params

  • {uint64_t} id - token id

  • {uint64_t} token - whitelist token

  • {bool} disabled_staking - whether to disable staking

example

{
  "id": 1,
  "token": { "sym": "8,BTC", "contract": "btc.xsat" },
  "disabled_staking": false
}

TABLE staking

scope

staker

params

  • {uint64_t} id - staking id

  • {extended_asset} quantity - total number of staking

example

{
  "id": 1,
  "quantity": {"quantity":"1.00000000 BTC", "contract":"btc.xsat"}
}

TABLE releases

scope

staker

params

  • {uint64_t} id - release id

  • {extended_asset} quantity - unpledged quantity

  • {time_point_sec} expiration_time - cancel pledge expiration time

example

{
  "id": 1,
  "quantity": {
      "quantity": "1.00000000 BTC",
      "contract": "btc.xsat"
  },
  "expiration_time": "2024-08-12T08:09:57"
}

ACTION addtoken

  • authority: staking.xsat

Add whitelist token

params

  • {extended_symbol} token - token to add

ACTION deltoken

  • authority: staking.xsat

Delete whitelist token

params

  • {uint64_t} id - token id to be deleted

example

$ cleos push action staking.xsat deltoken '[1]' -p staking.xsat

ACTION setstatus

  • authority: staking.xsat

Set the token’s disabled staking status.

params

  • {uint64_t} id - token id

  • {bool} disabled_staking - whether to disable staking

ACTION release

  • authority: staker

Cancel the pledge and enter the unlocking period.

params

  • {uint64_t} staking_id - staking id

  • {name} staker - staker account

  • {name} validator - the validator account to be pledged to

  • {extended_asset} quantity - unpledged quantity

ACTION withdraw

  • authority: staker

Withdraw expired staking tokens.

params

  • {name} staker - staker account

Last updated