GrantCovenant releases funds tranche-by-tranche as milestones are approved by the authority.
Contract path: contracts/core/distribution/GrantCovenant.cash
CashScript version: ^0.13.0
Constructor Parameters (Bytecode-Embedded)
| Parameter | Type | Description |
|---|---|---|
vaultId | bytes32 | Links to source vault |
authorityHash | bytes20 | Controls milestone releases and administration |
milestonesTotal | int | Total number of milestones (1..255) |
amountPerMilestone | int | Amount released per milestone |
totalAmount | int | milestonesTotal × amountPerMilestone |
NFT State (40 bytes)
Transaction Structure
All functions spend covenant state fromtx.inputs[0].
| Function | Required outputs | Notes |
|---|---|---|
releaseMilestone | tx.outputs[0] recipient payout, tx.outputs[1] updated covenant UTXO | Updates milestone counters and last release timestamp. |
pause | tx.outputs[0] updated covenant UTXO | Status ACTIVE -> PAUSED. |
resume | tx.outputs[0] updated covenant UTXO | Status PAUSED -> ACTIVE. |
cancel | tx.outputs[0] authority payout | Consumes campaign UTXO. |
transfer | tx.outputs[0] updated covenant UTXO | Rewrites mutable recipient_hash. |
Functions
releaseMilestone(sig authSig, pubkey authPubkey)
Authority-only tranche release.
Validation
- Authority identity/signature check.
- Status must be
ACTIVE. milestonesCompleted < milestonesTotal.
tx.outputs[0]pays currentrecipient_hashwithamountPerMilestone(BCH or FT mode by flag bit2).tx.outputs[1]must preserve covenant bytecode/token category and commit:milestones_completed + 1total_released + amountPerMilestonelast_release_timestamp = tx.locktimestatus = COMPLETEDafter final milestone, otherwiseACTIVE
pause() / resume() / cancel()
Authority-only admin paths.
Pause / Resume
pauserequiresACTIVEplus cancelable flag bit0.resumerequiresPAUSED.- Both require output
0as covenant continuation output.
- Requires status
ACTIVEorPAUSED, and cancelable flag bit0. - Computes
remainingAmount = totalAmount - totalReleased, requiresremainingAmount > 0. tx.outputs[0]must pay authority with remaining BCH/FT.
transfer(sig recipientSig, pubkey recipientPubkey, bytes20 newRecipientHash)
Recipient-only reassignment of future milestone payouts.
Validation
- Current
recipient_hashmust match signer. - Transferable flag bit1 must be set.
- Status must be
ACTIVE.
tx.outputs[0]must preserve covenant bytecode/token category and keep same state except newrecipient_hash.

