checkout-batch-flow

Implements and reviews single-transaction checkout batching with canonical ordering and exact payment reconciliation.

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/IagoPrandi/zeroclaw-plugin --skill checkout-batch-flow-iagoprandi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: checkout-batch-flow
Source: https://github.com/IagoPrandi/zeroclaw-plugin/tree/main/.claude/skills/checkout-batch-flow
Command: npx skills add https://github.com/IagoPrandi/zeroclaw-plugin --skill checkout-batch-flow-iagoprandi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Batching multiple on-chain actions (feed, commit, buyRelics, applyRelics, monthly action) into one checkout() transaction risks inconsistent ordering, mismatched payment handling, and divergent behavior versus executing actions individually. This Skill enforces a canonical execution order, deterministic validation, and exact payment reconciliation so the batched flow matches manual sequence semantics. ## Core Features & Use Cases - Canonical Execution Order: Enforces the fixed sequence payFeedCost → commitDaily → buyRelics → applyRelics → monthly action, with phase gates preserved in batch mode. - Deterministic Validation: Standardized revert selectors such as INVALID_PHASE, INSUFFICIENT_PAYMENT, INSUFFICIENT_STOCK, and MONTHLY_RATE_LIMIT for reliable frontend error mapping. - Payment Reconciliation: Requires msg.value >= totalCost and refunds the excess to the sender using a safe pattern, emitting events as if actions ran individually. - Use Case: When editing the checkout(CheckoutParams) contract function or the cart-building UI, use this Skill to verify equivalence between the batched transaction and the manual action sequence, including refund correctness and stock-change reverts. ## Quick Start Review my checkout() contract changes against the canonical batch ordering, validation rules, and payment reconciliation checklist.

Frequently Asked Questions about checkout-batch-flow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I batch multiple smart contract actions into one transaction?▼

Batch actions by executing them in a fixed canonical order inside a single checkout() function: feed cost, daily commit, relic purchase, relic application, then monthly action. Validate all inputs upfront and reconcile msg.value against total cost with a refund of any excess.

How to handle overpayment refunds in Solidity checkout functions?▼

Compute totalCost as feed cost plus relic costs and fees, require msg.value >= totalCost, then refund msg.value - totalCost to the sender using a safe transfer pattern. Emit events as if each action were executed individually.

What revert errors should a batched checkout contract expose?▼

Standardize deterministic selectors: INVALID_PHASE, INVALID_DAY, INVALID_MONTH, INSUFFICIENT_PAYMENT, INSUFFICIENT_STOCK, INSUFFICIENT_SLOTS, INVALID_ARRAY_LENGTH, INVALID_TARGET, and MONTHLY_RATE_LIMIT. These map cleanly to frontend error handling.

Does batched checkout reserve stock for the user?▼

No, there is no stock reservation in the batch flow. If stock changes between the UI quote and transaction execution, the transaction reverts with INSUFFICIENT_STOCK, and slot compatibility checks run before applying relics.

How do I test that a batched transaction matches manual execution?▼

Run equivalence tests comparing state and events from the manual action sequence versus checkout(). Also test insufficient payment reverts, stock-change reverts, deterministic slot-incompatibility reverts, and refund correctness.