stacking-lottery
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStacking Lottery Skill
Stacking Lottery Skill
Provides stacking lottery pot operations on stackspot.app:
- Pot Discovery — List all known pot contracts with their current value and lock status.
- Pot State — Query full on-chain state for a pot: value, participant count, lock status, config, pool config, and details.
- Join Pot — Contribute STX to a pot before it fills and starts stacking.
- Start Pot — Trigger a full pot to begin stacking through the platform contract.
- Claim Rewards — Claim sBTC rewards if your address was selected as the VRF winner.
- Cancel Pot — Cancel a pot before it starts and recover contributed STX.
How it works: Participants join pots by contributing STX. When a pot reaches its maximum participant count, the platform contract triggers stacking via Proof of Transfer (PoX) for one full cycle. At unlock, a VRF-selected winner receives the stacking yield in sBTC. All participants (winner included) receive their original STX back.
All stacking lottery operations are mainnet-only. Write operations (join-pot, start-pot, claim-rewards, cancel-pot) require an unlocked wallet (use first).
bun run wallet/wallet.ts unlock在stackspot.app上提供堆叠抽奖池操作:
- 发现抽奖池 — 列出所有已知的抽奖池合约及其当前价值和锁定状态。
- 抽奖池状态 — 查询某个抽奖池的完整链上状态:价值、参与者数量、锁定状态、配置、池配置及详细信息。
- 加入抽奖池 — 在抽奖池填满并开始堆叠前,向池中存入STX。
- 启动抽奖池 — 触发已填满的抽奖池通过平台合约开始堆叠。
- 领取奖励 — 如果你的地址被VRF选中为赢家,领取sBTC奖励。
- 取消抽奖池 — 在抽奖池开始前取消,并取回存入的STX。
工作原理: 参与者通过存入STX加入抽奖池。当抽奖池达到最大参与者数量时,平台合约会通过Proof of Transfer (PoX)触发完整周期的堆叠。解锁时,由VRF选出的赢家将获得以sBTC形式发放的堆叠收益。所有参与者(包括赢家)都能取回自己存入的原始STX。
所有堆叠抽奖操作仅支持主网。写入操作(join-pot、start-pot、claim-rewards、cancel-pot)需要解锁钱包(先使用)。
bun run wallet/wallet.ts unlockUsage
使用方法
bun run stacking-lottery/stacking-lottery.ts <subcommand> [options]bun run stacking-lottery/stacking-lottery.ts <子命令> [选项]Subcommands
子命令
list-pots
list-pots
List all known stacking lottery pot contracts with their current on-chain value and lock status.
bun run stacking-lottery/stacking-lottery.ts list-potsOutput:
json
{
"network": "mainnet",
"potCount": 3,
"pots": [
{
"name": "Genesis",
"contract": "SPT4SQP5RC1BFAJEQKBHZMXQ8NQ7G118F335BD85.Genesis",
"maxParticipants": 2,
"minAmountStx": 20,
"currentValueUstx": "40000000",
"isLocked": false
}
]
}列出所有已知的堆叠抽奖池合约及其当前链上价值和锁定状态。
bun run stacking-lottery/stacking-lottery.ts list-pots输出:
json
{
"network": "mainnet",
"potCount": 3,
"pots": [
{
"name": "Genesis",
"contract": "SPT4SQP5RC1BFAJEQKBHZMXQ8NQ7G118F335BD85.Genesis",
"maxParticipants": 2,
"minAmountStx": 20,
"currentValueUstx": "40000000",
"isLocked": false
}
]
}get-pot-state
get-pot-state
Get the full on-chain state for a specific pot. Queries all read-only functions: value, participant count, lock status, configuration, pool config, and details.
bun run stacking-lottery/stacking-lottery.ts get-pot-state --contract-name <name>Options:
- (required) — Pot contract name or full identifier (e.g.,
--contract-nameorSPT4SQP5RC1BFAJEQKBHZMXQ8NQ7G118F335BD85.STXLFG)STXLFG
查询特定抽奖池的完整链上状态。调用所有只读函数:价值、参与者数量、锁定状态、配置、池配置及详细信息。
bun run stacking-lottery/stacking-lottery.ts get-pot-state --contract-name <名称>选项:
- (必填)— 抽奖池合约名称或完整标识符(例如:
--contract-name或SPT4SQP5RC1BFAJEQKBHZMXQ8NQ7G118F335BD85.STXLFG)STXLFG
join-pot
join-pot
Contribute STX to a pot. The amount must be at least the pot's minimum. STX is locked in the contract until the pot completes its stacking cycle and all participants can withdraw. Requires an unlocked wallet.
bun run stacking-lottery/stacking-lottery.ts join-pot --contract-name <name> --amount <microStx>Options:
- (required) — Pot contract name (e.g.,
--contract-name)STXLFG - (required) — Amount to contribute in micro-STX (1 STX = 1,000,000 micro-STX)
--amount
向抽奖池存入STX。存入金额必须不低于抽奖池的最低要求。STX会被锁定在合约中,直到抽奖池完成堆叠周期,所有参与者才能取回。需要解锁钱包。
bun run stacking-lottery/stacking-lottery.ts join-pot --contract-name <名称> --amount <微STX>选项:
- (必填)— 抽奖池合约名称(例如:
--contract-name)STXLFG - (必填)— 存入金额,单位为微STX(1 STX = 1,000,000 微STX)
--amount
start-pot
start-pot
Trigger a full pot to begin stacking. Calls the platform contract which starts the PoX stacking cycle for the pot. The pot must have reached its maximum participant count. Requires an unlocked wallet.
bun run stacking-lottery/stacking-lottery.ts start-pot --contract-name <name>Options:
- (required) — Pot contract name to start stacking
--contract-name
触发已填满的抽奖池开始堆叠。调用平台合约,为该抽奖池启动PoX堆叠周期。抽奖池必须已达到最大参与者数量。需要解锁钱包。
bun run stacking-lottery/stacking-lottery.ts start-pot --contract-name <名称>选项:
- (必填)— 要启动堆叠的抽奖池合约名称
--contract-name
claim-rewards
claim-rewards
Claim sBTC rewards if the active wallet was selected as the VRF winner for a completed pot. Non-winners receive no sBTC but do get their STX back via the same mechanism. Requires an unlocked wallet.
bun run stacking-lottery/stacking-lottery.ts claim-rewards --contract-name <name>Options:
- (required) — Pot contract name to claim rewards from
--contract-name
如果当前激活的钱包被选为某个已完成抽奖池的VRF赢家,领取sBTC奖励。非赢家不会获得sBTC,但可通过相同机制取回自己的STX。需要解锁钱包。
bun run stacking-lottery/stacking-lottery.ts claim-rewards --contract-name <名称>选项:
- (必填)— 要领取奖励的抽奖池合约名称
--contract-name
cancel-pot
cancel-pot
Cancel a pot before it starts stacking. Allows participants to recover their contributed STX. The pot must not yet be locked (stacking must not have started). Requires an unlocked wallet.
bun run stacking-lottery/stacking-lottery.ts cancel-pot --contract-name <name>Options:
- (required) — Pot contract name to cancel
--contract-name
在抽奖池开始堆叠前取消它。允许参与者取回存入的STX。抽奖池必须尚未锁定(即堆叠尚未开始)。需要解锁钱包。
bun run stacking-lottery/stacking-lottery.ts cancel-pot --contract-name <名称>选项:
- (必填)— 要取消的抽奖池合约名称
--contract-name
Notes
注意事项
- All stacking lottery operations are mainnet-only. Calls on testnet will return an error.
- Write operations require an unlocked wallet (use first).
bun run wallet/wallet.ts unlock - STX lock-up: When you join a pot, your STX is locked for one full PoX stacking cycle (~2 weeks). Do not join a pot with STX you need access to in the short term.
- VRF winner selection: One participant is chosen randomly at unlock. The winner receives all stacking yield in sBTC. All participants (including the winner) receive their original STX back.
- Timing windows: Pots can only be started during the prepare phase of a PoX cycle. If start-pot fails, check the current PoX cycle phase using .
bun run stacking/stacking.ts get-pox-info - Contract architecture: Individual pot contracts are deployed by . The platform contract
SPT4SQP5RC1BFAJEQKBHZMXQ8NQ7G118F335BD85orchestrates starting pots and distributing rewards.SP7FSE31MWSJJFTQBEQ1TT6TF3G4J6GDKE81SWD9.stackspots - Known pots: Genesis (max 2 participants, min 20 STX), BuildOnBitcoin (max 10, min 100 STX), STXLFG (max 100, min 21 STX).
- 所有堆叠抽奖操作仅支持主网。在测试网调用会返回错误。
- 写入操作需要解锁钱包(先使用)。
bun run wallet/wallet.ts unlock - STX锁定: 当你加入抽奖池后,你的STX会被锁定一个完整的PoX堆叠周期(约2周)。请勿使用短期内需要取用的STX加入抽奖池。
- VRF赢家选择: 解锁时会随机选出一名参与者作为赢家。赢家将获得所有堆叠收益(以sBTC形式)。所有参与者(包括赢家)都能取回自己存入的原始STX。
- 时间窗口: 只能在PoX周期的准备阶段启动抽奖池。如果start-pot命令失败,请使用检查当前PoX周期的阶段。
bun run stacking/stacking.ts get-pox-info - 合约架构: 单个抽奖池合约由部署。平台合约
SPT4SQP5RC1BFAJEQKBHZMXQ8NQ7G118F335BD85负责协调抽奖池启动和奖励分发。SP7FSE31MWSJJFTQBEQ1TT6TF3G4J6GDKE81SWD9.stackspots - 已知抽奖池: Genesis(最多2名参与者,最低20 STX)、BuildOnBitcoin(最多10名,最低100 STX)、STXLFG(最多100名,最低21 STX)。