Program Escrow Spend Limit Precedence
Last updated: 16 August 2026
The only Soroban contract in this project is grainhack-escrow
(initialise, fund, publish_root, claim, is_claimed, sweep), and it
has never been deployed. The program-escrow and bounty-escrow surfaces this
page describes — publish_program, lock_program_funds, single_payout,
batch_payout, create_bounty and the rest — have no implementation in any
repository, verified 16 August 2026.
This page is kept as a design record. Do not read it as a description of working software, and do not implement against it without checking what the contract actually exposes. See Payout path — what exists today.
This document clarifies the precedence between the contract-wide global rate limits (RateLimitConfig) and the per-program spend thresholds.
Precedence Resolution
- Per-Program Thresholds: Programs can define a maximum spend threshold via
set_program_spend_threshold. This is strictly enforced during payouts (both single and batch) viaenforce_spend_threshold. If a payout exceeds this limit, it is rejected with aSpendLimitExceedederror. - Global RateLimitConfig: The global
RateLimitConfig(set viaupdate_rate_limit_config) tracks operational parameters likemax_operationsandwindow_size. However, this config is currently not strictly enforced as a blocking limit on payouts (e.g., batch sizes or cumulative payout volumes are not bounded bymax_operationsduring thebatch_payoutexecution).
Conclusion: The per-program threshold is the effective enforced limit for payout amounts. Since the global RateLimitConfig does not enforce hard caps on payout execution (either by batch size or amount), the per-program settings implicitly act as the most restrictive (and only) enforced limits. The per-program spend threshold always overrides the global rate limit.