# 7.3 红包作为链上状态机

为了避免将红包理解为“多次转账的集合”，系统将其抽象为一个**完整的链上状态机**。这一抽象使红包的行为边界得以被清晰描述。

从生命周期角度看，一个红包经历以下阶段：

* **初始化阶段：**&#x5408;约完成参数校验并锁定资金
* **可执行阶段：**&#x5141;许领取操作发生
* **推进阶段：**&#x968F;着领取次数增加，剩余状态逐步变化
* **终止阶段：**&#x91D1;额耗尽或时间到期
* **结算阶段：**&#x5B8C;成最终分配或退款

这一生命周期的关键特征在于：\
**无论外部环境如何变化，红包的最终结果在创建时即已被结构性限定。**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mashanglinghongbao.xyz/7.-zhi-neng-he-yue-zuo-wei-zhi-xing-zhong-shu/7.3-hong-bao-zuo-wei-lian-shang-zhuang-tai-ji.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
