Staking Contract
staking.xsat
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
Quickstart
# addtoken @staking.xsat
$ cleos push action staking.xsat addtoken '[{ "sym": "8,BTC", "contract": "btc.xsat" }]' -p staking.xsat
# deltoken @staking.xsat
$ cleos push action staking.xsat deltoken '[1]' -p staking.xsat
# setstatus @staking.xsat
$ cleos push action staking.xsat setstatus '{"id": 1, "disabled_staking": true}' -p staking.xsat
# staking @staker
$ cleos push action btc.xsat transfer '{"from":"alice","to":"staking.xsat","quantity":"1.00000000 BTC", "memo":"alice"}' -p alice
# release @staker
$ cleos push action staking.xsat release '{"staking_id": 1, "staker": "alice", "validator": "alice", "quantity": "1.00000000 BTC"}' -p alice
# withdraw @staker
$ cleos push action staking.xsat withdraw '{"staker": "alice"}' -p aliceTable Information
TABLE globalid
globalidscope
staking.xsat
params
{uint64_t} staking_id- the latest staking id{uint64_t} release_id- the latest release id
example
TABLE tokens
tokensscope
staking.xsat
params
{uint64_t} id- token id{uint64_t} token- whitelist token{bool} disabled_staking- whether to disable staking
example
TABLE staking
stakingscope staker
stakerparams
{uint64_t} id- staking id{extended_asset} quantity- total number of staking
example
TABLE releases
releasesscope staker
stakerparams
{uint64_t} id- release id{extended_asset} quantity- unpledged quantity{time_point_sec} expiration_time- cancel pledge expiration time
example
ACTION addtoken
addtokenauthority: staking.xsat
Add whitelist token
params
{extended_symbol} token- token to add
example
ACTION deltoken
deltokenauthority: staking.xsat
Delete whitelist token
params
{uint64_t} id- token id to be deleted
example
ACTION setstatus
setstatusauthority: staking.xsat
Set the tokenβs disabled staking status.
params
{uint64_t} id- token id{bool} disabled_staking- whether to disable staking
example
ACTION release
releaseauthority:
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
example
ACTION withdraw
withdrawauthority:
staker
Withdraw expired staking tokens.
params
{name} staker- staker account
example
Last updated