VoteLockCovenant locks governance FTs with an immutable vote choice. The UTXO model eliminates double-voting cryptographically.
Contract path: contracts/core/governance/VoteLockCovenant.cash
Parameters
| Parameter | Type | Description |
|---|---|---|
proposalId | bytes32 | Links vote to specific proposal |
voteChoice | int | 0 = AGAINST, 1 = FOR, 2 = ABSTAIN |
voterHash | bytes20 | hash160(voter pubkey) — only owner can reclaim |
unlockTimestamp | int | When tokens can be reclaimed |
NFT State (32 bytes)
Functions
reclaim(sig voterSig, pubkey voterPubkey)
Returns all locked governance FTs to voter after unlockTimestamp.
earlyReclaim(sig voterSig, pubkey voterPubkey, int proposalFinalStatus)
Returns tokens before unlockTimestamp if the proposal is done. Caller must pass a valid terminal status: 2 (EXECUTED), 3 (CANCELLED), or 4 (EXPIRED).
BCH has no cross-UTXO reads. The voter supplies
proposalFinalStatus as a parameter — the covenant only validates that the value is one of the valid terminal statuses. Off-chain verification of the proposal status is the caller’s responsibility.
