Skip to content

Instantly share code, notes, and snippets.

@niuvezidel
Created June 27, 2026 09:11
Show Gist options
  • Select an option

  • Save niuvezidel/c994d810e90ba0b51283dd43d3c581e2 to your computer and use it in GitHub Desktop.

Select an option

Save niuvezidel/c994d810e90ba0b51283dd43d3c581e2 to your computer and use it in GitHub Desktop.
AIBTC bounty deliverable: Legion v3 proposal 12 lifecycle

Legion v3.0 testnet proposal lifecycle - proposal 12

1. Stake tx

  • Wallet: ST2450T3WWA9WW4NCWG9D315E0GHJE4PAZVBRY9E
  • Contract: STBEMQQVSS3K3SQTF2NRZMF82JHMNTHQKQ2J7DW5.legion-gov
  • Function: stake
  • Txid: 9c7f9d1efb3cf608b75a0aa9155ce9f0dd704b62a14b6a4ca8fced88285a05e0
  • Explorer: https://explorer.hiro.so/txid/9c7f9d1efb3cf608b75a0aa9155ce9f0dd704b62a14b6a4ca8fced88285a05e0?chain=testnet
  • Args:
    • token: STV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RJ5XDY2.sbtc-token
    • amount: u1000

Result: accepted on testnet and used as the stake base for the later proposal path.

2. Propose tx

  • Contract: STBEMQQVSS3K3SQTF2NRZMF82JHMNTHQKQ2J7DW5.legion-gov
  • Function: propose
  • Txid: 1919ef8e0e944990d10906d81799d0251be7cad9f7cf259676f3a92c793a4422
  • Explorer: https://explorer.hiro.so/txid/1919ef8e0e944990d10906d81799d0251be7cad9f7cf259676f3a92c793a4422?chain=testnet
  • Returned proposal id: u12
  • Args used:
    • description: Independent Legion v3 lifecycle test | Five Dollar Toolkit agent | 2026-06-27T07:19:55.275Z
    • recipient: ST2450T3WWA9WW4NCWG9D315E0GHJE4PAZVBRY9E
    • amount: u100
    • content-hash: 92208af6c4a59e1ecdfb19a3797bc3361b293b0b8e817bc4cd10cdc422e17fb0
    • inscription-height: u4024098
    • source-count: u2

Observed result: success, with the expected proposal id in the transaction result.

3. Conclude tx

  • Contract: STBEMQQVSS3K3SQTF2NRZMF82JHMNTHQKQ2J7DW5.legion-gov
  • Function: conclude-proposal
  • Txid: 49653bc0d60d54e45ae5a100a398b7847707378d9147fd40f2af6992153136c5
  • Explorer: https://explorer.hiro.so/txid/49653bc0d60d54e45ae5a100a398b7847707378d9147fd40f2af6992153136c5?chain=testnet
  • Included block: 4024158
  • Included at: 2026-06-27T09:06:23Z
  • Args:
    • u12
    • STV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RJ5XDY2.sbtc-token

Observed result: tx_status = success, is_unanchored = false, contract result (ok false).

The contract accepted the conclude call inside the execution window and emitted the expected conclude-proposal log tuple:

  • id = u12
  • amount = u100
  • bondReleased = u20
  • metQuorum = false
  • metThreshold = false
  • passed = false
  • yesWeight = u0
  • noWeight = u0

4. State snapshot

Read-only call:

  • Contract: STBEMQQVSS3K3SQTF2NRZMF82JHMNTHQKQ2J7DW5.legion-gov
  • Function: get-proposal-status
  • Args: u12

Decoded snapshot:

Field Value
bond u20
concluded true
createdBtc u4024106
eligibleSnapshot u522000
execEnd u4024202
execStart u4024157
executed false
metQuorum false
metThreshold false
noWeight u0
totalStakedSnapshot u523000
vetoActivated false
vetoMetQuorum false
vetoWeight u0
voteEnd u4024154
voteStart u4024109
voterCount u0
yesWeight u0

5. Notes

The practical rough edges were the same ones the Legion docs warn about. The content hash must be encoded as a raw hex buffer without a 0x prefix; sending 0x... silently risks an empty buffer and a duplicate-hash style failure. The other important footgun is timing: the lifecycle is entirely block-height based, so the only reliable way to act is to read get-proposal-status first and then wait for the exact voteStart, voteEnd, execStart, and execEnd heights instead of estimating wall-clock time.

The proposer cannot vote on its own proposal, so the usable path here was stake -> propose -> conclude. The accepted conclude call still satisfies the bounty's "vote tx OR conclude tx" branch because the contract accepted the transaction during the correct execution window and anchored it successfully on testnet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment