# Condor 紫色Dapper获取 **Published by:** [Tokenmore](https://paragraph.com/@tokenmore/) **Published on:** 2022-09-26 **URL:** https://paragraph.com/@tokenmore/condor-dapper ## Content 1.打开Remix,创建一个空白模板,命名abc.sol https://remix.ethereum.org/2. 将以下代码粘贴至abc.sol,编译器选择0.8.7,右键点击 compliepragma solidity ^0.8.0; // import "hardhat/console.sol"; contract Comments { // Exposed data structure struct Comment { uint32 id; string topic; address creator_address; string message; uint256 created_at; } // Notify users that a comment was added event CommentAdded(Comment comment); uint32 private idCounter; mapping(string => Comment[]) private commentsByTopic; // Fetch a list of comments for a topic function getComments(string calldata topic) public view returns(Comment[] memory) { return commentsByTopic[topic]; } // Persist a new comment function addComment(string calldata topic, string calldata message) public { Comment memory comment = Comment({ id: idCounter, topic: topic, creator_address: msg.sender, message: message, created_at: block.timestamp }); commentsByTopic[topic].push(comment); idCounter++; emit CommentAdded(comment); } // Delete comment function deleteComment(string calldata id) public {} } 3.如下图所示进行合约部署,切换到condor链,连接Metamask, 单击deploy. 支付gas后复制生成的合约代码,下一步用到。3. 打开replit , 点击fork4. 找到 hooks>useCommentsContract.ts 文件,用刚刚生成的合约,替换第160行的合约,之后运行5.复制url 去discord提交(提交时候,repl得处于运行状态,等拿到角色后可以关闭网页) ## Publication Information - [Tokenmore](https://paragraph.com/@tokenmore/): Publication homepage - [All Posts](https://paragraph.com/@tokenmore/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@tokenmore): Subscribe to updates