# 关于OpenDAO、GasDAO和空投的碎碎念 **Published by:** [Mobius](https://paragraph.com/@0xmobius/) **Published on:** 2021-12-29 **URL:** https://paragraph.com/@0xmobius/opendao-gasdao ## Content 自从ENS打响了大规模社区空投+Fair Launch的第一枪后,fomo的后起之秀纷纷效仿。更有OpenDAO做了“社区空袭”式微创新+Fair Launch+Meme之后,仿盘GasDAO快马加鞭进场,1天之内揽金过亿。若是业内深耕细作的项目方向贡献者发放空投,自然无可厚非,并且长期看来是正向价值分配和引导的Token分发模式。但如OpenDAO、GasDAO做的“空袭式”或“空气币式”空投是否值得追捧?研发成本 从研发成本角度看,一纸简单智能合约的开发成本最多只需几个工作日,完全不足以支撑短期巨大的市值泡沫。OpenDAO、GasDAO智能合约中最核心的模块是签名验证,实际代码量非常小。 代码细节 (i)OpenDAO采用基于EIP712标准的签名验证,这种方式需要注意在要将签名过程在合约函数内复现。function claim(uint256 amountV, bytes32 r, bytes32 s) external { uint256 amount = uint248(amountV); uint8 v = uint8(amountV >> 248); uint256 total = _totalSupply + amount; require(total <= MAX_SUPPLY, "OpenDAO: Exceed max supply"); require(minted[msg.sender] == 0, "OpenDAO: Claimed"); bytes32 digest = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", ECDSA.toTypedDataHash(_domainSeparatorV4(), keccak256(abi.encode(MINT_CALL_HASH_TYPE, msg.sender, amount)) ))); require(ecrecover(digest, v, r, s) == cSigner, "OpenDAO: Invalid signer"); _totalSupply = total; _mint(msg.sender, amount); } (ii)GasDAO采用Merkle Tree进行白名单信息压缩,在链下完成签名后,将Merkle Tree Root存入合约中用于验签。这也是常用的Gas优化方式,在之前文章里提及。library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); } } return computedHash; } } function claimTokens(uint256 amount, bytes32[] calldata merkleProof) public { bytes32 leaf = keccak256(abi.encodePacked(msg.sender, amount)); bool valid = MerkleProof.verify(merkleProof, merkleRoot, leaf); require(valid, "GasDao: Valid proof required."); require(!claimed[msg.sender], "GasDao: Tokens already claimed."); claimed[msg.sender] = true; emit Claim(msg.sender, amount); _transfer(address(this), msg.sender, amount); } 代币分配 虽然Fair Launch模式给了所有用户公平的参与机会,但由于缺乏产品内在价值支撑,也带了巨大的投资风险。此外,OpenDAO项目方具有50% Token的控制权(虽然对用途做了说明,但控制Token分发的私钥依然有中心化问题),GasDAO更是直接将15% Token分发给内部人员(虽然说的是25个核心贡献者,但是人均贡献可能不到10行代码)。这种将短期利益快速变现且存在中心化利益输送的代币分配显然会伤害投资或投机者的利益。社区运营 这部分长期来说,很难断言这些项目不会真心做好运营,就目前的情况,只看到短平快的营销打法而非有诚意地运作。GasDAO的discord甚至也是今天才创建,连基础的discord社区运营功能都没有做好配置,草率浮躁可见一斑。总之,fomo这些项目也无妨,但是在这些项目真正为用户创造价值之前,我不会把它们作为投资标的花时间研究。谨记:勿把炮友当真爱!Reference:https://dev.to/0xmojo7/merkle-tree-solidity-sc-validation-568m https://etherscan.io/address/0x6bba316c48b49bd1eac44573c5c871ff02958469#code https://twitter.com/0xQuit/status/1476097145010675714 https://twitter.com/0xQuit/status/1476097145010675714 ## Publication Information - [Mobius](https://paragraph.com/@0xmobius/): Publication homepage - [All Posts](https://paragraph.com/@0xmobius/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@0xmobius): Subscribe to updates - [Twitter](https://twitter.com/___Mobius___): Follow on Twitter