# 7.2 合约在系统中的职责边界

在该架构中，智能合约承担的职责被严格限定，其目标不是“做得多”，而是“做得不可替代”。

合约的核心职责集中在以下三个方面：

* **规则固化**\
  红包在创建时，其金额、数量、玩法类型与时间约束即被写入合约状态，后续不可更改。
* **状态推进**\
  每一次领取或超时，都会触发明确的状态变化，且状态只允许单向推进。
* **资金结算**\
  所有资金的分配与退回，均由合约直接完成，不经过任何中间账户。

相对地，合约明确不承担交互解析、用户身份识别或策略判断等职责。这些逻辑被刻意留在链下，以避免合约复杂化并扩大攻击面。


---

# 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.2-he-yue-zai-xi-tong-zhong-de-zhi-ze-bian-jie.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.
