CrowdCell Campaign Lock 约束CrowdCell Campaign Lock Constraints

来源:alesfer001/CrowdCell / contracts/campaign-lock/src/main.rs@2fd13f6 · 0xb6e2…01bf (data2,仅测试网) · 社区合约,未经独立审计Source: alesfer001/CrowdCell / contracts/campaign-lock/src/main.rs@2fd13f6 · 0xb6e2…01bf (data2, testnet only) · community contract, not independently audited
Lock 脚本Lock scriptDeFiDeFi测试网Testnet开源Open source社区Community

AActive campaign 原样延续(认捐)Active campaign carried forward (pledge)

Inputs 输入Inputs
campaignCell{ capacity: C, lock: { codeHash: CAMPAIGN_LOCK, args: deadline_block 8B } }
➜
Outputs 输出Outputs
campaignCell{ lock: 同一 lock, data(≥65B)[56] = 0 Active, capacity ≥ C }Cell{ lock: same lock, data(≥65B)[56] = 0 Active, capacity ≥ C }
lock args 字节布局(≥8B)lock args byte layout (≥8B)
deadline_block8B
  • deadline_block 8B 截止区块 u64 LEdeadline block u64 LE 非延续路径要求 since ≥ 它non-carry path needs since ≥ it (13)

限制Constraints

  • args ≥ 8 字节≥ 8 bytes (10)
  • capacity:: 找到的第一个同 lock、data ≥ 65B 且 status = 0 的输出 capacity ≥ 输入first output with same lock, data ≥ 65B and status 0 has capacity ≥ input (15)

B截止后任意花费(结算 / 销毁)Any spend after the deadline (finalize / destroy)

Inputs 输入Inputs
campaignsince = 绝对区块号 ≥ deadline_blocksince = absolute block ≥ deadline_block
➜
Outputs 输出Outputs
outputs:任意(规则由 campaign 类型脚本约束)outputs: any (rules from the campaign type script)任意any

限制Constraints

  • since:: 第一个 group 输入的 since 必须绝对、标志合法、按区块号first group input since must be absolute, valid flags, block number (12)
  • since:: 区块号 ≥ deadline_block(since = 0 视为区块 0)block number ≥ deadline_block (since = 0 counts as block 0) (13)
部署与来源Deployments & source 未核验unverified
源码source alesfer001/CrowdCell@2fd13f6b · contracts/campaign-lock/src/main.rs (main HEAD read 2026-10-22; author Ayoub_Lesfer (Nervos Talk) offered CrowdCell in https://talk.nervos.org/t/11014/2. Testnet only; deployment from README / deployment/deployed-contracts-testnet.json, hash_type data2 from off-chain/frontend/src/lib/constants.ts and on-chain usage)
二进制核验binary check 未核验unverified hash appears in the repo only as a deployment record or doc, which does not prove the recorded commit builds this binary (reproducible build not attempted)
0xb6e2b333d0…476401bf: listed in README.md; listed in deployment/deployed-contracts-devnet.json; listed in deployment/deployed-contracts-testnet.json
网络networkcode_hashcell_deptype_id args数据哈希data hash部署交易deploy tx
testnet0xb6e2b333d0f38a89c70cde6558670b771244695d33daa1fa62385017476401bf data20xc4e8aaaefd…a5c149b6:0 code—0xb6e2b333d0…476401bf0xc4e8aaaefd…a5c149b6 #22448245
链上数据核对于 on-chain data checked 2026-10-22
错误码(main.rs):10 INVALID_ARGS · 11 LOAD_SINCE · 12 INVALID_SINCE · 13 SINCE_BELOW_DEADLINE · 14 LOAD_CELL · 15 CAPACITY_DECREASEDError codes (main.rs): 10 INVALID_ARGS · 11 LOAD_SINCE · 12 INVALID_SINCE · 13 SINCE_BELOW_DEADLINE · 14 LOAD_CELL · 15 CAPACITY_DECREASED
不检查任何签名:谁都可以推进 campaign;内容合法性由 campaign 类型脚本保证No signature is checked: anyone can move the campaign; validity comes from the campaign type script
部署清单 deployed-contracts-testnet.json 把 campaignLock 写成 hashType data,但链上实际交易与前端 constants.ts 都使用 data2deployment/deployed-contracts-testnet.json lists campaignLock as hashType data, but on-chain txs and frontend constants.ts use data2
GitHub · gpBlockchain/ckb-contract-flow-html