# 【财富密码】analog 部分功能上分教程 **Published by:** [VICOINDAO](https://paragraph.com/@vicoindao/) **Published on:** 2024-06-10 **URL:** https://paragraph.com/@vicoindao/analog ## Content 该项目任务繁多且复杂,目前测试网卡加bug多多,偏向技术开发人员。有能力的或看好它的撸,不感兴趣的忽略。。。1、GMP相关(目前测试网验证还存在bug,可以等稳定了再试) 原作者教程 https://medium.com/[@4mo4ever](https://weibo.com/n/4mo4ever)/analog-gmp-quests%E6%95%99%E7%A8%8B-cc327a50af31 remix:emix.ethereum.org/ ①打开remix在线合约部署编译平台,打开默认项目,点开项目中的contracts目录,鼠标右键随便创建一个.sol的空白文件②复制以下代码到创建的文件中 // SPDX-License-Identifier: MITpragma solidity ^0.8.0;interface IGmpReceiver {/*** @dev Handles the receipt of a single GMP message.* The contract must verify the msg.sender, it must be the Gateway Contract address.** @param id The EIP-712 hash of the message payload, used as GMP unique identifier* @param network The chain_id of the source chain that send the message* @param source The pubkey/address which sent the GMP message* @param payload The message payload with no specified format* @return 32-byte result, which will be stored together with the GMP message*/function onGmpReceived(bytes32 id, uint128 network, bytes32 source, bytes calldata payload)externalpayablereturns (bytes32);}contract Counter is IGmpReceiver {// sepolia 0xB5D83c2436Ad54046d57Cd48c00D619D702F3814// shibuya 0xF871c929bE8Cd8382148C69053cE5ED1a9593EA7address private immutable _gateway;uint256 public number;constructor(address gateway) {_gateway = gateway;}function onGmpReceived(bytes32, uint128, bytes32, bytes calldata) external payable override returns (bytes32) {require(msg.sender == _gateway, "unauthorized");number++;return bytes32(number);}}③编译运行合约④在左侧工具菜单栏中找到部署按钮,并将环境选择小狐狸,将小狐狸钱包的网络切换为sepolia测试网,网络不要搞错了,再链接小狐狸钱包并签名、授权⑤在黄色的deploy 右边地址栏输入 0xB5D83c2436Ad54046d57Cd48c00D619D702F3814 之后点击deploy部署⑥ 部署成功后复制合约地址到sepolia区块浏览器https://eth-sepolia.blockscout.com/⑦ 在区块浏览器中链接自己的钱包、搜索自己部署的合约、点击右下方contract经行开源⑧点击verify&publish按钮并按以下要求填写合约的信息如图填写最后点击verify&publish 进行验证及开源⑨将开源的合约地址复制到页面填入点击claim就可以了\第二个问题比较简单,在区块浏览器中写合约。按原作者的第二种方式操作即可 https://sepolia.etherscan.io/address/0xB5D83c2436Ad54046d57Cd48c00D619D702F3814#writeContract最后将交易的hash id 复制到页面中填入进行验证即可2、投票3、到dc/gitHub反馈你遇到的问题​好的,今天就分享到这里了,感兴趣的朋友请关注我们! 微信1:victeam005 微信2:shijie20170405 Twitter:https://twitter.com/VICOINDAO ## Publication Information - [VICOINDAO](https://paragraph.com/@vicoindao/): Publication homepage - [All Posts](https://paragraph.com/@vicoindao/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@vicoindao): Subscribe to updates - [Twitter](https://twitter.com/VICOINDAO): Follow on Twitter