CKB is very flexiable consider its programing model and how things usually works. But from the very past, I feel like there is a preference of discussing less simple out-of-box solution than taking complex underlying perfect technical debates. If we want to build a ecosystem with impact, I believe it’s worth to post more naive(even stupid) but specific solution than discuss imaginable perfect tech. Because the former is more direct for testing ideas.
That’s why I built a demo project called join-airdrop. The smart contract is a simple airdrop-lock that requires users to join first in order to get airdrop for a specific UDT token. In cell model, doing a airdrop requires paying extra CKBytes to the receiver to help them receive the UDT tokens. with the join-airdrop, the users prepare their own Cell to receive UDT solving such a problem.
Compare to this contract, the AnyOneCanPay is a more general and maybe more powerful solution on such a problem, but this serves as a simple, naive and out-of-box solution specific for such an use case.
Repo: GitHub - RetricSu/join-airdrop: a simple airdrop-lock contract that requires users to join first in order to get airdrop for a specific UDT token
Preview: https://join-airdrop-app.vercel.app/
P.S. the smart contract and the app is all built using Typescript, so it should be pretty easy to understand.
————————
中文版:
CKB 在编程模型和做东西的原理上非常灵活。但长期以来,我感觉似乎有一种不自觉的倾向是更多地去讨论底层某种技术方案的完美性,而比较少去讨论简单的开箱即用方案。
如果我们想打造一个真正有影响力的生态,我认为多提一些简单(甚至有点蠢)但具体的方案,比空谈想象中的完美技术方案更有价值。因为前者更方便测试想法。
所以我做了一个叫 join-airdrop 的 demo 项目。这个合约很简单,是一个"注册式空投"的 lock:用户必须先加入,才能领取特定 UDT 代币的空投。
在 CKB 的 cell 模型中,做空投的项目方需要为接收方支付额外的 CKBytes,好让用户能收到 UDT 代币。而 join-airdrop 让用户自己准备 Cell 来接收 UDT,解决了这个问题。
相比这个合约,AnyOneCanPay 是一个更通用、可能也更强大的解决方案,但 join-airdrop 提供了一个简单、可能有点幼稚、但开箱即用的方案,专门用于这种场景。
仓库:GitHub - RetricSu/join-airdrop: a simple airdrop-lock contract that requires users to join first in order to get airdrop for a specific UDT token
在线预览:https://join-airdrop-app.vercel.app/
P.S. 整个合约端和前端都是用 typescript 写的,所以应该很容易看懂,不需要懂 rust 就能动手。


