<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>dami.eth</title>
        <link>https://paragraph.com/@yidakoumi</link>
        <description>twitter:https://twitter.com/dami16z</description>
        <lastBuildDate>Sat, 11 Apr 2026 14:45:44 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>dami.eth</title>
            <url>https://storage.googleapis.com/papyrus_images/4e1bdcbc0d7c8953614011fae55624bffe607be63585d04ecfc17730397609b8.jpg</url>
            <link>https://paragraph.com/@yidakoumi</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[一文带你看懂以太铭文(ethscriptions)]]></title>
            <link>https://paragraph.com/@yidakoumi/ethscriptions</link>
            <guid>HQW4iiTf5LJDSWq0ZDkk</guid>
            <pubDate>Sat, 29 Jul 2023 05:22:54 GMT</pubDate>
            <description><![CDATA[前言自从「以太铭文」（ethscriptions）诞生已经快两个月了，市场上依然还有很多人没有进入参与到其中来。本文来聊一聊，从以太铭文发展史，以及笔者参与的项目，再最后参与的实战应用，具体应该如何操作。 就像早期的 brc20 一样，以太铭文目前也是处于早期阶段，甚至交易市场还没有一个对公众开放的，大多数早期交易都是通过微信群或者其他社交软件完成的场外 OTC 交易。 比如推特上各种 OTC 微信群：以太铭文发展史以太铭文发展到今天，实际上不到 2 个月的时间，最早是由推特上的这个外国老哥创造出的。 推特：@dumbnamenumbers创始人老哥我回顾了一下，尝试着搜索 【ethscriptions】 关键词在他的推特里搜，第一次出现的时间是在 2023 年 6 月 17 日（但真正的时间应该比这个还要早，只不过推文被他删除掉了）：第一次出现ethscriptions的推文当时他给出了自己的钱包地址，并且结合【以太铭文的官方网站】做了展示：https://ethscriptions.com/0xC2172a6315c1D7f6855768F843c420EbB36eDa97往...]]></description>
            <content:encoded><![CDATA[<h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">前言</h2><p>自从「以太铭文」（ethscriptions）诞生已经快两个月了，市场上依然还有很多人没有进入参与到其中来。本文来聊一聊，从以太铭文发展史，以及笔者参与的项目，再最后参与的实战应用，具体应该如何操作。</p><p>就像早期的 brc20 一样，以太铭文目前也是处于早期阶段，甚至交易市场还没有一个对公众开放的，大多数早期交易都是通过微信群或者其他社交软件完成的场外 OTC 交易。</p><p>比如推特上各种 OTC 微信群：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/615b01e89b7813547fc5a065d342d372fcbf8a7b1743146e202759a41a13cffc.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">以太铭文发展史</h2><p>以太铭文发展到今天，实际上不到 2 个月的时间，最早是由推特上的这个外国老哥创造出的。</p><p>推特：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dumbnamenumbers">@dumbnamenumbers</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a052a085efb94df3597f5a05e05f05ef8ec393cb8da2b36af7dd40b267182cc0.png" alt="创始人老哥" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">创始人老哥</figcaption></figure><p>我回顾了一下，尝试着搜索 【ethscriptions】 关键词在他的推特里搜，第一次出现的时间是在 2023 年 6 月 17 日（但真正的时间应该比这个还要早，只不过推文被他删除掉了）：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d3ee88707cdb8274bf7d0e1be91f4d9b52015999883b2f7ca45f0510ef580c12.png" alt="第一次出现ethscriptions的推文" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">第一次出现ethscriptions的推文</figcaption></figure><p>当时他给出了自己的钱包地址，并且结合【以太铭文的官方网站】做了展示：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b3c2bbcdf5f13781a4bd8e0cc43dc51ab7bafcd9f777ab91e04d2294a929e122.png" alt="https://ethscriptions.com/0xC2172a6315c1D7f6855768F843c420EbB36eDa97" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://ethscriptions.com/0xC2172a6315c1D7f6855768F843c420EbB36eDa97</figcaption></figure><p>往下划一划，可以看到他近期打的一些内容，比如铭文以 .tree 结尾的“种树”项目，比如-59,-67的坐标项目（这些项目在后面我会一一介绍）。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/40eceab3885dfa5b087ed8ad4b45918d6b2336f5512dc3a62071ac6e510c2aad.png" alt="主页拥有的铭文内容" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">主页拥有的铭文内容</figcaption></figure><h3 id="h-ethscriptions-eths" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">第一个被创造出来的ethscriptions - eths</h3><p>一般一个新的技术市场诞生，往往共识度最高且价值最高的就是被首先创造出来的。比如加密货币市场的 BTC ，比如 BTC 铭文生态的龙头 ordi 。那以太铭文也不例外，第一个被创造出来的铭文（<strong>eths</strong>）则是长下面这个样子的：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/786e95b6acd0a4751e7b206c2eeff5c30a4ed4c1c14ae16950ad7f4bba72565d.png" alt="官网的样子" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">官网的样子</figcaption></figure><p>所以可以看到，以太铭文的样子类似 brc20 ，也是一串本文，最终如果成功打到了某一条铭文，则会被显示在官网上。</p><p>通过 NFT SniperSniper 网站，我们可以看到，当时 eths 被部署的时间是：</p><p>2023-06-18 05:46:11</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/bf99864d206ab650f240a81b20a946d2a3e33a3b975641b998b15c032862dc42.png" alt="https://data.nftsniper.club/ethsciptions" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://data.nftsniper.club/ethsciptions</figcaption></figure><p>我记得 eths 当时参与的时候，没用多久就被迅速打完了。同时，前一阵场外情绪非常高涨，OTC 的价格最高也达到了 270 u 一张。</p><p><strong>具体的铭文内容，我会在后面的技术原理章节，详细介绍。</strong></p><p>随 eths 被创造出来之后，又有几个铭文依次被创造（部署），比如下图的这几个，基本都是在同一天出来的：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a1488525d2d2f8f0310dfb9bb364bdfeb57bc371b26b97477f51e3728547b5c9.png" alt="https://data.nftsniper.club/ethsciptions" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://data.nftsniper.club/ethsciptions</figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">以太铭文 “域名 市场”</h3><p>上述提到的代币类型的风格文本之后，以太铭文的一阵风挂向了 eth 的域名，比如有人看好 .eths 结尾的域名，也有人看好 .eth 的文本域名，具体长什么样子呢，比如下面这样：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/70e5796dbe9233ef2cb71cb9ad52b0fdf1da4d6e2e7edf65351afef775685baf.png" alt="https://ethscriptions.com/ethscriptions/0x135b4ebb942dec5f5b27e39425ae94191093455370864b3fd0e36b6216a0a72a" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://ethscriptions.com/ethscriptions/0x135b4ebb942dec5f5b27e39425ae94191093455370864b3fd0e36b6216a0a72a</figcaption></figure><p>有意思的是，域名市场从传统 web2 到现在的 web3 ，一直都是短的数字价值最高，要么就是好记，要么就是有品牌效应。</p><p>所以，这个市场上就会有抢注的生意存在，比如前一阵刷推，看到 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/btc_jx">@静香小姐</a> 发了一个推文，这种场景也经常在网站域名上看到，个人或者品牌产生的价值影响力：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/813abd6711febba8083b8f6a1eb0b557b6817a87fbbce7dea3818839332bae8c.png" alt="https://twitter.com/btc_jx/status/1682230647811874816" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://twitter.com/btc_jx/status/1682230647811874816</figcaption></figure><p>随着 .eth 、 .eths 的发展过后，市场是有一个有意思项目方 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/ForestTLD">@<strong>MetaForest</strong></a> 跳出来做了一个新玩法，就是你来打我的 .tree 域名结尾的内容，我就给你在我的网站上种树，编号从 1 开始比如 ，1.tree，以此类推，每多一个铭文，就会在他们官网上显示一个🌲的表情。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/dc6abe695d3c0e55d1b3998803f1318ae0e38c47898fdec914eb2700a6b50ad3.png" alt="https://tree.eths.center/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://tree.eths.center/</figcaption></figure><p>.tree的铭文长这样：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9cdc69ff45ffa9afffda3dff0f3349a2ce90f95f4ecbcd17b3a3a428323fead9.png" alt="https://ethscriptions.com/ethscriptions/0xfe9e462b030234ff09ec4db1d5fd93632cf140b984173b105342c3f7a8d595d6" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://ethscriptions.com/ethscriptions/0xfe9e462b030234ff09ec4db1d5fd93632cf140b984173b105342c3f7a8d595d6</figcaption></figure><h3 id="h-nft" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">以太铭文 “NFT 市场”</h3><p>除了这种文本类型的铭文通过该技术诞生，还有一种像素风格的 NFT 也被以太铭文的技术应用上了。</p><p>比如像创始人主页显示的一样，他可以把图片直接写进以太坊的链上，最终被官网识别到，这样就完成了图片的永久上链（如下图，他创造的笑脸图片）：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ca9d7eeef422b4e92a0f2a86b682b7456be76ac58b2435fd699f181647e9506d.png" alt="https://ethscriptions.com/ethscriptions/0x7a79517fee36ff25bfd25032ea852737e5ff85f027068188c54f0e86f4e27e2c" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://ethscriptions.com/ethscriptions/0x7a79517fee36ff25bfd25032ea852737e5ff85f027068188c54f0e86f4e27e2c</figcaption></figure><p>当然，这种只是他自己上传的，并不算真正的 NFT 项目合集。</p><p>前一阵，真正第一个出来的 CC0 项目（就是放弃所有权利，允许他们无条件地使用你的作品），且符合 NFT 风格的项目是下面这只小猫，一共一万只。</p><p>官网：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/941c4505ba44dc4a065f861dee7f4dfd2031e1a58066b06f468584bba58b09a6.png" alt="https://mfpurrs.com/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://mfpurrs.com/</figcaption></figure><p>官方合集：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5eaa9ef1a3447647236116db0c5394d703fb7eb2c82429cfff6ad6753251f85b.png" alt="https://ethscriptions.com/collections/mfpurrs" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://ethscriptions.com/collections/mfpurrs</figcaption></figure><p>当初小猫咪的 mint 成本，大概在 1~2 u 左右，目前场外地板价差不多在 5u 左右。</p><p>目前一个多月，以太铭文上发展史差不多都有讲到了，当然，最火热的可能还是代币类的铭文，毕竟<strong>简单、粗暴，直接</strong>。</p><p>像前两天，推特把图标改了，蓝鸟变成了 X，这股 meme 风，先从 BTC 铭文市场上吹过，接下来也蔓延到了以太铭文的市场上：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b0d7766ec3dff1601260fb7e1743973ef322beb7cccb665a9b2298611f0c4360.png" alt="https://ethscriptions.com/ethscriptions/0xb636f674f6d2b1759e3d51c4e4261c4f755b69570bf87d795917e9b22bffd6a2" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://ethscriptions.com/ethscriptions/0xb636f674f6d2b1759e3d51c4e4261c4f755b69570bf87d795917e9b22bffd6a2</figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">以太铭文 “土地 市场”</h3><p>元宇宙土地的概念，自从web3出来一直有被炒作，铭文世界也不例外。</p><p>第一个创作出以太铭文土地是国外的这名开发者，推特：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/0xHirsch">@0xHirsch</a></p><p>官网：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5c8644902161c944702b56af81bbf027712eca483b65b3a276fc06733e234b43.png" alt="https://wilderness.app/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://wilderness.app/</figcaption></figure><p>坐标的规则是，0,0是最中心，以此向外延。长得内容如下：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/90a22c954d79d606ae41a4db7aa0d15add9515c40d1f69bbeff632bb84baca69.png" alt="https://ethscriptions.com/ethscriptions/0x8122b6237ff04184933831dcea7cff1ebd3448944b39486770aa2c83d76cba60" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://ethscriptions.com/ethscriptions/0x8122b6237ff04184933831dcea7cff1ebd3448944b39486770aa2c83d76cba60</figcaption></figure><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">技术原理讲解</h2><p>这部分，我会尽可能的用人话去讲解，让技术小白也可以尽可能的理解，放心食用，不要看到技术两个字就有为难情绪。区块链世界多多少少都离不开技术的知识。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">铭文内容铸造原理</h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5e7985c6470b064b6089976b919024e35d09873935bc081bab7de93f32f95597.png" alt="https://ethscriptions.com/ethscriptions/0x6ceeb8c9f90938d2a1e8ada26411c342e2cdeb09e666240db28bfdd59c000259" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://ethscriptions.com/ethscriptions/0x6ceeb8c9f90938d2a1e8ada26411c342e2cdeb09e666240db28bfdd59c000259</figcaption></figure><p>我们就用 eths 这个铭文举例，我们可以根据官网上拥有这个 eths 的钱包，查看一下他当初创造这条铭文的格式是怎样的？</p><p>如下图，我们通过钱包去 etherscan 上搜一下，可以看到，40天前，第一条通过给自己转账到自己转账有一条交易记录（这条就是当时这个钱包铸造以太铭文 eths 发生的交易记录）:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/524d977a21574f78f3bf88a632178072f39d5411eb18d22ffc415d165b99b946.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>点击去看一下这条交易记录，可以看到，这笔交易发生的内容，他做了什么事儿呢？</p><p><strong>可以看到，from，to都是同一个地址，都是这个钱包自己的地址，也就是说他给自己转了一笔金额为0的转账操作，但和普通转账不同的是，在 input data 中，是刻有内容的：</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5e44f25b6944c26300470e4595c2fd71a55790264b352a1087b2f52614ae6975.png" alt="https://etherscan.io/tx/0x33ca274616cf40faf20e15e61634ee5265ed5ad13fbc904519a776bb6de1c5ff" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://etherscan.io/tx/0x33ca274616cf40faf20e15e61634ee5265ed5ad13fbc904519a776bb6de1c5ff</figcaption></figure><p><strong>现在这个 inputdata 显示的是计算机中 16 进制的格式，我们把这个 input 内容，选成 UTF-8 的时候，就会展示成下面能看懂的样子：</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/abd304a753e5de9599e9ed2ad8b61d22d846ab0a38f72afe6c4a7b934a83518c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><blockquote><p>data:,{&quot;p&quot;:&quot;erc-20&quot;,&quot;op&quot;:&quot;mint&quot;,&quot;tick&quot;:&quot;eths&quot;,&quot;id&quot;:&quot;7612&quot;,&quot;amt&quot;:&quot;1000&quot;}</p></blockquote><p>可以看到，这笔铭文实际上被铸造的真正文本格式，就是长上面这样子。</p><p>来分别说一说文本内容的含义。</p><p>首先</p><pre data-type="codeBlock" text="data:,
前面这个 「data:,」 的内容，是官方定义的关键文本，不能被修改，一旦修改，官方的网站就识别不出来了，注意，冒号，逗号，均为英文。
"><code><span class="hljs-keyword">data</span>:,
前面这个 「<span class="hljs-keyword">data</span>:,」 的内容，是官方定义的关键文本，不能被修改，一旦修改，官方的网站就识别不出来了，注意，冒号，逗号，均为英文。
</code></pre><p>早期也因为有很多人内容没写对，导致浪费了不少 gas 。</p><p>其次，后面花括号的内容：</p><pre data-type="codeBlock" text="{&quot;p&quot;:&quot;erc-20&quot;,&quot;op&quot;:&quot;mint&quot;,&quot;tick&quot;:&quot;eths&quot;,&quot;id&quot;:&quot;7612&quot;,&quot;amt&quot;:&quot;1000&quot;}

p对应的是 erc-20 ,表示了当前这个铭文是属于什么类型的
op对应的是mint，表示了当前这个操作是mint，也就是铸造
tick对应的是eths，表示了当前这个铭文的名字叫什么，也就是eths
id对应的是 7612 ，表示了当前这个铭文的编号是 7612 
amt对应 1000，表示当前这张铭文最大的数量是 1000 个。
"><code>{"<span class="hljs-selector-tag">p</span>":<span class="hljs-string">"erc-20"</span>,<span class="hljs-string">"op"</span>:<span class="hljs-string">"mint"</span>,<span class="hljs-string">"tick"</span>:<span class="hljs-string">"eths"</span>,<span class="hljs-string">"id"</span>:<span class="hljs-string">"7612"</span>,<span class="hljs-string">"amt"</span>:<span class="hljs-string">"1000"</span>}

<span class="hljs-selector-tag">p</span>对应的是 erc-<span class="hljs-number">20</span> ,表示了当前这个铭文是属于什么类型的
op对应的是mint，表示了当前这个操作是mint，也就是铸造
tick对应的是eths，表示了当前这个铭文的名字叫什么，也就是eths
id对应的是 <span class="hljs-number">7612</span> ，表示了当前这个铭文的编号是 <span class="hljs-number">7612</span> 
amt对应 <span class="hljs-number">1000</span>，表示当前这张铭文最大的数量是 <span class="hljs-number">1000</span> 个。
</code></pre><p>需要注意的是， 7612 这个 id 不能重复，一旦有人比你提前打了这张铭文，则以太铭文的官网则不会显示出来。</p><p><strong>总结一下，以太铭文的技术上，其实就是以太铭文官方网址，通过检索区块链上每笔交易记录里的 input data 数据，如果你符合它的规则，那么，就可以被检索到，说明铸造铭文成功。而铸造这个动作，就是自己给自己转账，转账的同时，要把铭文的内容写入到 input data 中。</strong></p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">铭文内容部署原理</h3><p>既然有铸造（mint）部分，那一个 以太铭文 不能被凭空直接 mint ，所以，需要先有一个部署的前置动作，还是以 eths 举例。</p><p>还是使用 NFT sniper 来看下部署 eths 的那条记录：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/94de17bb12e133c07c7d8f6d26a8d59f6a218cc885d2d1c289b7fd562aa9b354.png" alt="https://data.nftsniper.club/ethsciptions" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://data.nftsniper.club/ethsciptions</figcaption></figure><p>跳到以太铭文官网：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ca45165225f191a8553ab32f109aae6eac3ab4455a1c96f99eb2a5c70364ed04.png" alt="https://ethscriptions.com/ethscriptions/0x4636542d00d8075360d0303eb224c4ffb638169c23d6308aace55249b0bed2e4" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://ethscriptions.com/ethscriptions/0x4636542d00d8075360d0303eb224c4ffb638169c23d6308aace55249b0bed2e4</figcaption></figure><p>同理，我们去 etherscan 看下这条交易的 input data 内容是什么？</p><p>只需要把上面官网地址最后的这串 hash值复制下来，0x4636542d00d8075360d0303eb224c4ffb638169c23d6308aace55249b0bed2e4，去 etherscan 上搜一下，就是当时部署 eths 的那条交易记录了：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/89767a17ce49473ebeafe2710704d93980f74ff6f218f3e57251912f9c5bec0c.png" alt="https://etherscan.io/tx/0x4636542d00d8075360d0303eb224c4ffb638169c23d6308aace55249b0bed2e4" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://etherscan.io/tx/0x4636542d00d8075360d0303eb224c4ffb638169c23d6308aace55249b0bed2e4</figcaption></figure><blockquote><p>data:,{&quot;p&quot;:&quot;erc-20&quot;,&quot;op&quot;:&quot;deploy&quot;,&quot;tick&quot;:&quot;eths&quot;,&quot;max&quot;:&quot;21000000&quot;,&quot;lim&quot;:&quot;1000&quot;}</p></blockquote><p>来，有了上面的铸造时的解释，这里只讲不同的地方。</p><pre data-type="codeBlock" text="{&quot;p&quot;:&quot;erc-20&quot;,&quot;op&quot;:&quot;deploy&quot;,&quot;tick&quot;:&quot;eths&quot;,&quot;max&quot;:&quot;21000000&quot;,&quot;lim&quot;:&quot;1000&quot;}

op:操作变成了 deploy，说明是部署的动作

max ，21000000 个数量，这里是为了限制铸造时的 id，21000000/1000，所以，铸造 id 最大为 21000 个，也就是 21000 张铭文。

lim ，每次铸造铭文，最大的数量只能是 1000 ，也对应上了为什么铸造时，&quot;amt&quot;:&quot;1000&quot;要这么写
"><code>{<span class="hljs-string">"p"</span>:<span class="hljs-string">"erc-20"</span>,<span class="hljs-string">"op"</span>:<span class="hljs-string">"deploy"</span>,<span class="hljs-string">"tick"</span>:<span class="hljs-string">"eths"</span>,<span class="hljs-string">"max"</span>:<span class="hljs-string">"21000000"</span>,<span class="hljs-string">"lim"</span>:<span class="hljs-string">"1000"</span>}

op:操作变成了 deploy，说明是部署的动作

<span class="hljs-built_in">max</span> ，<span class="hljs-number">21000000</span> 个数量，这里是为了限制铸造时的 <span class="hljs-built_in">id</span>，<span class="hljs-number">21000000</span>/<span class="hljs-number">1000</span>，所以，铸造 <span class="hljs-built_in">id</span> 最大为 <span class="hljs-number">21000</span> 个，也就是 <span class="hljs-number">21000</span> 张铭文。

lim ，每次铸造铭文，最大的数量只能是 <span class="hljs-number">1000</span> ，也对应上了为什么铸造时，<span class="hljs-string">"amt"</span>:<span class="hljs-string">"1000"</span>要这么写
</code></pre><p><strong>这里的 max ，需要大家算一下，max/lim ，这两个值做除法，得出的是最大铭文的 id 数字到底是多少，比如 eths ，最大的 id 就是从 1，到 21000，先到先得，铸造完就没了。</strong></p><p>迄今为止，大部分铭文总量，基本都是 21000 ,不排除后续的新铭文会有变动，最稳的做法还是确认下比较好。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">技术原理总结</h3><p><strong>以太铭文的技术上，其实就是以太铭文官方网址，通过检索区块链上每笔交易记录里的 input data 数据，如果你符合它的规则，那么，就可以被检索到，说明铸造铭文成功。而铸造这个动作，就是自己给自己转账，转账的同时，要把铭文的内容写入到 input data 中。</strong></p><p><strong>需要大家算一下，max/lim ，这两个值做除法，得出的是最大铭文的 id 数字到底是多少，比如 eths ，最大的 id 就是从 1，到 21000，先到先得，铸造完就没了。</strong></p><p>目前以太铭文这种铸造后的方式无法进行分割，也就是 1000个数量 一张，交易也只能按最低 1000 买卖，现在官方团队也在进行铭文的分割协议开发研究，一旦支持了分割，最低单位就可以自由设定数量交易了，类似 BTC 铭文市场的结构。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">实战环节</h2><p>好了，技术原理讲完了，接下来讲讲实战环节。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">推荐方式</h3><p>更新时间2023年07月31日14:41:57，出了新的市场交易，支持一键铸造，强烈推荐：</p><p>比如下面的铭文：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.etch.market/tokens/info?p=erc-20&amp;tick=pepe">https://www.etch.market/tokens/info?p=erc-20&amp;tick=pepe</a></p><p>只要还有剩余，只需要点击黄色按钮即可完成：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/eaf6026b9b434da9cf54da2f36da9dd45eab46ef8af7b0fbb59260ee1c107d83.png" alt="https://www.etch.market/tokens/info?p=erc-20&amp;tick=pepe" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.etch.market/tokens/info?p=erc-20&amp;tick=pepe</figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">方式一</h3><p>我先说目前最常用的一种方式，大家可以直接去下面的开源网站，通过网站来进行铭文铸造。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethscriber.xyz/">https://ethscriber.xyz/</a></p><p>进入到官网后，4个步骤：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b6763deb53d33be1a5548cf624d422d0c18fb342b4b60c635f971f0a6e734dce.png" alt="https://ethscriber.xyz/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://ethscriber.xyz/</figcaption></figure><ol><li><p>第一步，链接钱包</p></li><li><p>第二步，把你要打的内容，放到2的文本框里</p></li><li><p>第三步，点击3的查重铭文</p></li><li><p>第四步，铸造铭文</p></li></ol><p>下面以打坐标举例：</p><p>当我填写： 1,1 的时候，点击查重，它会提示，已经被打过了，并且告诉当前是谁铸造了这个铭文。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c07105dc8a8e16ed87e865061edec5a69a7594eea06ec348cb7da27db52a6186.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>接下来，我改个别的数字，比如： 40,-100 （注意铭文的逗号，都是英文的），像下面这样，就是没有被打过的坐标，available，可用：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/bbadb3e1bf4b7a1b9cbcf8c2e3233f458b693326983bdf1c5e3aade8bf26f1c9.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>点击 ethscribe 即可，小狐狸弹出，可以看到转账记录是从自己赚到自己：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/992f77aefeec80858de3ba7d2440f9976bed64ac370efef1fe8031fea07a40b2.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>点到 hex （这里就是小狐狸做转账记录时 inputdata 的 16 进制数据）我们看下：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1914f46638c5146e1b553e064e6c15861e19f3506884e4abf9498fcf95bbeec6.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>0x646174613a2c34302c2d313030，这段内容是不是和下面打铭文网站一致？</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/de61bc31b6757ec1a1f1962bef37e191b7f6dc1bcc937fa7c686182f47e06d28.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>其实打铭文网站帮我们做的事情就是，将坐标 <strong>data:,40,-100</strong> 这段文本转成了 16 进制，写到小狐狸给自己转账的 inputdata 框中。</p><p>最终 confirm 即可完成铸造：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7944474258d6d90c28063c025c56ed4b26bfccd431e269ace3bd34f926e241c1.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>然后就可以去下面的官方铭文网站，链接钱包，打开主页，即可看到自己的铭文了：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethscriptions.com/">https://ethscriptions.com/</a></p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">方式二</h3><p>现在以太铭文的协议文本规范基本上定下来了，方式二可以当做防身用的技能，毕竟不止铭文可以这么用，任何你了解的土狗mint玩法，都可以通过16进制去mint。</p><p>在方式一的网站没出来之前，最传统的方式，其实是我们通过手动方式去 dune 上查重，查重后，在通过文本转 16 进制的方式，自己把 16 进制写到小狐狸钱包的 inputdata 中，最终完成铭文的铸造。</p><p>也不排除，后续如果有不是 data:, 开头的铭文出现，那么就得用方式二来铸造了。</p><p>大概路径如下，进入dune(查询起来很慢，因为数据越来越大)：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://dune.com/queries/2644693">https://dune.com/queries/2644693</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7e7394ebbac0254e53fe73684d78fa05ca47b45e9ab4668e6919ddda0c069623.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>通过下面的搜索框进行搜索，如果没有搜到，说明没有被铸造过，文本改你想构造的id：</p><blockquote><p>data:,{&quot;p&quot;:&quot;erc-20&quot;,&quot;op&quot;:&quot;mint&quot;,&quot;tick&quot;:&quot;eths&quot;,&quot;id&quot;:&quot;7612&quot;,&quot;amt&quot;:&quot;1000&quot;}</p></blockquote><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a6b64045840cb5e33cf59cd72ddb13b8d8113c4dd9b8c90f85828adace302122.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>接下来，谷歌随便搜一个【文本转16进制在线网址】，比如下面这个网站，把文本转成 16 进制：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.bejson.com/convert/ox2str/">https://www.bejson.com/convert/ox2str/</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1754a7203735fa3448b7b63f866b051217c6ae016bfb28915426e0ced8463f3e.png" alt="https://www.bejson.com/convert/ox2str/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">https://www.bejson.com/convert/ox2str/</figcaption></figure><p>复制 16 进制到小狐狸，发起自己给自己转账的操作，写 0 就行了，然后把 16 进制直接复制到 inputdata 框中：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9c37035139c9caeab157cb503c06972894a6cafd433fd0cc93242f7e83b1178f.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>发起确认交易，最后查看操作同 方式一 一样即可。</p><h2 id="h-eths" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">eths交易网站:</h2><p>下图是我早上在群里看到的，觉得总结的很好，直接拿过来分享下，不知道原作者是谁，在这里感谢下他的整理。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/465f30e83cbc738df324bd5913de174439ea9d7f9f6f1e4d23cc004ea776f043.jpg" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>1、Ethscriptions官网: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethscriptions.com/">https://ethscriptions.com/</a></p><p>优点: 挂单的gas算是比较低的</p><p>缺点: 整体体验较差，项目方的合集官方并没有给方便的 入口</p><p>2、ETCH: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.etch.market/">https://www.etch.market/</a></p><p>优点: UI漂亮，界面简洁，拆分功能待上线</p><p>缺点: 需要验证的项目才能交易，撤单需要gas费</p><p>3、Ethsmarket: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://htps://www.ethsmarket.xyz">htps://www.ethsmarket.xyz</a></p><p>优点: 拆分功能已上线，但是经历了信任危机，目前使用的人较少</p><p>缺点: 只有eths给了合集，其他项目没有合集</p><p>4、Ethinscribe: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethinscribe.com/">https://ethinscribe.com/</a></p><p>优点:功能较丰富，拆分方案最简单，未经验证</p><p>缺点: 很多细节需要优化，索引优化中</p><p>5、Ordex: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ordex.ai/inscriptions">https://ordex.ai/inscriptions</a></p><p>优点:多链市场</p><p>缺点:以太铭文方面的功能较少</p><p>6、Eth-Scriptions: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eth-scriptions.com/">https://eth-scriptions.com/</a></p><p>缺点:目前只有NFT在挂单</p><p>7、Ethscribe: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethscribe.art/market">https://ethscribe.art/market</a></p><p>优点:多种格式的铭刻功能已上线</p><p>缺点:交易功能还未上线</p><p>可见，现在经历过 btc 铭文的市场洗礼，现在以太铭文交易所都在争夺市场，就看哪家先跑出来了。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">结语</h2><p>好啦，以上就是以太铭文整个发展史和实战操作了，希望对没有入局的新人有所帮助。</p><p>以太铭文的价值绝不止现在这么简单，毕竟铭文铸造的 gas 费用只需要一个转账的操作。相比以太合约层的 erc20 协议，便宜了不少。</p><p>同时，图片永久上链，包括 .eth 这类域名的索引未来也非常有价值，谁愿意每年都花上几百元去一直续自己的 eth 域名呢。。。</p><p>近期也经常能看到 ok、火币 两家交易所对以太铭文的持续关注，希望后续的市场可以慢慢崛起。</p><p>以太铭文也算是低成本，高赔率，何乐而不为呢？（各种防身，各种冲😂）</p><p>最后，我最近打算做个以太铭文的监控，打算用飞书群作为通知机器人。如果你也对这个市场感兴趣，欢迎关注我后续的推文。到时候做完了，应该会从推特上邀请一批人来尝试。</p><p>最后，我的推特是 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dami16z">@dami16z</a> ，欢迎关注交流~</p>]]></content:encoded>
            <author>yidakoumi@newsletter.paragraph.com (dami.eth)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/3c911fa08277b0b6824877b4477c272df6c2bede7898363f98c06860db3d0463.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[撸毛多账号-如何养成精品号]]></title>
            <link>https://paragraph.com/@yidakoumi/LGI1LxBeqre3BEAwRMLe</link>
            <guid>LGI1LxBeqre3BEAwRMLe</guid>
            <pubDate>Sat, 18 Feb 2023 11:04:35 GMT</pubDate>
            <description><![CDATA[前言本笔记写于 2023年02月14日 ，在 TBP 社区内，参与🦑鱿鱼游戏所学所记录，仅供参考。一、ip、账号相关每个账号独立 ip 去做。vpn不适合去养账号，因为 vpn 线路是共享的，很有可能别人登录节点的时候，已经被封过号了，那么意味着 ip 被污染。无法确定 vpn 是否干净，看运气。推荐静态的住宅 ip。 老师的笔记tips：请选择高质量静态住宅ipv4 、移动代理ipv4，IP地址不要选择冷门的IP，比如俄罗斯 乌克兰 土耳其 印度。不要使用任何动态IP，若你使用动态ip，每次短时间登录时ip变化地点太大，就会被推特列为可疑操作，因为显示IP是：短时间内你的账号登录在多个国家 。这样会导致账号被官方进行风控或封号处理。每条 IP 登录的推特或 DC 账号不要超过2个。账号登录成功之后，3天之内尽量避免切换其它IP重新登录，避免账号因为异地登陆而被官方风控。二、指纹浏览器推荐1 - 比特指纹浏览器：https://www.bitbrowser.cn/?code=c48148 推荐2 - adspower跨境指纹浏览器：https://www.adspower.co...]]></description>
            <content:encoded><![CDATA[<h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">前言</h3><p>本笔记写于 2023年02月14日 ，在 TBP 社区内，参与🦑鱿鱼游戏所学所记录，仅供参考。</p><h3 id="h-ip" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">一、ip、账号相关</h3><p>每个账号独立 ip 去做。vpn不适合去养账号，因为 vpn 线路是共享的，很有可能别人登录节点的时候，已经被封过号了，那么意味着 ip 被污染。无法确定 vpn 是否干净，看运气。推荐静态的住宅 ip。</p><p>老师的笔记tips：</p><ol><li><p>请选择高质量静态住宅ipv4 、移动代理ipv4，IP地址不要选择冷门的IP，比如俄罗斯 乌克兰 土耳其 印度。</p></li><li><p>不要使用任何动态IP，若你使用动态ip，每次短时间登录时ip变化地点太大，就会被推特列为可疑操作，因为显示IP是：短时间内你的账号登录在多个国家 。这样会导致账号被官方进行风控或封号处理。</p></li><li><p>每条 IP 登录的推特或 DC 账号不要超过2个。</p></li><li><p>账号登录成功之后，3天之内尽量避免切换其它IP重新登录，避免账号因为异地登陆而被官方风控。</p></li></ol><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">二、指纹浏览器</h2><p>推荐1 - 比特指纹浏览器：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.bitbrowser.cn/?code=c48148">https://www.bitbrowser.cn/?code=c48148</a> 推荐2 - adspower跨境指纹浏览器：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://share.adspower.net/Ycb5urL8oIA1e42">https://www.adspower.com/</a> （我个人用的是付费的，50个账号大概一年 1600RMB+，支持 selenium 脚本自动化编程）</p><p>静态ip的购买地址（船友推荐）：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://iproyal.cn/?r=134497">https://iproyal.cn/?r=134497</a> ip类型的选择，一般选择 socket5 协议。</p><p>登录默认选择 token ，比如登录【推特、dc、谷歌】。token 的概念，大家可以理解为一种登录时用到的凭证，有了这个凭证，且凭证在有效期内，就可以不用手动进行账号密码进行登录。大家可以理解为程序形式的一种快捷认证方式。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">三、推特养号的关注点</h3><p>推特的风控比 dc 要严格。不论是老号还是新号，都可以养号，至于养哪个类型，取决于项目方的设定，比如有些项目方会设置推特注册大于 3 个月。</p><p>如果在指纹浏览器里被风控了，可以把环境删掉。ip可以在试一下，如果还不行，说明 ip 也有问题，环境 + ip 一起换掉。 推特新号，先去设置个性签名，背景之类的，切记不要上来就关注人。</p><p>改完资料后，可以正常的点赞，评论，转推。每天不要关注的人太多，别一天关注成百人，一天发 5 ~ 10 条推文。每天按照这个操作去做，80%稳了。</p><p>手机号和邮箱双绑定，邮箱能登陆的上，手机号或者接码平台能收到的账号要相对好一些。比如单绑手机号和单绑邮箱的账号没啥太大的区别。</p><p>ps：大风控出现时，即使养的再好，也可能会被封掉。</p><p>手机号第一次验证的时候，可以选择删掉。因为接码平台重启手机验证会很贵，所以定期删除推特绑定的手机号，下次风控了，在重新绑定即可。过一段时间，再次删掉，在绑定新的手机号。</p><p>保证1个账号在1个指纹里，尽量不要点击登出，如果登出了，token会被刷新，相当于长期稳定的环境发生了变化，有可能会触发风控。</p><p>【如果账号被风控，一定要把环境删除，不要在用这个环境了。】</p><h3 id="h-dc" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">四、DC账号养号相关</h3><p>dc 判断是注册账号的时间长短。账号权重高低和注册时间长短有关。不需要每天去登录，关注，聊天。不要频繁的用自己的号去发私信，官方对频繁发私信的账号有风控。如果 dc 的环境被封，可能要重装系统才能重置环境。</p><p>（我之前主账号dc被封过，但是后面是通过给官方发申诉，可以申诉回来的）</p><p>脚本控制的 dc ，注意每组账号进服务器的频率，单账号间隔建议随机 30s 以上。 尽量使用双绑的dc账号（手机号+邮箱）验证绑定。</p><p>dc也尽量用 token 登录，如果 dc 的 token 被泄露了，可以在设置中重置 token，一定要把之前的 token 重置，让它失效，否则有风险。</p><p>dc可以用邮箱解除风控。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">五、成本相关</h3><p>养号都是为了撸毛，算好成本。如果成本大于收入，则被反撸，不赚钱它干啥~:Topkek:</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">六、抽奖相关</h3><p>不要短时间同时大批量关注官方的推特，dc 。 比如进 dc 或者关注，可以按照账号分组进行。</p>]]></content:encoded>
            <author>yidakoumi@newsletter.paragraph.com (dami.eth)</author>
        </item>
        <item>
            <title><![CDATA[钱包被盗的完整经历复盘]]></title>
            <link>https://paragraph.com/@yidakoumi/dyGhc3djYZDQX1KKNZD7</link>
            <guid>dyGhc3djYZDQX1KKNZD7</guid>
            <pubDate>Thu, 26 Jan 2023 04:52:18 GMT</pubDate>
            <description><![CDATA[前言哈喽，大家好，我是大咪，目前玩 NFT 大概有快 10 个月了，第一次遇到了区块链的黑暗时刻，好在，由于提前有钱包资产隔离的概念，这次损失非常少，但这次的经历，确实让我学到了很多。 作为一个开发者，没想到，也会被区块链的钓鱼手法骗到，从去年入圈开始，就一直非常注重区块链的钱包安全问题，基本上把余弦大大和慢雾团队相关的开源文章都看了一遍，但这次，依然还是中招了。 强烈推荐慢雾团队出品的《区块链黑暗森林自救手册》 这次，恰好是中招了【人性安全-来自“官方”的钓鱼】！希望本次复盘能对一些没有经历过的朋友有所帮助，有所启发，下面正式开始。 本篇内容会从开始被骗的逐一过程写起，每个步骤，我都写了后续复盘的心得，心得也就是后来觉得不对劲，补充上去的区块链知识点或者一些需要注意的地方，这样也便于阅读。 下面跟随笔者的步伐，来看一看钱包是怎么被骗的。。。 事情发生在 2023年01月25日 。早上爬起来，日常刷刷 dc 的信息，结果刷到 dudu 的 dc 时，发现一则公告，如下（打码一下，保护下 MOD）：公告大意如下：因为是新年，所以要给 dudu 的 holder 们空投新年日历。但是...]]></description>
            <content:encoded><![CDATA[<h1 id="h-" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">前言</h1><p>哈喽，大家好，我是大咪，目前玩 NFT 大概有快 10 个月了，第一次遇到了区块链的黑暗时刻，好在，由于提前有钱包资产隔离的概念，这次损失非常少，但这次的经历，确实让我学到了很多。</p><p>作为一个开发者，没想到，也会被区块链的钓鱼手法骗到，从去年入圈开始，就一直非常注重区块链的钱包安全问题，基本上把余弦大大和慢雾团队相关的开源文章都看了一遍，但这次，依然还是中招了。</p><p>强烈推荐慢雾团队出品的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/slowmist/Blockchain-dark-forest-selfguard-handbook/blob/main/README_CN.md">《区块链黑暗森林自救手册》</a></p><p>这次，恰好是中招了【人性安全-来自“官方”的钓鱼】！</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/49f49fad8c169e53979d6c94837a7a4432327e90c042422bf8daeaabfe91d77c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>希望本次复盘能对一些没有经历过的朋友有所帮助，有所启发，下面正式开始。</p><p>本篇内容会从开始被骗的逐一过程写起，每个步骤，我都写了后续复盘的心得，心得也就是后来觉得不对劲，补充上去的区块链知识点或者一些需要注意的地方，这样也便于阅读。</p><p>下面跟随笔者的步伐，来看一看钱包是怎么被骗的。。。</p><p>事情发生在 2023年01月25日 。早上爬起来，日常刷刷 dc 的信息，结果刷到 dudu 的 dc 时，发现一则公告，如下（打码一下，保护下 MOD）：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1a0e654c968b651092ea71cb387941557684bd0376250010c2c1af46320ad2cb.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>公告大意如下：因为是新年，所以要给 dudu 的 holder 们空投新年日历。但是，是先到先得，一共就 100 个名额。</p><p><strong>注意，这里由于早上起来头脑还在懵逼的状态，黑客利用了“限额，先到先得”的心理，发出了这样的公告，让人没有空余的时间去思考。</strong></p><p>因为看到时间是凌晨 4:00 多发的，我起床看到这条消息是 6:30 多，心想着，2个小时，快点去领应该还能领到，这时丝毫没有意识到这个是黑客的假链接。</p><p>复盘心得：</p><p><strong>有了这次经历，下次发公告的时候，一定要注意，先看看域名眼熟不眼熟，如果是不眼熟的官方域名，需要注意，当然大部分第一次经历的，可能还是不会意识到这点。</strong></p><h1 id="h-" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">进站过程</h1><p>黑客的网址是：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://dudulunar.com/">https://dudulunar.com/</a> （<strong>大家有NFT和金钱资产的钱包，就不要轻易尝试访问了</strong>）</p><p>长这样：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0a106692f33a8faca68d8efcf38d9953cb9728b21ca983d1681b06d948ec6cf7.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>看到背景是 dudu ，也没有多想，全站就一个红色的 claim 按钮，和 dc 发的公告又很贴近，于是也没有多想，点！</p><p>弹出的钱包界面也很熟悉，是平时 mint 的常用组件：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/44fb35456def5e74b524203092ddbfd898a2ef4ba98afdd57b3aab81b9356919.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d196421c6b96123611700295ba28bbab241ae34ffc5ea64025e3f3ebc609d8b6.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>到这步为止，一切正常。</p><p>复盘心得：</p><p>基于对临时活动的前提下，或者发现新活动的网站域名长得像官方域名的情况下，可以优先留个心眼，在浏览器上，先按下 F12 （打开浏览器开发者模式），然后查看如下图操作，点【sources】，找到类似 index 这样的 html 页面，如果在开头有这【<strong>mirrored .... by HTTrack Website</strong>】的字眼，就要注意了，因为这是一款复制已有的网站免费开源软件<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.httrack.com/">https://www.httrack.com/</a>，经常被黑客用于复制钓鱼网站来使用，下图所示：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/18d5d6c95b31436b3478047f3232fec3575f0596897ab4dcabc1025b48aa559f.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>如果是有上图这样的，大概率是钓鱼网站了，也不用做什么后续操作了，直接关闭就好了。不要着急操作，不要 FOMO ，不要贪图小便宜的心理，静待官方后续公告就好了。</p><p>回到我后续的操作流程。奇怪的是，点击红色按钮之后，反应并没有那么迅速，于是又点了一遍，过了一阵，小狐狸弹出来一个 opensea 的提示框让签名，大概是下面这样的：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/17963a724b3853b3c42c19c9fb0b8ae1ec6827a6f07e842825f03a456d50df8c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>因为是 os 的协议签名，直接让我放松了警惕，想都没想，也没细看，直接拉到最底下，点了 sign ，就签名了。</p><p>复盘心得：这步就已经很离谱了，切记，不要相信任何第三方网站的“官方”签名，正是因为有 opensea 做了信任背书，我才会选择信任签名，因为这个操作，metamask是不会给你提示危险签名的，它就是由黑客的网站用技术手段调用到了 opensea 上挂单的动作，触发了小狐狸钱包签名的动作。以后除了 opensea 上触发的签名，其他网站发出的签名动作，一定要三思而后行！</p><p><strong>签名和授权是两个概念，签名更像是你在做认证，让程序知道是你，对于结果而言，只有是或者不是。而授权则是你将权限授权给谁，你授权给 opensea，那么 opensea 就能操作你的钱包 NFT 资产。签名不需要花钱，授权一般是和合约交互，所以需要上链，要花 gas 费用。</strong></p><p>除此之外，可以看下 opensea 上专门写了一篇关于 seaport 前面请求长什么样子：：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://support.opensea.io/hc/zh-cn/articles/4449355421075-%E9%94%AE%E5%85%A5%E7%9A%84%E7%AD%BE%E5%90%8D%E8%AF%B7%E6%B1%82%E6%98%AF%E4%BB%80%E4%B9%88%E6%A0%B7%E7%9A%84-">https://support.opensea.io/hc/zh-cn/articles/4449355421075-%E9%94%AE%E5%85%A5%E7%9A%84%E7%AD%BE%E5%90%8D%E8%AF%B7%E6%B1%82%E6%98%AF%E4%BB%80%E4%B9%88%E6%A0%B7%E7%9A%84-</a></p><p>这里，强烈推荐，陈剑大佬2022年写过的一篇文章，很早之前就有这样的套路了，奈何我没有看到：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://jason.mirror.xyz/9z9cPEU6mLHf0vvvimEFXAcc1J7GCzbomft09XhNIWU">https://jason.mirror.xyz/9z9cPEU6mLHf0vvvimEFXAcc1J7GCzbomft09XhNIWU</a></p><p>实际上背后的原理，就是利用了跨站，调用 opensea 的挂单方法，导致黑客可以 0 元直接转移你的资产。</p><p>签名完成后，突然崩出来一个让我授权 NFT 的操作，类似下图，只不过，当时显示的NFT是 【megami】，而不是【pop fighter】：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d374daa531389e26b10fefe5977e16adde63c488290dfac3dfc9da785355ddfb.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>我此时意识到情况不对了，快速选择了拒绝。</p><p>然后接下来，更离谱的弹出来一个资产转移的链上动作，此时才清醒过来，这是上了钓鱼网站了，可以看到即使我点了，小狐狸依然没有提示危险，因为这是一个正常的和链上合约交互的动作：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/64714c43965d6eb588225ca4335eb38568e2371d55bd25974610c0b1056ff300.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>点击红框的地址蓝字，我们直接复制下来，去 etherscan 上看看（<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/address/0xd13b093eafa3878de27183388fea7d0d2b0abf9e">https://etherscan.io/address/0xd13b093eafa3878de27183388fea7d0d2b0abf9e</a>），左上角已经提示了，是有风险的，钓鱼黑客合约地址：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a55d3a7013024cebae5e136692962a664ea31246676d3768c1517d7eab0b6350.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>我们进合约看看，可以看到这个方法，就是一个很简单的支付方法，里面啥也没有，意味着，黑客网站通过链接你的钱包，读取了你的钱包所有资产，对这个合约的方法【SecurityUpdate】发起了请求，由于它是 payable 修饰的，相当于是可以直接接受资产：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/93fde867f361d4d47ca3c7bc4a9f9f36c76c49c588c3b374d33d6cc21ed53430.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>用人话说，你的资产，全部进了这么一个简单的钓鱼合约，由前端页面发起支付，转账到它的合约地址里，然后他留了一个提现的方法，只能是部署这个合约的人操作。</p><p>我们用慢雾团队出的 mistrack 可以追踪一下：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://dashboard.misttrack.io/address/ETH/0xd13b093EAfA3878De27183388Fea7D0D2B0AbF9E">https://dashboard.misttrack.io/address/ETH/0xd13b093EAfA3878De27183388Fea7D0D2B0AbF9E</a></p><p>迄今为止，一共收到过 840+ ETH（太尼玛赚钱了。。。）</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/08e5964e0e49f3049bfb2fb5a79a91c16b073bf4df7e6a47d3e409913ec69656.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>跳到中国时区，我们看看链上的作案时间，如下图，凌晨居多一些：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3fd62cd294e39429f0cf7d123085c8517210467efe6378b5d899682518bea8ab.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>还有一个地址转账的图形，我就不放了，大家有兴趣可以自己去网站看看。</p><p>回到 NFT 正题，如果你看完了陈剑大佬那篇文章（<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://jason.mirror.xyz/9z9cPEU6mLHf0vvvimEFXAcc1J7GCzbomft09XhNIWU">https://jason.mirror.xyz/9z9cPEU6mLHf0vvvimEFXAcc1J7GCzbomft09XhNIWU</a>），你应该知道，我最后的结果还是被盗走了一个 MEGAMI。因为当时手里只有 MEGAMI 在挂着单，其余只要没有授权挂单过的 NFT ，都平安无事。</p><p>来看看链上的数据吧：</p><p>上 etherscan，搜自己的钱包，然后点击到 721 这块看转移记录：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6b1e3972ac4e8e298873afad0d15cc00e71d345de8603f8148e0e14d66a85c3a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>能看到详情：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5bf709ef1f3231584fc1b0f0eb6decc6256849b9a7124fc0b9eb4cd2f8d42554.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>由钓鱼网站钱包地址（<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/address/0x69420e2b4ef22d935a4e2c194bbf3a2f02f27be1">https://etherscan.io/address/0x69420e2b4ef22d935a4e2c194bbf3a2f02f27be1</a>）：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d7bbf5762e6b35093e00d1ea8d6e495e598681444f98204b20edc1f6f00902f5.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>但凡是 match orders 方法，基本上都是和我中了一样的套路，不论是哪个网站进去的，最终都是利用了 os 订单匹配的原则，比如下面这笔，损失惨重，不仅被顺走了 NFT ，还有 WETH 也被</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4e8e7d00698cefcfa4e444967b274b6fbb10a63bcd6d19ca419d5fce27026e8d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>顺走了：</p><p>对于黑客盗取 NFT 来说，他们的资金归集采用的是不同的钱包地址，比如上面这笔交易，和我被盗的交易就不是一个钱包。</p><p><strong>总结一句话：钓鱼网站诱导你完成了对 OpenSea 挂单，并且发起了撮合(matchOrders)的签名上链操作。</strong></p><p><strong>注意：这里有个不能意料的风险，就是黑客通过网站让你签名，而你不知道签名是否离线保存了，中招了，还是新换个钱包吧，以防万一。</strong></p><p>幸运的是，我这个钱包里，只有一个处于正在挂单的，其余的 NFT 都还安好，而 dudu 这次处理最终处理结果是愿意赔偿，因为是由公告发起的，而不是聊天频道。这波还是很欣慰的，格局拉起来了~</p><p><strong>这里也要说下对于项目方的 discord 建议，黑客手段频繁发生，很多都是社工手法，而突破点往往都是 dc 管理员的身上， dc 作为社群沉淀入口的，一定要控制好权限问题，必要时，可以缩权来达到防范作用，因为拥有大权限的人越少，黑客入侵的概率相对也要低。</strong></p><h1 id="h-" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">安全措施防护</h1><h2 id="h-1" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">1. 一个误区</h2><p>自欺欺人的操作，以为从小狐狸钱包断开网站的链接，就安全了，大错特错。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/62729d3b904efe1e017e4e73d7a145d84465973ef440e1c84a24a605ffdfae45.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d7c7a845067133401d849d5a94afb3f67e0a89ba82e6eb540992e4879c986ebc.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>其实，你仔细看看小狐狸的提示，我们平时链接网站，仅仅是他们能读取到你的地址以及资产而已。这步本身就和链上交互没有太大的相关性，如果拿到了你的私钥或者签名，就算不链接你的钱包，也可以直接操作你的资产。</p><h2 id="h-2" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">2. 推荐一个钱包插件</h2><p>官网：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.pocketuniverse.app/">https://www.pocketuniverse.app/</a></p><p>chrome：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://chrome.google.com/webstore/detail/pocket-universe/gacgndbocaddlemdiaadajmlggabdeod?hl=zh-CN">https://chrome.google.com/webstore/detail/pocket-universe/gacgndbocaddlemdiaadajmlggabdeod?hl=zh-CN</a></p><p>签名前，会先额外提示资产相关风险：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9c957c8a4d88cf24bebe9734b52619e52ee6dbad8243751547abbbf19aaa1e88.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h2 id="h-3" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">3. 定期取消授权</h2><p>取消 NFT 授权，目前有两种常用的方式，一个是通过 etherscan ，一个是通过 revoke。</p><p>网址：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/tokenapprovalchecker">https://etherscan.io/tokenapprovalchecker</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e3b2797e3186fb101b1702d5b66c0c81d669abde8a3b780d599036def3940e8d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>网址：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://revoke.cash/">https://revoke.cash/</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/083dce8034d2633ffe340eb0d7f339d5223aa7f50804d69be0e9888a2cf01606.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h2 id="h-4" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">4. 资产隔离</h2><p>资产重要的钱包可以采用硬件钱包，可以将自己的钱包分为几层钱包组，比如重要蓝筹 nft ，用硬件钱包隔离，平时不常操作。</p><p>中等高频交易的 nft 单独采用 metamask 。</p><p>冲土狗的小额资金，也可以单独新建钱包来使用。</p><h1 id="h-0yuan" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">0元购陷阱的相关文章推荐</h1><p>陈剑大佬：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://jason.mirror.xyz/9z9cPEU6mLHf0vvvimEFXAcc1J7GCzbomft09XhNIWU">https://jason.mirror.xyz/9z9cPEU6mLHf0vvvimEFXAcc1J7GCzbomft09XhNIWU</a></p><p>PANews：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.panewslab.com/zh/sqarticledetails/uzkkjx4i.html">https://www.panewslab.com/zh/sqarticledetails/uzkkjx4i.html</a></p><p>慢雾团队：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.panewslab.com/zh/articledetails/e5oufrll.html">https://www.panewslab.com/zh/articledetails/e5oufrll.html</a></p><p>余弦老板：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/evilcos/status/1590289321046990849">https://twitter.com/evilcos/status/1590289321046990849</a></p><p>好了，以上就是本次被盗的全部复盘，作为一个开发者都没有意识到自己一步步落入黑客的手中，直到看到 setApprove 才意识到自己危险了。更何况，没有编程基础同学的意识。。区块链的安全依然是有门槛的，大家一定要不断学习，不断进步，才能存活下来。</p><p>希望这篇内容可以对大家有所帮助，也欢迎随时来推特 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dami16z">@dami</a> 与我交流。</p>]]></content:encoded>
            <author>yidakoumi@newsletter.paragraph.com (dami.eth)</author>
        </item>
        <item>
            <title><![CDATA[NFT玩家如何提前获取白名单的merkle proof？]]></title>
            <link>https://paragraph.com/@yidakoumi/nft-merkle-proof</link>
            <guid>3rk2vxPmIUMee6q56h1Y</guid>
            <pubDate>Sun, 20 Nov 2022 04:59:46 GMT</pubDate>
            <description><![CDATA[前言嘿，大家好，我是大咪，之前一直关注编程领域。现在入区块链的世界半年，不断关注了NFT、撸空投等领域，偶尔写一写自己的心得体会。目前是 @TBP 的船员，欢迎更多的小伙伴来交流探讨。 同时，也欢迎关注推特：@dami 距离上次写游戏苑那篇文章，已经过去有一段时间，当时评论区留言反馈比较多的是，大家希望可以写一写如何通过技术手段，提前获取到自己白名单的 merkle proof ？ 当然，如果你是已经编程领域的老手，对于爬虫，网络请求都已经非常了解，那本篇可以忽略，本篇文章的面向人群，是非技术领域的 NFT 玩家，本篇尝试用通俗易懂的语言来把原理给大家讲清楚，并且通过举例近期的 NFT 实战项目告诉大家方法。 那么，今天就来用最近我参与过的 NFT 项目，一一来举例。 上篇文章回顾详见，游戏苑文章：https://mirror.xyz/yidakoumi.eth/0Lnbf4ZhFJHM3zlO--JFQr3HTktqKeHsIJlz6ln0_H8浏览器 & 网络请求在正式开始之前，我需要先来科普一下，浏览器和网络请求的一些知识，这些知识不用担心看不懂，我尽量以通俗易懂的图去讲解...]]></description>
            <content:encoded><![CDATA[<h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">前言</h2><p>嘿，大家好，我是大咪，之前一直关注编程领域。现在入区块链的世界半年，不断关注了NFT、撸空投等领域，偶尔写一写自己的心得体会。目前是 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/TheBlackPear1_">@TBP</a> 的船员，欢迎更多的小伙伴来交流探讨。</p><p>同时，也欢迎关注推特：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dami16z">@dami</a></p><p>距离上次写游戏苑那篇文章，已经过去有一段时间，当时评论区留言反馈比较多的是，大家希望可以写一写如何通过技术手段，提前获取到自己白名单的 merkle proof ？</p><p>当然，如果你是已经编程领域的老手，对于爬虫，网络请求都已经非常了解，那本篇可以忽略，本篇文章的面向人群，是非技术领域的 NFT 玩家，本篇尝试用通俗易懂的语言来把原理给大家讲清楚，并且通过举例近期的 NFT 实战项目告诉大家方法。</p><p>那么，今天就来用最近我参与过的 NFT 项目，一一来举例。</p><p>上篇文章回顾详见，游戏苑文章：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/yidakoumi.eth/0Lnbf4ZhFJHM3zlO--JFQr3HTktqKeHsIJlz6ln0_H8">https://mirror.xyz/yidakoumi.eth/0Lnbf4ZhFJHM3zlO--JFQr3HTktqKeHsIJlz6ln0_H8</a></p><h2 id="h-and" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">浏览器 &amp; 网络请求</h2><p>在正式开始之前，我需要先来科普一下，浏览器和网络请求的一些知识，这些知识不用担心看不懂，我尽量以通俗易懂的图去讲解。</p><p>正常情况下，当我们访问一个网站，我们都需要用到浏览器，比如，当我们访问百度，它背后到底发生了什么，我们就能看到百度的主页了？</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/356e034c4361e10cfec2aee4982b716268ee1c58943d319e7ab269fe37bfcc57.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>下图是一个正常我们访问网页的流程：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/621acf5479e721975aa5cc695f63443c6b0e0d06a5dce8b8b5330819d5921cbf.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>我们通过访问浏览器，让浏览器发送一个网络请求到对应的服务器，最终服务器在把数据给我们返回，当然，我这里省略了很多细节，比如浏览器对页面的一些渲染之类的。</p><p>对于非技术小白来说，只需要明白上面的流程，我们在网页上看到的一些数据展示，都是通过远程服务器给我们返回的，服务器，大家可以理解为一台性能很好的电脑即可。</p><p>那，当我们在 MINT NFT 的时候，和项目方做的前端网页究竟发生了怎么样的流程？他们又是怎么获取到我们的 merkle proof 的，我来按照项目来给大家举例。</p><p><strong>举例的顺序，是按照从容易到困难，从常见到极端。</strong></p><h2 id="h-nft-merkle-proof" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">NFT实战举例获取 merkle proof</h2><p>获取 Merkle Proof 一般是在开始前获取，我们可以提前登录到项目的 MINT 网站，然后分析网络请求。以下例子仅限于项目把合约开源了，如果是合约没有进行开源，那就没有意义了。</p><p>比如当时的 dudulab ，合约没开源，都是从前端 mint 的，当时网址还被冲击崩掉了几分钟。</p><h3 id="h-proof" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">后端服务器接口返回 Proof</h3><p>先来讲第一种情况，就是和上面网络请求原理一样，由项目方的后端服务器算出你的 merkle proof，通过网络请求将数据给你返回。</p><h4 id="h-friday-beers" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">Friday Beers</h4><p>这里第一个案例，讲的是 Friday Beers ，10月底，一个永远的痛，当时在推特非常火热，但是如果你当时没来记得跑，那么最终一定是亏了不少。</p><p>让我们来看看，当时他们的网站是什么形式去获取白名单的 merkle proof 的？</p><p>1、下图是当时他们的官网，我们可以在页面上右键，点击 inspect ，如果你是中文，这个单词是检查</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/860c42ed84f3a1707a1a58ef1e4fd60badf14deb22e31f14b4209580b826361d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>2、然后可以看到浏览器下图会弹出来一个铺满代码的新的窗口，点击到 Network，即网络</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5fee2041ad1564c8dcfa4cd1ed9fd6f6394f71c24b0fa0b3055a18fb0bd6b5b8.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>3、然后我们可以通过最简单的方式，直接 Ctrl + F ，搜索关键词【proof】，可以看到下面的图：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4c5e8235bc1e5275d22161000a9bca67fc005da3e1256e4b98fb8a289584f152.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>在文章上面的时候，我们介绍了网络请求，而下面你看到的这些一行行数据，每一行就是一个网络请求。</p><p>4、当你单击地址后，可以看到这个网络请求的网址是什么：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a99c0d6269a28f47922951f458931734ceb497eaff1570586ab9f6525dd981b5.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>同时，如果 Request Method 写的是 GET ，说明我们是可以通过浏览器直接访问这个网址的。</p><p>5、复制 Request URL 的地址到浏览器打开：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/50eefcd3089f3f036576c0bcae264132ddff6352d2b9c0074705ba71aace00d7.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>我们可以看到，这便 Friday Beers 项目方，通过服务器后端给我们返回的 Merkle Proof。</p><p>6、为了好看一些，我们可以把浏览器这个内容全部复制到 json.cn 的网址中，让它自动格式化下，下面的 proof 的内容，便是你当时的 merkle proof 了，如果想通过合约 mint ，只需要观察白名单的 mint 函数是否需要 proof 进行传入：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f2d4eb229a9904061c933aaf6c256ad3c50f2d9b15ec9fe45860658808df01d2.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>当然，这里教大家一个小技巧如何确认，一般使用 merkle tree 作为白名单的项目方，都会在合约的记录中，有一个 Set Merkle Root 的动作，搜到了，一般就是说明当前合约白单使用的是 Merkle Tree，</p><p>打开 etherscan ，可以 Ctrl + F 搜索下：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/796fa3bde1f5e5fc7cf458ff833ec1fdc5909426c0fbb9f3dcf8eee408ff89d3.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h4 id="h-machina" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">Machina</h4><p>有的时候，由于开发人员对命名规则的不同，你不一定能上来直接搜到 proof 相关的网络请求，那怎么去观察查找呢，这里以本周 Machina 项目为例。</p><p>1、依然是浏览器打开【右键-检查】，弹出下面的窗口，点击到 Fetch/XHR ，这个菜单的选项意思是，动态数据的网络请求，都会被过滤出来，然后按顺序从上到下，看看有没有【wl】或者【你的钱包地址】的相关关键词，如果有，一般这个网络请求，就是从服务端获取到的 proof 请求：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5e2e5504d4445dc3a4d0c7ce87138f8b5a9f0cf673084464dd8e1efc1601fde8.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>2、找到后，点击到 Response ，顺便点击下左下角的花括号，可以很好地格式化当前的网络请求响应数据，然后你可以找到 proofs 的内容，便是你的 Merkle proof：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f202894631537070956cf9254583cbcc95af6b6718369c4e65b72a64747c5618.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h4 id="h-" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">游戏苑</h4><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5b2f0b4dc7844e7bf26ffeed300b70f39e7d45e6a0c4904952a7e600bf0fc707.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>有些时候，还有一种情况，获取 proof 的网络请求，会在网站开启 MINT 的时候，才会触发后端获取 proof 的真正网络请求。</p><p>比如当时的游戏苑，如果你通过上面的两种方式去查找 proof ，会发现压根找不到请求。而游戏苑就是这种场景，点击 MINT 后，才会触发后端获取 proof 的真正网络请求。</p><p>但大家可以从上图看到，实际上 MINT 的时候，按钮是置灰的，我们从前端页面是点击不了的。那么，该如何做？</p><p>还是同样的操作，我们可以利用【右键-检查】，先去点击左下方的箭头，然后在点击到项目网站的 MINT 按钮：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/527be552b68b1d594b2fed0818baa850ca82d5d6465cd9045316b061ff2d46ec.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>单击后，可以看到下面的代码变亮了：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/21cbe07cd7efe0ecca0ac521632d9fa62d1bbc475c5673ef084af51f7138d73b.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>然后可以发现，源代码中，有个 disable 的英文，我们双击一下这行代码：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2e2f100be9b87713a4cadf8248c07e1efa1107351bd1f3db46bbe8eecb0563b8.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ccd26d2b6087c272256664ce7b231ee8b8bb96163198cf837794e59561bb8de4.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>删掉后，回车，你会发现，上面的 MINT 按钮变得可以点击了：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5ed4e59c989866e8542e9da9e092a4319cad7e5254c9b185273c986cf2420183.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>后面的操作就正常了，和上面介绍的两个项目中一样，点击后，触发真实的网络请求，得到自己的 proof 即可。</p><p>PS：这招是 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/TheBlackPear1_">@TBP</a> 前端大佬 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/liang3472">@梁哥</a> 教我的，收获颇多，感谢，这里不得不在吹一波 TBP ，氛围是真的好。。各种氛围，懂的都懂~</p><h3 id="h-proof" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">前端代码算出 proof</h3><h4 id="h-" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">海盗</h4><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/fc7e1a872c80a27a6e93ee450fb2f78573ddf933fb1abcc5f1a1aee2f700df68.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>我印象里，海盗这个项目当时 MINT 合约是没开源的，记得当时 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/liang3472">@梁哥</a> 直接撸了一个在线生成 proof 和 16进制的小工具打算给群友使用。</p><p>虽然海盗当时 mint 没开源，但是海盗这个生成 proof 的案例，确是一个很好的案例。</p><p>因为海盗当时的 Merkle root 原地址，是写到前端 js 代码里的，下面来教大家，如果项目从后端接口中没有返回 proof，那么前端如何查找到自己的 proof。</p><p>1、首先，如果你知道自己是白，那么，同样的操作，按照下图，点到 NetWork（网络），点击到 JS 菜单（目的是过滤出 js 相关文件），然后 Ctrl + F 直接搜素自己的白单钱包地址，</p><p>然后最关键的一步，靠耐力和经验，通过 js 的文件名，猜测哪个文件是最有可能包含真实信息的，当时我看有个叫 mintxx.js ，意思就是在 mint 时候，和浏览器发生交互的 js 文件：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/83ae8ccf0044aae4be9547eba4f034da3b223220d1f75b1c98cfcee5f3a51d53.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>2、直接单击，同样点击到Response，然后左下方的代码格式化：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7f962e11bc3c78523947b6f2a02f91ab7d120c8e85e12769bf7e49d054eecb01.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>3、格式化好后的代码很整齐，但由于浏览器不便于查找，你可以全选，复制：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d0cd2bc7d08a3423cd4e68bc6f37111c9c6815815d9ec59f0b585ab79743b7d6.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>4、开发人员一般都有 vscode 编辑器，对于非技术人员，你可以直接新建一个 word 或者 txt 文档，直接粘贴进来。</p><p>然后全局搜索自己的钱包地址：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d519d824790e526b23785b53d3788bc1eae48dc79220b2e0cd50737955599793.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>可以看到，var sc = 后面的这一堆地址，就是要生成 Merkle tree 的源头钱包地址，对 merkle tree 原理不熟悉的同学，回顾我这篇游戏苑文章：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/yidakoumi.eth/0Lnbf4ZhFJHM3zlO--JFQr3HTktqKeHsIJlz6ln0_H8">https://mirror.xyz/yidakoumi.eth/0Lnbf4ZhFJHM3zlO--JFQr3HTktqKeHsIJlz6ln0_H8</a></p><p>有了全部的白名单钱包源地址和你自己的地址后，我们可以通过下面这个网站，直接生成自己的 merkle proof：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://lab.miguelmota.com/merkletreejs/example/">https://lab.miguelmota.com/merkletreejs/example/</a></p><p>用法如下，把你拿到的所有钱包地址，全部复制到 input 框里，然后选到 Keccak-256，点击计算即可：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e768b7123d984892380ba848699de69baf6be84479099dd8977adf7e297643b9.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>下面找到自己的钱包地址，便可以获取到对应的 proof 了：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0a737fa25d6df59c9dc544d3b0485b7282cd688c874a2bcb1d22d45abf124b04.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9d2be25de2d9a87c4a5e8a30d7a701ad69a8c6ff0d4e3f1a5254842137d5a34f.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">最难搞的一种情况</h3><h4 id="h-tsukimi" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">tsukimi</h4><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b47fa129e5b3ad7962f9857f1a7017a4cd1dbecfba57a0c912484dfaf376b4ec.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>如果是合约中，需要带签名的这种，对于技术小白来说就直接放弃吧，花钱使用现成的工具，或者直接求助于有代码功底的朋友。</p><p>什么样子的合约 mint 是签名类的，就像下图的 tsukimi 一样，在合约中找到对应的 mint 方法，一般都有个下面的名称：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/567750c0018bce051423ba1e8fa33fa64ec1830c2e12625e019f684bc7120bc0.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>我们也可以找到一笔成功的链上数据去看下：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2a9e2987d427251cb4a4f18f162a18e1f3dcbc36d1544939120a0d2ee09cba5d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>如果是有编程经验的人，需要了解 web 逆向相关的知识，与其说是逆向，不如说是断点调试的功底，只要会用浏览器 debug ，打好断点，一步步找到对应的加签方法，最终还是能跑出结果的。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">结语</h3><p>好了，以上就是本文的全部内容了，希望你看完后能有所收获。</p><p>关于合约 MINT 的详情，看第一篇内容比较好，我当时在测试网上部署了游戏苑的合约，有需求的小伙伴可以联系我哈！</p><p>PS：欢迎更多有才能的小伙伴共同加入 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/TheBlackPear1_">@TBP</a> 一起在 NFT 世界航行，共创社区~</p>]]></content:encoded>
            <author>yidakoumi@newsletter.paragraph.com (dami.eth)</author>
        </item>
        <item>
            <title><![CDATA[游戏苑Yu-Gi-Yn从代码层面复盘mint]]></title>
            <link>https://paragraph.com/@yidakoumi/yu-gi-yn-mint</link>
            <guid>VdBLzdJYPUcYJjbgPMJt</guid>
            <pubDate>Sun, 23 Oct 2022 05:37:21 GMT</pubDate>
            <description><![CDATA[前言嘿，大家好，我是大咪，之前一直关注编程领域。现在入区块链的世界半年，不断关注了NFT、撸空投等领域，偶尔写一写自己的心得体会。目前是 @TBP 船员。 欢迎关注推特：@dami 游戏苑是10月近期一个比较热的项目，总量 8888 ，官方锁仓 4444 ，白单超发，每个钱包白单可以 mint 2个，每个 0.07777。游戏苑官网 其项目背景和团队都非常强（mint后，大咪又听了下官方 mod 的 AMA ，说是目前接触的项目方中， web2 资源实力已经是位列前茅的了）Founder - @Rock，是日本第二大的广告公司-博报堂的前CCO/副社长，目前是跨国广告公司Zero Unity的CEO，专攻digital service/brand marketing，Web2/Web3资源与经验丰富。艺术家 - 主设计神护熊平，他的3D视频在Youtube播放量高达一千万。其余艺术指导/创意总监，在日本设计圈内也是小有名气的人物。在9月底的时候，就有看到很多 alpha 社区在 call 了，同时，游戏苑和各大社区的合作白明显有超发的趋势。 在白单超发的情况下，必然当天是异常火爆...]]></description>
            <content:encoded><![CDATA[<h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">前言</h2><p>嘿，大家好，我是大咪，之前一直关注编程领域。现在入区块链的世界半年，不断关注了NFT、撸空投等领域，偶尔写一写自己的心得体会。目前是 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/TheBlackPear1_">@TBP</a> 船员。</p><p>欢迎关注推特：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dami16z">@dami</a></p><p>游戏苑是10月近期一个比较热的项目，总量 8888 ，官方锁仓 4444 ，白单超发，每个钱包白单可以 mint 2个，每个 0.07777。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a27d32020978d5f789daeb0533f3b7384ec0d2122e74c73778c0f4d11f09dbc7.png" alt="游戏苑官网" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">游戏苑官网</figcaption></figure><p> 其项目背景和团队都非常强（mint后，大咪又听了下官方 mod 的 AMA ，说是目前接触的项目方中， web2 资源实力已经是位列前茅的了）</p><ul><li><p>Founder - <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/rockinumber6">@Rock</a>，是日本第二大的广告公司-博报堂的前CCO/副社长，目前是跨国广告公司Zero Unity的CEO，专攻digital service/brand marketing，<strong>Web2/Web3资源与经验丰富</strong>。</p></li><li><p>艺术家 - 主设计神护熊平，他的3D视频在Youtube播放量高达一千万。其余艺术指导/创意总监，在日本设计圈内也是小有名气的人物。</p></li></ul><p>在9月底的时候，就有看到很多 alpha 社区在 call 了，同时，游戏苑和各大社区的合作白明显有超发的趋势。</p><br><p>在白单超发的情况下，必然当天是异常火爆的，所以，提前做好抢购工作的常见手段有 4 种。</p><br><ol><li><p>普通用户，通过官网页面点击 mint （火爆项目往往前端都会经常性出问题）</p></li><li><p>熟悉 etherscan 用法的用户，通过 etherscan 直接绕过前端进行 mint</p></li><li><p>花钱的用户，比如有其他一些 mint 工具，可以直接通过工具和合约进行交互 mint</p></li><li><p>有自己的 mint bot 的科学家，通过代码层面的机器人直接进行 mint</p></li></ol><br><p><strong>但，以上四种，对于游戏苑来说，绕不开的都有一点，就是在进行合约 mint 的时候，关于如何拿到 merkcle proof，也就是现在热门项目所用到的 merkle tree （默克尔树白名单验证）。</strong></p><br><p>可能看到上面的话述，对于普通玩家已经有点迷了，不要慌，<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dami16z">@大咪</a>会尽量用通俗易懂的话述解释清楚。</p><br><h1 id="h-merkle-tree" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Merkle tree（默克尔树）讲解</h1><br><p>首先，大家要知道，merkle tree （默克尔树）是个什么？</p><br><p>对于不懂代码普通玩家来说，它的概念你可以理解为计算机中的一种数据结构（数据结构可以理解为计算机存储数据用的&quot;容器&quot;），目前在 NFT 领域，经常被用于合约相关的白名单验证。</p><br><p>既然 merkle tree 中带了“树”字，大多数也是从现实生活场景中映射到计算机世界中的，生活中，我们都见过大树对吧，长这样：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/75d0a7a51c2a48ae82fc3319810d4c7f8ea246cf45806b116bd4cf88dda7b129.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>它，有根，也有枝干。</p><br><p>而计算机世界中的 merkle tree 却是现实世界树的倒过来，根在最上面，&quot;枝干&quot;（枝干在计算机世界中，被称为，叶子节点）在下面。</p><br><p>我在网上找了一个比较清晰的结构图，大家可以看下：</p><br><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/cb84145e9202105bb0453cfb376bce017fc78eb13d5848b8140323d49dafb40b.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p> 在 NFT 白单验证的过程中，我们把链上数据（钱包地址）作为 merkle tree 的叶子节点（也就是大树的枝干），由每个&quot;枝干&quot;（leaf node），再去生成最终的&quot;树根&quot;（merkle root）。</p><br><p>是不是和现实世界恰好相反？现实世界中的树，是先有根，再有枝干和叶子，而 merkle tree 则是先有&quot;叶子&quot;，再有了根。</p><br><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c19a9aafb889c0821a52c4d23ec5e7e96c2dda24bcf597b195febfcea0b6fb3b.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><br><p>那，代码中，生成了&quot;树根&quot;的作用是什么呢？</p><p>为了验证！</p><br><p>当有了根的数值（类似这样的数值：dd8a848bc98dec5ec445dc38baa207ee2094c9c8cd7f3fb889e0f8bd7eb6ba64）以后，便可以验证你的&quot;叶子&quot;（钱包地址）究竟是不是长在我这棵大树上。</p><br><p>项目方在录入合约的时候，只需要把 merkle tree 的根节点数值录入到合约中即可。（比较节省gas，节省gas就是节省金钱啊，同时，用起来也很方便）</p><br><p>当然，这个验证是需要算法去支撑的，具体细节，普通玩家不需要知道，但你需要知道的是，我们去找这棵&quot;拥有白名单的树&quot;去验证时，<strong>不是直接通过提交我们的钱包地址去向它验证</strong>。</p><br><p>而是需要通过这棵树，通过使用你的钱包进行一些算法处理，最终会给你颁发一个证明（merkle proof），只有把这个证明提交了，并且证明是对的，才能验证你确实是这棵大树的叶子！</p><br><p>证明（merkle proof）一般长什么样子呢？下面这样：</p><pre data-type="codeBlock" text=" [&apos;0x366a19a6fa5c41fece60ed70665f1e97b21aa5d108286ef978f780b5e7779515&apos;,&apos;0x1b0871129921055bb61db5d27746bdcd91dcab8e251ec320198cca437923b2d4&apos;,&apos;0x327a589bb53c374fcc7f74b2a15fc8077b6b49529cfa2cc07cc8930649b0fbae&apos;,&apos;0x22c16b8dc5815c2a81123ad48911147a8b4ffe783adbc0a9275de3d785b2fd64&apos;]
"><code> <span class="hljs-selector-attr">[<span class="hljs-string">'0x366a19a6fa5c41fece60ed70665f1e97b21aa5d108286ef978f780b5e7779515'</span>,<span class="hljs-string">'0x1b0871129921055bb61db5d27746bdcd91dcab8e251ec320198cca437923b2d4'</span>,<span class="hljs-string">'0x327a589bb53c374fcc7f74b2a15fc8077b6b49529cfa2cc07cc8930649b0fbae'</span>,<span class="hljs-string">'0x22c16b8dc5815c2a81123ad48911147a8b4ffe783adbc0a9275de3d785b2fd64'</span>]</span>
</code></pre><br><p>对于普通玩家来说，基础知识了解到这里就够了。</p><p> 如果是开发人员，上面这些内容远远不能满足你的好奇心。</p><br><p>想了解更多细节，推荐两篇文章，写的非常好：</p><p>一篇是A总的教程：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/ninjak.eth/kPBE6QzZeplo72UvGeJOcCEpZZMu9qVMmEu4KDZHzsM">https://mirror.xyz/ninjak.eth/kPBE6QzZeplo72UvGeJOcCEpZZMu9qVMmEu4KDZHzsM</a></p><p>一篇是这个老哥的：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/qiwihui.eth/HRifb9gziR1UvVmRcMjDfDvQ9mq7o7FA6BNuCJMFT00">https://mirror.xyz/qiwihui.eth/HRifb9gziR1UvVmRcMjDfDvQ9mq7o7FA6BNuCJMFT00</a></p><br><p>两篇文章看完，也就懂了 merkle tree 的代码层面用法了。</p><br><p>所以，回归到正题，我们要向合约进行白名单验证，我们需要什么？看完上面的知识，请大声告诉我！</p><p><strong>是不是 merkle proof？（也就是叶子节点对应的证明）</strong></p><br><p>接下来，让我们重回当天游戏苑 mint 的场景。</p><br><h1 id="h-whitelist-mint" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Whitelist mint时发生的问题</h1><br><p>先知道一点，游戏苑这次 whitelist 的中奖有两种情况。</p><p><strong>一种是通过 premint 抽奖中奖的用户，还有一种是通过社区合作，直接走的 DTC （地址直接进合约录入）</strong></p><br><p>继续看下当时的 mint 网站。 </p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">前端网站</h2><br><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5b2f0b4dc7844e7bf26ffeed300b70f39e7d45e6a0c4904952a7e600bf0fc707.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p> 找不到当时的 mint 的截图，假设现在已经开启，按照当时的场景，其实上面的 MINT 按钮是黑色可以点亮的。</p><br><p>于是，问题出现了，有一部分人（包括我自己在内，premint抽奖中的白单）无法通过网页直接 mint ，随后打开浏览器开发者工具（谷歌浏览器，点击F12），找到了调用后端接口获取 merkle proof 的接口：</p><br><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://backend.yu-gi-yn.com/merkle-proof.json?&amp;address=0x">https://backend.yu-gi-yn.com/merkle-proof.json?&amp;address=0x</a></p><br><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c8e45578fea7d25e84bd8782838c65285d9236f48402591843da806c1d1a0956.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>正是这个接口，当时没有成功返回 merkle proof 导致前端页面无法正常 mint 。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a16747080b33d282899181264dd4533e321182df4f7ff496b4f2158a6015d2a7.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><br><p>前面的知识点讲过，我们把自己的钱包地址提交给 merkle tree，由它来帮我们生成一段 merkle proof，结果现在返回的是空，必然和合约进行交互的时候，就会有问题了。</p><br><p>这事儿一出来，当时 dc 社区中出现了不少 fud 的声音，也有一帮科学家很机智，开始抓紧时间找原因。</p><br><p>过了一段时间，有个大佬说，是因为游戏苑当时后端接口，对于钱包地址没有做大小写匹配导致返回查询不到 merkle proof。</p><br><p>premint当时提交的钱包地址，是类似下面这样，大小写混合组成的钱包地址：</p><p>0xb825f7406f485914D2d28098D8e22F22A36AEe81</p><br><p>而如果你当时的地址在白名单中，只需要把钱包的大写字母，全部转为小写，然后在拼接到这个地址上：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://backend.yu-gi-yn.com/merkle-proof.json?&amp;address=0x">https://backend.yu-gi-yn.com/merkle-proof.json?&amp;address=0x</a></p><br><p>就能正常返回结果了。（没有保留当时的截图）</p><br><p>后来仔细一想，猜测其实是因为后端人员对地址做了缓存，才导致了这样的结果。。。后来很多人也反馈，发现走 DTC 的用户都可以正常从页面上进行 mint 。而 premint 的部分用户却不行，就是这个原因。</p><br><p>但，现在说啥也不重要了，重要的是，假如当时的你，通过该地址全部转成小写，并且成功拿到了 merkle proof，接下来要怎么做？</p><br><h2 id="h-etherscan-mint" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">善用 etherscan，走合约直接 mint</h2><br><p>这就到了我上面提到的 4 种方法的第二种，一般情况，etherscan是不会轻易挂掉的。但也不是没有意外情况，概率很低。</p><br><p>学会使用 etherscan ，对于普通玩家来说，也是至关重要的一环，如果你会了这种方式，即使前端页面挂掉了，你也可以正常的去 mint 。</p><br><p>为了复现当时的场景，我们先来打开当时以太坊主网 etherscan mint 时的交易记录，首先打开 opensea，复制合约地址：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://opensea.io/assets/ethereum/0x477f885f6333317f5b2810ecc8afadc7d5b69dd2/8192">https://opensea.io/assets/ethereum/0x477f885f6333317f5b2810ecc8afadc7d5b69dd2/8192</a></p><br><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1b60c717713fabeb2d30fe8b572c0ca50575dabd238513e32361ab8e562fb3f6.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><br><p>打开 etherscan 上直接搜索地址：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/address/0x477f885f6333317f5b2810ecc8afadc7d5b69dd2">https://etherscan.io/address/0x477f885f6333317f5b2810ecc8afadc7d5b69dd2</a></p><br><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d9a1fc43907a1d9a8127681fb106fda7dd9b79ab9d1f1e8f4a32d91f15c8efe0.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p> 查看历史交易记录， method 一般带有 mint 相关单词，意味着是 mint 的方法：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/txs?a=0x477f885f6333317f5b2810ecc8afadc7d5b69dd2&amp;p=190">https://etherscan.io/txs?a=0x477f885f6333317f5b2810ecc8afadc7d5b69dd2&amp;p=190</a></p><br><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2df2df345db42a3d71798295a2ae425654682518ce34e3b49fd33e647c0a948e.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><br><p>随便点进去看一笔，拉到 input data处，点击 Decode input data：</p><br><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ad450bb60473a35b7f55d7807bc7bd623cfcd24f8897e434f2262da76e8ca308.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><br><p>点击这个之后，可以把它变成我们看得懂的东西，第一个是数量，可以看到data为2，意味着是mint了2个，后面 merkleProof 则是字节32的数组，可以看到它的内容，就是上面我提到的知识点里的类似内容：</p><br><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ebd0a09d5fad024b7615b38c53431d0b7f7546b4817e3fd705e6227c1f50f6fa.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><br><p>查看了当时正常 mint 成功的交易记录后，我们如何通过 etherscan 进行 mint ？</p><br><p>回到合约初始页，点击 contract - write contract：</p><br><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/501ec905f7c61498f8ec3116a37a1f1872cacaec498a7a4a0b0713bd48ca5fee.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><br><p>先正常链接钱包，然后找到刚才交易成功数据中，method 为【saleStageMint】对应的框框：</p><br><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/730ad7c3a2079748273e5384327ca769f988292b4ab4481bf794290271d6ffd3.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>点开后，长这样：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/281bf6f200f1b0b36f993ec33d5c04bb375e607b00a07ccaa7e7516cff133ba2.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><br><p>1、payableAmount(ether)</p><p>一个个说，首先是交易金额，单位是eth，这个是指不涵盖 gas ，单纯的 mint 价格，如果你不知道写多少，可以回到别人成功的交易记录，能看到 value 值，1个就是 0.0777，2个就是0.1554</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/txs?a=0x477f885f6333317f5b2810ecc8afadc7d5b69dd2&amp;p=190">https://etherscan.io/txs?a=0x477f885f6333317f5b2810ecc8afadc7d5b69dd2&amp;p=190</a></p><br><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/48521c9d50d3673b768b129603ddf3d31b691d5954807353bb752ba4cc677e5e.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>2、quantity(uint256)</p><p>要mint的数量，1个就写1，2个就写2，好项目直接拉满。</p><br><p>3、merkle proof（byte32[]）</p><p>这个就是写前面基础知识介绍到的，如果你通过游戏苑后端接口获取到了 merkle proof，类似这种代码：</p><pre data-type="codeBlock" text="[&apos;0x366a19a6fa5c41fece60ed70665f1e97b21aa5d108286ef978f780b5e7779515&apos;,&apos;0x1b0871129921055bb61db5d27746bdcd91dcab8e251ec320198cca437923b2d4&apos;,&apos;0x327a589bb53c374fcc7f74b2a15fc8077b6b49529cfa2cc07cc8930649b0fbae&apos;,&apos;0x22c16b8dc5815c2a81123ad48911147a8b4ffe783adbc0a9275de3d785b2fd64&apos;]
"><code><span class="hljs-selector-attr">[<span class="hljs-string">'0x366a19a6fa5c41fece60ed70665f1e97b21aa5d108286ef978f780b5e7779515'</span>,<span class="hljs-string">'0x1b0871129921055bb61db5d27746bdcd91dcab8e251ec320198cca437923b2d4'</span>,<span class="hljs-string">'0x327a589bb53c374fcc7f74b2a15fc8077b6b49529cfa2cc07cc8930649b0fbae'</span>,<span class="hljs-string">'0x22c16b8dc5815c2a81123ad48911147a8b4ffe783adbc0a9275de3d785b2fd64'</span>]</span>
</code></pre><p>那么就可以直接写到这里了，但是，需要注意怎么写，格式要按照下面这样写：</p><p> <strong>不能有单引号，双引号，空格，逗号用英文的！</strong></p><br><p>[0x8d56a688f6bc1c30427c4ab6b0958819e000b43c8c0ab543bf28a8a32f89b0db,0xc6caa9cb444c2879af3f1f60d999a24acd75ec11217e40a9f123c1d3ebb4b825,....(这里不是省略号，一直顺着复制到最后)]</p><br><p>最终填的数据：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/409a8eab8ef1bd5fc11a02621085b29aba25f1512397beb4bd8d9cc38d39490d.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><br><p>但注意，如果有空格出现，你就会看到上面这样的报错，仔细检查，否则不让你点 write。</p><br><p>正确的去掉空格后，点击 write 可以成功唤起小狐狸，后续流程就正常的调节 gas ，正常确定就好了：</p><br><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/73b601507b67ff2bc597678f34c6377756c396fa924ed0d9eef5c215da9af463.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><br><h2 id="h-mint" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">测试网模拟合约mint</h2><br><p>为了更好的练手，我在 goerli 测试网上部署了游戏苑的合约，当然，我把价格改的非常低了，0**.**003 就可以直接 mint 一个。</p><br><p>合约地址如下：</p><br><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://goerli.etherscan.io/address/0x835f3d61463e0e4bf5be2adbbfdb7cc6dc6b5cbd">https://goerli.etherscan.io/address/0x835f3d61463e0e4bf5be2adbbfdb7cc6dc6b5cbd</a></p><br><p>goerli测试网领测试币地址（可以自己先去挖点，再去 mint ）：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://goerli-faucet.pk910.de/">https://goerli-faucet.pk910.de/</a></p><br><p>当然，如果你也想连连手，可以在本条推特下留言，留下你的测试钱包，我给你添加完白名单后，会发你对应的 merkle proof，这样你就可以愉快地玩耍了。</p><br><p>像下面都是我自己测试着玩的，你可以跟着这些成功的按照上面的流程进行学习：</p><br><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9d7dfd6ed2f051e6c8052e72e290b42963fb080a05dd91cfe6b57194fa770d3c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><br><h1 id="h-" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">结语</h1><br><p>好了，以上就是本文的全部内容了，希望你看完后能有所收获。</p><p>最后，也非常感谢<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/Asennn_1">@🦈哥</a>的投喂，正因为走了 DTC ，所以这波游戏苑还是 mint 到了，跟着🦈哥吃肉肉，也欢迎更多有才能的小伙伴共同加入 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/TheBlackPear1_">@TBP</a> 一起在 NFT 世界航行</p><br><br>]]></content:encoded>
            <author>yidakoumi@newsletter.paragraph.com (dami.eth)</author>
        </item>
        <item>
            <title><![CDATA[2022年区块链twitter大V推荐榜单]]></title>
            <link>https://paragraph.com/@yidakoumi/2022-twitter-v</link>
            <guid>2hMZfypiJWlWvsWlqY1h</guid>
            <pubDate>Sun, 04 Sep 2022 23:14:20 GMT</pubDate>
            <description><![CDATA[前言嘿，大家好，我是大咪，之前一直关注编程领域。现在入区块链的世界半年，不断关注了NFT、撸空投等领域，偶尔写一写自己的心得体会。 欢迎关注推特：@dami 昨天闲来无聊，爬取了下我关注的 290 个推特人群，其中包含了一些区块链的大V，也包含了一些区块链相关的项目方账号。 今日 来分享分享下，我所爬取成功的数据结果，感兴趣和我一起看下去吧。爬取思路首先，我关注的推特群体里分为了以下几类： NFT 相关的大/小V NFT 相关的项目方 B 圈相关的大/小V B 圈相关的投资机构 而这几类人群，是这半年入圈以来纯手工筛选和参与过的，质量和垂直度有一定保障，胜过"机选"。有了我这部分关注的高质量信息博主列表，如何拓展思路，获得更多其他高质量信息且关注人数多的博主？采用交叉验证爬取他们主动关注的博主列表统计每个人关注其他博主的次数如 A 关注 B ，B记为1次 如 C 关注 B ，B则记为2次上面通过的思路，将 290 个人的关注列表，每个博主落地生成一个 json 文件，里面存的信息就是他们所关注的另外一批博主。 文件跑完，通过上述统计，可以得到一张下面的表格：数据分享被大v相关之间...]]></description>
            <content:encoded><![CDATA[<h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">前言</h2><p>嘿，大家好，我是大咪，之前一直关注编程领域。现在入区块链的世界半年，不断关注了NFT、撸空投等领域，偶尔写一写自己的心得体会。</p><p>欢迎关注推特：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dami16z">@dami</a></p><p>昨天闲来无聊，爬取了下我关注的 290 个推特人群，其中包含了一些区块链的大V，也包含了一些区块链相关的项目方账号。 今日 来分享分享下，我所爬取成功的数据结果，感兴趣和我一起看下去吧。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7a91ed1fac683556f6998d172febdb64aad1691d7b1ebc82e65cf53f87d32963.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">爬取思路</h2><p>首先，我关注的推特群体里分为了以下几类： NFT 相关的大/小V NFT 相关的项目方 B 圈相关的大/小V B 圈相关的投资机构 而这几类人群，是这半年入圈以来纯手工筛选和参与过的，质量和垂直度有一定保障，胜过&quot;机选&quot;。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e0c18be4de03024e57ca8eab7c8503dd06e2550bc1e70cea164fb69d2393fbe5.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>有了我这部分关注的高质量信息博主列表，如何拓展思路，获得更多其他高质量信息且关注人数多的博主？</p><ul><li><p>采用交叉验证</p></li><li><p>爬取他们主动关注的博主列表</p></li><li><p>统计每个人关注其他博主的次数</p></li><li><p>如 A 关注 B ，B记为1次 如 C 关注 B ，B则记为2次</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c7c38f96536c26c3130e440d8d900d69dfd03b4fb9dee85d3d32154da347caad.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>上面通过的思路，将 290 个人的关注列表，每个博主落地生成一个 json 文件，里面存的信息就是他们所关注的另外一批博主。 文件跑完，通过上述统计，可以得到一张下面的表格：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9530fd930dfe420d5be4d6d09ca447fa8da52c8d4dbf34b29fd71c1dddedd4ad.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">数据分享</h2><p>被大v相关之间关注最多的</p><ul><li><p>No.1 V神 107次</p></li><li><p>No.2 神鱼 100次</p></li><li><p>No.3 匿名博士 88次</p></li></ul><p>就分享前3了，就不一一列举了，感兴趣的话大家可以自取啦，分享到 googlesheet 啦：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.google.com/spreadsheets/d/1mU3tcHtVnx9g1eGczTdO9_W1AuFKTxktHSBmwBSkrqE/edit?usp=sharing">https://docs.google.com/spreadsheets/d/1mU3tcHtVnx9g1eGczTdO9_W1AuFKTxktHSBmwBSkrqE/edit?usp=sharing</a></p>]]></content:encoded>
            <author>yidakoumi@newsletter.paragraph.com (dami.eth)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/336a93e85fbbd23038755f38f777d26c107060774bda73e652f128130b843cd5.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[交互教程之.bit,融资1300万美元的Web3身份协议]]></title>
            <link>https://paragraph.com/@yidakoumi/bit-1300-web3</link>
            <guid>E4Z6C8U8jMnrTdq1jQLe</guid>
            <pubDate>Tue, 16 Aug 2022 13:35:58 GMT</pubDate>
            <description><![CDATA[前言嘿，大家好，我是大咪，之前一直关注编程领域。现在偶尔也会关注撸毛交互等项目。 欢迎关注推特：@dami2333 今天看到了 .bit 融资的消息，推塔上看到不少教程，前面的还好，后面dc认证身份的步骤，一直是被误导的，于是想着顺手写一篇教程，分享下自己交互的心得和坑。 不怕一万，就怕万一，以防错误类似 ENS 的机会，花掉小钱”博个未来”，交互成本约 $5 一个 .bit 协议。 先来看下，.bit 是个啥？ .bit是一种基于区块链的开源去中心化身份协议，致力于为个人用户和DAO提供无需许可且不可撤销的去中心化身份，在全球范围内树立身份主权意识。 融资信息： Web3 身份协议.bit （原 DAS）宣布完成 1300 万美元 A 轮融资，由 CMB International、HashKey Capital,、QingSong Fund、GSR Ventures、GGV Capital、SNZ 领投。交互教程交互分为两部分，一个是注册 .bit ，另一个是dc认证身份注册.bit首先，打开网站： app.did.id 发挥你的想象：注册：懒得去弄 CKB 了，直接以太坊交...]]></description>
            <content:encoded><![CDATA[<h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">前言</h2><p>嘿，大家好，我是大咪，之前一直关注编程领域。现在偶尔也会关注撸毛交互等项目。</p><p>欢迎关注推特：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dami2333">@dami2333</a></p><p>今天看到了 .bit 融资的消息，推塔上看到不少教程，前面的还好，后面dc认证身份的步骤，一直是被误导的，于是想着顺手写一篇教程，分享下自己交互的心得和坑。</p><p>不怕一万，就怕万一，以防错误类似 ENS 的机会，花掉小钱”博个未来”，交互成本约 $5 一个 .bit 协议。</p><p>先来看下，.bit 是个啥？</p><p>.bit是一种基于区块链的开源去中心化身份协议，致力于为个人用户和DAO提供无需许可且不可撤销的去中心化身份，在全球范围内树立身份主权意识。</p><p>融资信息：</p><p>Web3 身份协议.bit （原 DAS）宣布完成 1300 万美元 A 轮融资，由 CMB International、HashKey Capital,、QingSong Fund、GSR Ventures、GGV Capital、SNZ 领投。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">交互教程</h2><p>交互分为两部分，一个是注册 .bit ，另一个是dc认证身份</p><h3 id="h-bit" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">注册.bit</h3><p>首先，打开网站：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://app.did.id/explorer?inviter=521521521.bit">app.did.id</a></p><p>发挥你的想象：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/80553eab1c3b3cc39729e3224309fff0489f4def388d687f29cb7dcf501c6293.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>注册：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/defa4b327bcff2afc491f9d77ce5a375a8bfef07766817967604796f6a010dfd.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>懒得去弄 CKB 了，直接以太坊交互：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a4bcb72274bd4f71174aca4e9ae3fd2070d2665f663ac9029223f64b0aed5818.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>等几分钟，注册后：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ec07e342138ad5f368f72802ec85082dcd3cbe632eb186f3d5433850d2e08056.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>点击管理：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ef6ea80c87cad998f36d33b00a5048810a139286489d9398990c2543d132345a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>点击 Add New ，key 选择 discord，</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1bec4be5f4d22548403a84212e3936a8c1d74d7e646c3d394a8ca88d31b7d82c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>discord复制你的discordid，写到上面的空行里：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8f32540c2770787610f36b8e5488a04399e267351417578056e3f362ceb2c1d7.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>添加完毕后，别忘记点击 save：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1c5c9b8d0dd0eb2e500aba8c067a34e7723851aed15b8843fcac74320f29e635.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-dc" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">dc认证</h3><p>官方的dc邀请链接：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://discord.gg/9eCwFfbv82">https://discord.gg/9eCwFfbv82</a></p><p>然后点击下面的验证账户：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6e103249a9545f92127304f4ac4dd3b1115dd60357a35aae43fa86b2e64f1380.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>输入命令：</p><pre data-type="codeBlock" text="!verify xxxx.bit
"><code><span class="hljs-operator">!</span>verify xxxx.bit
</code></pre><p>注意，verify后面有个空格，你可以直接复制我上面的命令，把bit改为你自己的即可。</p><p>至此，完。so easy~</p>]]></content:encoded>
            <author>yidakoumi@newsletter.paragraph.com (dami.eth)</author>
        </item>
        <item>
            <title><![CDATA[Truffle部署Solidity合约教程（etherscan多文件自动开源）]]></title>
            <link>https://paragraph.com/@yidakoumi/truffle-solidity-etherscan</link>
            <guid>QRBtl1w9MaehI8yP0k0t</guid>
            <pubDate>Sun, 12 Jun 2022 15:12:41 GMT</pubDate>
            <description><![CDATA[前言最近一直在折腾 Solidity 合约的学习，虽然现在普通的合约代码能看懂了，但是一直好奇如何把合约部署到链上。 最开始学习的方式是通过官方 Remix 的网站进行部署，单文件还好说，多文件开源起来非常麻烦。 后来得知了两个部署框架，一个是以 Python 为主语言的开发框架 Brownie ，还有一个是以 Js 为主语言的开发框架 Truffle ，还有是 Js 的一个 Hardhat，还没有尝试用过。 Truffle 和 Brownie 在流程体验上，可以说学会了一个，另一个也大概就明白什么意思了，但得益于 Truffle 初始化工程项目后，生成的配置文件 truffle-config.js 比 Brownie 默认的配置文件友好许多。 如下，起码会有很多默认的注释掉的配置，让新手看起来就通俗易懂：所以，分享下今天一天的踩坑经验，就来讲讲如何把一个合约通过 Truffle 从零部署到测试网上，同时使用代码自动验证开源，不需要手动去 etherscan 去复制代码，贴代码进行验证发布并开源。正文一、初始化工程这里的安装依赖，假设你已经安装好了 nodejs 。 1、通过 n...]]></description>
            <content:encoded><![CDATA[<h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">前言</h2><p>最近一直在折腾 Solidity 合约的学习，虽然现在普通的合约代码能看懂了，但是一直好奇如何把合约部署到链上。</p><p>最开始学习的方式是通过官方 Remix 的网站进行部署，单文件还好说，多文件开源起来非常麻烦。</p><p>后来得知了两个部署框架，一个是以 Python 为主语言的开发框架 Brownie ，还有一个是以 Js 为主语言的开发框架 Truffle ，还有是 Js 的一个 Hardhat，还没有尝试用过。</p><p>Truffle 和 Brownie 在流程体验上，可以说学会了一个，另一个也大概就明白什么意思了，但得益于 Truffle 初始化工程项目后，生成的配置文件 truffle-config.js 比 Brownie 默认的配置文件友好许多。</p><p>如下，起码会有很多默认的注释掉的配置，让新手看起来就通俗易懂：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/eeeadc86ba389922305dcb21d896541a768fa07418391948063680ac36c330d8.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>所以，分享下今天一天的踩坑经验，就来讲讲如何把一个合约通过 Truffle 从零部署到测试网上，同时使用代码自动验证开源，不需要手动去 etherscan 去复制代码，贴代码进行验证发布并开源。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">正文</h2><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">一、初始化工程</h3><p>这里的安装依赖，假设你已经安装好了 nodejs 。</p><p>1、通过 nodejs 安装 truffle 框架：</p><pre data-type="codeBlock" text="// 1. 安装 truffle
npm install -g truffle
"><code><span class="hljs-comment">// 1. 安装 truffle</span>
npm install <span class="hljs-operator">-</span>g truffle
</code></pre><p>2、新建项目，切到项目目录下，执行 truffle init：</p><pre data-type="codeBlock" text=" // 2. 使用 init 命令对项目进行初始化 
truffle init
"><code> <span class="hljs-comment">// 2. 使用 init 命令对项目进行初始化 </span>
truffle <span class="hljs-keyword">init</span>
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/215a23c72c940af6f51f830625d29844f3a6b8e25ba4234df20c9cf8e12f533a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>我这里新建了一个目录，叫 my-first-truffle，执行完命令后，目录如下：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8cdb32b2f4fb059f283c6b440e37c5996b6716992088142ad9d1328541924720.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>但一般当我们编译 solidity 文件和引入依赖后，往往项目会变成这样：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5e609fc578058e6449f6ef2d8a95b69ea3f78bfe4d1f86eff4aa4e36464c866f.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>解释：</p><pre data-type="codeBlock" text="--build: 存放编译后文件的目录
--contracts: solidity合约代码的目录
--migrations: 用 js 语言写的部署用的文件
--node_modules: js的项目依赖
--test: 用 js 语言写的单元测试目录
  --package.json: 依赖的配置文件
  --truffle-config.js: truffle框架的配置文件 以上就是一个新工程初始化后的样子。
"><code><span class="hljs-operator">-</span><span class="hljs-operator">-</span>build: 存放编译后文件的目录
<span class="hljs-operator">-</span><span class="hljs-operator">-</span>contracts: solidity合约代码的目录
<span class="hljs-operator">-</span><span class="hljs-operator">-</span>migrations: 用 js 语言写的部署用的文件
<span class="hljs-operator">-</span><span class="hljs-operator">-</span>node_modules: js的项目依赖
<span class="hljs-operator">-</span><span class="hljs-operator">-</span>test: 用 js 语言写的单元测试目录
  <span class="hljs-operator">-</span><span class="hljs-operator">-</span>package.json: 依赖的配置文件
  <span class="hljs-operator">-</span><span class="hljs-operator">-</span>truffle<span class="hljs-operator">-</span>config.js: truffle框架的配置文件 以上就是一个新工程初始化后的样子。
</code></pre><p>别忘记，回到命令行，对 npm 进行工程初始化，我这里用的 cnpm ，cnpm init，然后疯狂回车，一路默认即可：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c023bf1224b2647c52f0e39c9df8dc1a9703d939419127e7b19fe1508eeca7ef.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">二、编写用例合约</h3><p>我这里编写一个自己的 token 用例，这里继承了 ERC20 ，为的就是让合约文件本身有 import 的操作，这样便可以验证在后面的 truffle 自动部署并且验证开源到 etherscan 上。</p><p>代码注释写的很清楚了，有基础的自然看的懂，代码不是本文的重点，部署流程才是。</p><p>新建一个合约文件 DaMiToken.sol ，新建一个部署合约的 js 文件 2_deploy_mitoken.js ：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b672818bad32a7e1b8cf46715d5626e1c4df6f39dac7f40394f14a58044432ef.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>需要注意的是，在 migrations 目录下的部署文件名是有规则的，前缀以数字下划线命名 1_ 、2_ ...，这样每次 truffle 部署就可以根据数字去维护合约是否重复部署过（具体可以看 Migrations.sol 合约文件是如何实现的），如果之前部署过，下次在执行部署命令就不会重复执行了。</p><p>合约代码如下 ：</p><pre data-type="codeBlock" text="import &quot;@openzeppelin/contracts/token/ERC20/ERC20.sol&quot;;
import &quot;@openzeppelin/contracts/access/Ownable.sol&quot;;
import &quot;@openzeppelin/contracts/utils/math/SafeMath.sol&quot;;
//SPDX-License-Identifier: MIT
pragma solidity 0.8.11;

contract DaMiToken is ERC20, Ownable {

    using SafeMath for uint256;

    //项目方地址
    address public projectAddress;
    //手续费千分比 txFeeRatio/1000
    uint256 public txFeeRatio;
    //销毁千分比 burnRatio/1000
    uint256 public burnRatio;

    /**
     * - 阅读 openzeppelin 中的 ERC20 源码，在标准 ERC20 基础上，开发以下功能的 ERC20 合约：
     * - 支持项目方增发的功能
     * - 支持销毁的功能
     * - 支持交易收取手续费至项目方配置的地址
     */
    constructor(
        string memory name_,
        string memory symbol_
    ) ERC20(name_, symbol_) {
    }

    //增发代币功能,空投
    function mint(address _account ,uint256 _amount) public onlyOwner {
        //新增多少的数量，进行相加
        _mint(_account, _amount);
    }

    //销毁代币
    function burn(uint256 _amount) public {
        require(balanceOf(msg.sender) &gt;= _amount,&quot;burn amount exceeds  balances&quot;);
        _burn(msg.sender, _amount);
    }

    //交易收取手续费至项目方配置的地址
    function transfer(address _to, uint256 _amount) public virtual override returns (bool) {
        //交易数量
        uint256 txFee = _amount.mul(txFeeRatio).div(1000);
        //燃烧掉的数量
        uint256 burnAmount = _amount.mul(burnRatio).div(1000);
        uint256 amount = _amount.sub(txFee).sub(burnAmount);
        //给项目方设置的地址转交易费
        _transfer(msg.sender,projectAddress ,txFee);
        _transfer(msg.sender, _to,amount);
        if (burnAmount &gt; 0) {
            _burn(msg.sender, burnAmount);
        }
        return true;
    }

    //设置地址和交易费比例
    function setProjectAddress(address _projectWallet, uint256 _txFeeRatio,uint256 _burnRatio)
        external
        onlyOwner
    {
        projectAddress = _projectWallet;
        txFeeRatio = _txFeeRatio;
        burnRatio = _burnRatio;
    }
}
"><code><span class="hljs-keyword">import</span> <span class="hljs-string">"@openzeppelin/contracts/token/ERC20/ERC20.sol"</span>;
<span class="hljs-keyword">import</span> <span class="hljs-string">"@openzeppelin/contracts/access/Ownable.sol"</span>;
<span class="hljs-keyword">import</span> <span class="hljs-string">"@openzeppelin/contracts/utils/math/SafeMath.sol"</span>;
<span class="hljs-comment">//SPDX-License-Identifier: MIT</span>
<span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> 0.8.11;</span>

<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">DaMiToken</span> <span class="hljs-keyword">is</span> <span class="hljs-title">ERC20</span>, <span class="hljs-title">Ownable</span> </span>{

    <span class="hljs-keyword">using</span> <span class="hljs-title">SafeMath</span> <span class="hljs-title"><span class="hljs-keyword">for</span></span> <span class="hljs-title"><span class="hljs-keyword">uint256</span></span>;

    <span class="hljs-comment">//项目方地址</span>
    <span class="hljs-keyword">address</span> <span class="hljs-keyword">public</span> projectAddress;
    <span class="hljs-comment">//手续费千分比 txFeeRatio/1000</span>
    <span class="hljs-keyword">uint256</span> <span class="hljs-keyword">public</span> txFeeRatio;
    <span class="hljs-comment">//销毁千分比 burnRatio/1000</span>
    <span class="hljs-keyword">uint256</span> <span class="hljs-keyword">public</span> burnRatio;

    <span class="hljs-comment">/**
     * - 阅读 openzeppelin 中的 ERC20 源码，在标准 ERC20 基础上，开发以下功能的 ERC20 合约：
     * - 支持项目方增发的功能
     * - 支持销毁的功能
     * - 支持交易收取手续费至项目方配置的地址
     */</span>
    <span class="hljs-function"><span class="hljs-keyword">constructor</span>(<span class="hljs-params">
        <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> name_,
        <span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> symbol_
    </span>) <span class="hljs-title">ERC20</span>(<span class="hljs-params">name_, symbol_</span>) </span>{
    }

    <span class="hljs-comment">//增发代币功能,空投</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">mint</span>(<span class="hljs-params"><span class="hljs-keyword">address</span> _account ,<span class="hljs-keyword">uint256</span> _amount</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title">onlyOwner</span> </span>{
        <span class="hljs-comment">//新增多少的数量，进行相加</span>
        _mint(_account, _amount);
    }

    <span class="hljs-comment">//销毁代币</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">burn</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> _amount</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
        <span class="hljs-built_in">require</span>(balanceOf(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>) <span class="hljs-operator">></span><span class="hljs-operator">=</span> _amount,<span class="hljs-string">"burn amount exceeds  balances"</span>);
        _burn(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>, _amount);
    }

    <span class="hljs-comment">//交易收取手续费至项目方配置的地址</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">transfer</span>(<span class="hljs-params"><span class="hljs-keyword">address</span> _to, <span class="hljs-keyword">uint256</span> _amount</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">virtual</span></span> <span class="hljs-title"><span class="hljs-keyword">override</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">bool</span></span>) </span>{
        <span class="hljs-comment">//交易数量</span>
        <span class="hljs-keyword">uint256</span> txFee <span class="hljs-operator">=</span> _amount.mul(txFeeRatio).div(<span class="hljs-number">1000</span>);
        <span class="hljs-comment">//燃烧掉的数量</span>
        <span class="hljs-keyword">uint256</span> burnAmount <span class="hljs-operator">=</span> _amount.mul(burnRatio).div(<span class="hljs-number">1000</span>);
        <span class="hljs-keyword">uint256</span> amount <span class="hljs-operator">=</span> _amount.sub(txFee).sub(burnAmount);
        <span class="hljs-comment">//给项目方设置的地址转交易费</span>
        _transfer(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>,projectAddress ,txFee);
        _transfer(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>, _to,amount);
        <span class="hljs-keyword">if</span> (burnAmount <span class="hljs-operator">></span> <span class="hljs-number">0</span>) {
            _burn(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>, burnAmount);
        }
        <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;
    }

    <span class="hljs-comment">//设置地址和交易费比例</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">setProjectAddress</span>(<span class="hljs-params"><span class="hljs-keyword">address</span> _projectWallet, <span class="hljs-keyword">uint256</span> _txFeeRatio,<span class="hljs-keyword">uint256</span> _burnRatio</span>)
        <span class="hljs-title"><span class="hljs-keyword">external</span></span>
        <span class="hljs-title">onlyOwner</span>
    </span>{
        projectAddress <span class="hljs-operator">=</span> _projectWallet;
        txFeeRatio <span class="hljs-operator">=</span> _txFeeRatio;
        burnRatio <span class="hljs-operator">=</span> _burnRatio;
    }
}
</code></pre><p>部署 js 文件代码：</p><pre data-type="codeBlock" text="const DaMiToken = artifacts.require(&quot;DaMiToken&quot;);

//通过合约部署设置构造函数的 name 和 symbol
module.exports = function (deployer) {
  deployer.deploy(DaMiToken,&quot;DaMiToken&quot;,&quot;DaMi-Token&quot;);
};
"><code>const DaMiToken <span class="hljs-operator">=</span> artifacts.require(<span class="hljs-string">"DaMiToken"</span>);

<span class="hljs-comment">//通过合约部署设置构造函数的 name 和 symbol</span>
module.exports <span class="hljs-operator">=</span> <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">deployer</span>) </span>{
  deployer.deploy(DaMiToken,<span class="hljs-string">"DaMiToken"</span>,<span class="hljs-string">"DaMi-Token"</span>);
};
</code></pre><h3 id="h-truffle" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">三、修改 truffle 配置文件</h3><p>点开 truffle-config.js 文件，可以看到默认生成了很多配置，非常友好：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a2fa8ce51ab18e38c1f400db3a806b9784cde80644c43f6bf9dd430567e1c5a8.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>在配置文件中，默认的测试网使用的是 ropsten 网络，但我这里习惯用 rinkeby 测试网，因为最早学习就是接触的 rinkeby ，所以 ETH 也是在这个网上比较多。</p><p>接下来，我们以 rinkeby 为例，按照默认的文件，仿照修改一下配置文件：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/bfbbb2c6b087dcb70095d21a4ba09f0fd9b9a5e3b4b5be0e8ccf416752c8f6e6.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>除了上图的配置外，这里提几点需要注意的，以及配置的含义：</p><p>第一步，引入依赖 HDWalletProvider</p><pre data-type="codeBlock" text="//安装依赖 @truffle/hdwallet-provider
 cnpm install @truffle/hdwallet-provider
"><code><span class="hljs-comment">//安装依赖 @truffle/hdwallet-provider</span>
 cnpm install @truffle<span class="hljs-operator">/</span>hdwallet<span class="hljs-operator">-</span>provider
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/dd65b47e7d40d364f53438eea04c2fb02d068f1f5320c18703970eb5a89ad647.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>这个是通过钱包和链上节点的交互配置，第一个需要传入你部署合约的钱包私钥 privatekey。我们可以通过环境变量对私钥设置，以防上传代码的时候泄露出去。</p><pre data-type="codeBlock" text="//环境变量私钥
var privateKey = process.env.privateKey;
"><code><span class="hljs-comment">//环境变量私钥</span>
<span class="hljs-keyword">var</span> privateKey <span class="hljs-operator">=</span> process.env.privateKey;
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6c2c9af4e7bb42a5cdec8a0c30841c37c4f41e07451c935283471f7ccb9be898.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><pre data-type="codeBlock" text="export privateKey=&quot;你的钱包私钥&quot;
"><code>export <span class="hljs-attr">privateKey</span>=<span class="hljs-string">"你的钱包私钥"</span>
</code></pre><p>第二步，需要传入你 infura 的节点 id。 infura 是一个区块链节点的服务商，其实 metamask 背后的默认 rpc 网络节点，也是它家提供的。 官网： <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://infura.io/">https://infura.io/</a></p><p>自行注册，然后进入后台，点击右上角的 create project ：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9bc513ffeadfe2ed033ca3efa4bc1a5a180db4ea9f7749b9b9fad092ae0c494e.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>把这个 url 和 project id 复制到我们的配置文件中：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2e9efaab57b7db206b5a4873879b1b2462c03392954e614ee2a50046eb7cf220.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>切忌，这里的 url 不要用 https 的，因为 rinkeby 会不定时出现以下错误： Error: PollingBlockTracker - encountered an error while attempting to update latest</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/67899f02fa87d219bda5baffe95dd3e5df23ac6aa0da147d8b24492d1649494e.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>github给的解决方案：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/trufflesuite/truffle/issues/3357">https://github.com/trufflesuite/truffle/issues/3357</a></p><p>同理，我们这里的 infuraid 也可以采用和私钥的配置形式，进行 export 到系统的环境变量中去。这里不重复赘述了。</p><p>到此，完整的配置文件：</p><pre data-type="codeBlock" text="
const HDWalletProvider = require(&apos;@truffle/hdwallet-provider&apos;);
//环境变量私钥
var privateKey = process.env.privateKey;
//环境变量 infuraid
var infuraId = process.env.infuraId;

module.exports = {

  networks: {
    rinkeby: {
      // 钱包的节点提供服务
      provider: () =&gt; new HDWalletProvider(privateKey, &quot;wss://rinkeby.infura.io/ws/v3/&quot; + infuraId),
      gas: 10000000,    //部署接受的最大消耗 gas 
      gasPrice: 15000000000, //gas的价格
      network_id: 4,   //rinkeby的网络id
      timeoutBlocks: 40000, //读取区块链的数据超时时间
    },
  },
};
"><code>
const HDWalletProvider <span class="hljs-operator">=</span> <span class="hljs-built_in">require</span>(<span class="hljs-string">'@truffle/hdwallet-provider'</span>);
<span class="hljs-comment">//环境变量私钥</span>
<span class="hljs-keyword">var</span> privateKey <span class="hljs-operator">=</span> process.env.privateKey;
<span class="hljs-comment">//环境变量 infuraid</span>
<span class="hljs-keyword">var</span> infuraId <span class="hljs-operator">=</span> process.env.infuraId;

module.exports <span class="hljs-operator">=</span> {

  networks: {
    rinkeby: {
      <span class="hljs-comment">// 钱包的节点提供服务</span>
      provider: () <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-keyword">new</span> HDWalletProvider(privateKey, <span class="hljs-string">"wss://rinkeby.infura.io/ws/v3/"</span> <span class="hljs-operator">+</span> infuraId),
      <span class="hljs-built_in">gas</span>: <span class="hljs-number">10000000</span>,    <span class="hljs-comment">//部署接受的最大消耗 gas </span>
      gasPrice: <span class="hljs-number">15000000000</span>, <span class="hljs-comment">//gas的价格</span>
      network_id: <span class="hljs-number">4</span>,   <span class="hljs-comment">//rinkeby的网络id</span>
      timeoutBlocks: <span class="hljs-number">40000</span>, <span class="hljs-comment">//读取区块链的数据超时时间</span>
    },
  },
};
</code></pre><p>除了以上测试网的配置，还可以把优化的配置打开，编译器的版本设置对，根据自己合约的语法设定，设置成下面的默认就好，enabled 从 false 改成 true：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ae1ef1b86317779578d8a4eddb283e988e2e3d3afe9f047ff8a543fb9a64aff2.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>这里的 runs ，值越大，编译出来的文件越大，部署的成本越高，但执行效率相对好一些。越小则相反。默认值即可。</p><p>完整的配置文件：</p><pre data-type="codeBlock" text="
const HDWalletProvider = require(&apos;@truffle/hdwallet-provider&apos;);
//环境变量私钥
var privateKey = process.env.privateKey;
//环境变量 infuraid
var infuraId = process.env.infuraId;

module.exports = {

  networks: {
    rinkeby: {
      // 钱包的节点提供服务
      provider: () =&gt; new HDWalletProvider(privateKey, &quot;wss://rinkeby.infura.io/ws/v3/&quot; + infuraId),
      gas: 10000000,    //部署接受的最大消耗 gas 
      gasPrice: 15000000000, //gas的价格
      network_id: 4,   //rinkeby的网络id
      timeoutBlocks: 40000, //读取区块链的数据超时时间
    },
  },
  mocha: {
    // timeout: 100000
  },

  compilers: {
    solc: {
      version: &quot;0.8.11&quot;,      // Fetch exact version from solc-bin (default: truffle&apos;s version)
      // docker: true,        // Use &quot;0.5.1&quot; you&apos;ve installed locally with docker (default: false)
      settings: {          // See the solidity docs for advice about optimization and evmVersion
        optimizer: {
          enabled: true,
          runs: 200        //值越大，编译出来的文件越大，部署的成本越高，但执行效率相对好一些。越小则相反。默认值即可
        },
        evmVersion: &quot;london&quot;
      }
    }
  },
};
"><code>
const HDWalletProvider <span class="hljs-operator">=</span> <span class="hljs-built_in">require</span>(<span class="hljs-string">'@truffle/hdwallet-provider'</span>);
<span class="hljs-comment">//环境变量私钥</span>
<span class="hljs-keyword">var</span> privateKey <span class="hljs-operator">=</span> process.env.privateKey;
<span class="hljs-comment">//环境变量 infuraid</span>
<span class="hljs-keyword">var</span> infuraId <span class="hljs-operator">=</span> process.env.infuraId;

module.exports <span class="hljs-operator">=</span> {

  networks: {
    rinkeby: {
      <span class="hljs-comment">// 钱包的节点提供服务</span>
      provider: () <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-keyword">new</span> HDWalletProvider(privateKey, <span class="hljs-string">"wss://rinkeby.infura.io/ws/v3/"</span> <span class="hljs-operator">+</span> infuraId),
      <span class="hljs-built_in">gas</span>: <span class="hljs-number">10000000</span>,    <span class="hljs-comment">//部署接受的最大消耗 gas </span>
      gasPrice: <span class="hljs-number">15000000000</span>, <span class="hljs-comment">//gas的价格</span>
      network_id: <span class="hljs-number">4</span>,   <span class="hljs-comment">//rinkeby的网络id</span>
      timeoutBlocks: <span class="hljs-number">40000</span>, <span class="hljs-comment">//读取区块链的数据超时时间</span>
    },
  },
  mocha: {
    <span class="hljs-comment">// timeout: 100000</span>
  },

  compilers: {
    solc: {
      version: <span class="hljs-string">"0.8.11"</span>,      <span class="hljs-comment">// Fetch exact version from solc-bin (default: truffle's version)</span>
      <span class="hljs-comment">// docker: true,        // Use "0.5.1" you've installed locally with docker (default: false)</span>
      settings: {          <span class="hljs-comment">// See the solidity docs for advice about optimization and evmVersion</span>
        optimizer: {
          enabled: <span class="hljs-literal">true</span>,
          runs: <span class="hljs-number">200</span>        <span class="hljs-comment">//值越大，编译出来的文件越大，部署的成本越高，但执行效率相对好一些。越小则相反。默认值即可</span>
        },
        evmVersion: <span class="hljs-string">"london"</span>
      }
    }
  },
};
</code></pre><p>好，到这里，我们就可以尝试部署合约了，过程中肯定会遇到问题，来逐一解决。</p><h3 id="h-truffle" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">四、truffle 部署合约</h3><p>回到命令行中，我们只需要输入以下命令，指定 truffle 部署网络，便可以开始部署：</p><pre data-type="codeBlock" text="truffle migrate --network rinkeby
"><code>truffle migrate <span class="hljs-operator">-</span><span class="hljs-operator">-</span>network rinkeby
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/104590ccfd3a2b73527c6d81b2e59d11d616476f4c5d3b1d5d2908687c3cc407.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>可以看到，缺少依赖了，npm安装一下，然后继续安装：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9b80ba1a6aa9b1c68fb222bb0bc8628c5501de6d6292278dbf1d982235fe4139.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>这里就不一个个截图了，最终安装的依赖如下：</p><pre data-type="codeBlock" text="//涉及到 web3 的
npm install web3-provider-engine
npm install ethereumjs-abi
//这个是我自己引用的 openzeppelin 依赖 
npm install @openzeppelin/contracts
"><code><span class="hljs-comment">//涉及到 web3 的</span>
npm install web3<span class="hljs-operator">-</span>provider<span class="hljs-operator">-</span>engine
npm install ethereumjs<span class="hljs-operator">-</span><span class="hljs-built_in">abi</span>
<span class="hljs-comment">//这个是我自己引用的 openzeppelin 依赖 </span>
npm install @openzeppelin<span class="hljs-operator">/</span>contracts
</code></pre><p>当依赖问题解决，再次执行 truffle migrate 后：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4e41aaeb420e2ad98b53a146b98b3ed647a87d11427876b4aa7df25d07595eeb.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>这里提示一下，如果你的部署合约名称没变，但是合约代码有变化，还执行 truffle migrate 后，不会对合约重新部署：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/25c1e46ea91af18945cd134698bce0cd05c026aea1c1f33e393858c5316e503c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>此时，如果需要重新部署，需要通过一下命令进行部署：</p><pre data-type="codeBlock" text="truffle migrate --network rinkeby --reset
"><code>truffle migrate <span class="hljs-operator">-</span><span class="hljs-operator">-</span>network rinkeby <span class="hljs-operator">-</span><span class="hljs-operator">-</span>reset
</code></pre><p>成功：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4e41aaeb420e2ad98b53a146b98b3ed647a87d11427876b4aa7df25d07595eeb.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>我们通过 etherscan 查看下部署的合约：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8519a1b137c7b6a87d966d3b589bf1577747f0898be3d3cd5e03f4b253db6c80.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>合约成功部署成功了，但此时的代码是未开源的，点击 contract ，可以看到如下，都是 16 进制码：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a2c160cd465b3cfbeb49d3e4394fdc0af8c7d355b8a4371152725ee525417bbe.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-truffle" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">五、truffle 开源的两种方式</h3><p><strong>1、solidity contract flattener 开源</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ed8cec73d85e784901942a94670d750b90e24b0e3877879bd71a987c0c1a0670.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>安装好这个插件，我们可以选中已经部署的合约源文件，点击下面的生成文件：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9facb00d4a1951573c1dc0c234ad9caf8fd4cf453c6321cb0cc735f0cf7d24e1.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>它会自动帮你把合约的 import 文件自动压缩到一个 solidity 文件中：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/92f3d953a83be589494d804e1005f36e39604b57030bf56957ad34fe8ff51c54.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>然后我们可以复制右侧的所有文件，到 etherscan 上进行验证开源。</p><p>点击下图的验证并发布：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f628f31d7e4cf66ea9e38a7238efaeebb1e4d3e1a225b766682ea02e27879484.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>按照大家自己的合约进行配置</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/df46d7e229125dfa6fed23fc659957eefcb0fcc53b6ddf17f04dcbdb8a7b72f2.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>选择：</p><p>把刚才生成的多文件压缩成一个文件的源码粘贴</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/178085aee1986ca99433eaa20ab74f7231b6cfc44d63e6a5ad8fb8c2a1c74120.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>过来：</p><p>点击验证并发布：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/eb707ef39959cd3081bfc4584ed6724a1d517b708c07885511d5ab22dcfc6c4e.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>以上便是用 vscode 插件的全部开源验证流程。别忘了，优化的点一定要和 truffle 配置文件中的对应，否则有可能验证不通过。</p><p><strong>2、truffle-plugin-verify 开源</strong></p><p>上面的流程很繁琐，每次还需要手动上传，而且最终生成的开源代码在 etherscan 上是以单文件显示的，阅读并不友好。</p><p>既然用了 truffle ，就有自动化的方式来进行验证开源，且生成的文件还是多文件的。接下来，展示！用到的插件官网 github： <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/rkalis/truffle-plugin-verify">https://github.com/rkalis/truffle-plugin-verify</a></p><p>先安装好这个插件 truffle-plugin-verify ：</p><pre data-type="codeBlock" text="npm install truffle-plugin-verify@latest
"><code>npm install truffle<span class="hljs-operator">-</span>plugin<span class="hljs-operator">-</span>verify@latest
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6ec50376f74ad664413374404dca1929d24a49491cb24914b93a84d80f8e4170.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>安装完成后，继续修改我们的 truffle 配置文件：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/28581a576a523aef0730049158f1104799949a1f3e5fda8cb998343d5abdccc4.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>这个插件的原理，是用了 etherscan 的 api 进行了自动化部署并且验证，所以加上如上图所示后，你需要知道 2 件事。</p><p>第一点，关于 proxy ，是否要配置，这里决定着你访问 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://etherscan.io">etherscan.io</a> 这个网站是否走代理，国内的网络，必然是需要配置的，不配置本地代理访问，最终会报错： Failed to connect to Etherscan API at url <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://api-rinkeby.etherscan.io/api">https://api-rinkeby.etherscan.io/api</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/039820e18f52490bd0261306f2e482e89796f739e03e85015d804c04845faaa1.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>配置完代理后，由于源码依赖于 tunnel ，所以还需要补个依赖，要不还是访问不了：</p><pre data-type="codeBlock" text="npm install tunnel
"><code></code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3e6a81a1b45af3f24395e085d48d4bcd5fd853296dc53cdf870a566b8c7e0f41.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>第二点，关于 etherscan 的 api key 申请，可以自行去官网申请： <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/myapikey">https://etherscan.io/myapikey</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9ece37773e64b40260421f1915a5e3a3d8022c2fdde5f646488041e4ead2346e.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>依然是通过环境变量的方式，把 key 导入。</p><p>最终 truffle 配置文件如下：</p><pre data-type="codeBlock" text="
const HDWalletProvider = require(&apos;@truffle/hdwallet-provider&apos;);
//环境变量私钥
var privateKey = process.env.privateKey;
//环境变量 infuraid
var infuraId = process.env.infuraId;
//环境变量 etherscan 的 apikey 
var etherscanApiKey = process.env.etherscanApiKey;
module.exports = {

  networks: {
    rinkeby: {
      // 钱包的节点提供服务
      provider: () =&gt; new HDWalletProvider(privateKey, &quot;wss://rinkeby.infura.io/ws/v3/&quot; + infuraId),
      gas: 10000000,    //部署接受的最大消耗 gas 
      gasPrice: 15000000000, //gas的价格
      network_id: 4,   //rinkeby的网络id
      timeoutBlocks: 40000, //读取区块链的数据超时时间
    },
  },
  mocha: {
    // timeout: 100000
  },

  compilers: {
    solc: {
      version: &quot;0.8.11&quot;,      // Fetch exact version from solc-bin (default: truffle&apos;s version)
      // docker: true,        // Use &quot;0.5.1&quot; you&apos;ve installed locally with docker (default: false)
      settings: {          // See the solidity docs for advice about optimization and evmVersion
        optimizer: {
          enabled: true,
          runs: 200        //值越大，编译出来的文件越大，部署的成本越高，但执行效率相对好一些。越小则相反。默认值即可
        },
        evmVersion: &quot;london&quot;
      }
    }
  },
  
  plugins: [&apos;truffle-plugin-verify&apos;],

  verify: {
    proxy: {
      host: &apos;127.0.0.1&apos;,
      port: &apos;41091&apos;
    }
  },

  api_keys: {
    etherscan: etherscanApiKey
  }
};
"><code>
const HDWalletProvider <span class="hljs-operator">=</span> <span class="hljs-built_in">require</span>(<span class="hljs-string">'@truffle/hdwallet-provider'</span>);
<span class="hljs-comment">//环境变量私钥</span>
<span class="hljs-keyword">var</span> privateKey <span class="hljs-operator">=</span> process.env.privateKey;
<span class="hljs-comment">//环境变量 infuraid</span>
<span class="hljs-keyword">var</span> infuraId <span class="hljs-operator">=</span> process.env.infuraId;
<span class="hljs-comment">//环境变量 etherscan 的 apikey </span>
<span class="hljs-keyword">var</span> etherscanApiKey <span class="hljs-operator">=</span> process.env.etherscanApiKey;
module.exports <span class="hljs-operator">=</span> {

  networks: {
    rinkeby: {
      <span class="hljs-comment">// 钱包的节点提供服务</span>
      provider: () <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-keyword">new</span> HDWalletProvider(privateKey, <span class="hljs-string">"wss://rinkeby.infura.io/ws/v3/"</span> <span class="hljs-operator">+</span> infuraId),
      <span class="hljs-built_in">gas</span>: <span class="hljs-number">10000000</span>,    <span class="hljs-comment">//部署接受的最大消耗 gas </span>
      gasPrice: <span class="hljs-number">15000000000</span>, <span class="hljs-comment">//gas的价格</span>
      network_id: <span class="hljs-number">4</span>,   <span class="hljs-comment">//rinkeby的网络id</span>
      timeoutBlocks: <span class="hljs-number">40000</span>, <span class="hljs-comment">//读取区块链的数据超时时间</span>
    },
  },
  mocha: {
    <span class="hljs-comment">// timeout: 100000</span>
  },

  compilers: {
    solc: {
      version: <span class="hljs-string">"0.8.11"</span>,      <span class="hljs-comment">// Fetch exact version from solc-bin (default: truffle's version)</span>
      <span class="hljs-comment">// docker: true,        // Use "0.5.1" you've installed locally with docker (default: false)</span>
      settings: {          <span class="hljs-comment">// See the solidity docs for advice about optimization and evmVersion</span>
        optimizer: {
          enabled: <span class="hljs-literal">true</span>,
          runs: <span class="hljs-number">200</span>        <span class="hljs-comment">//值越大，编译出来的文件越大，部署的成本越高，但执行效率相对好一些。越小则相反。默认值即可</span>
        },
        evmVersion: <span class="hljs-string">"london"</span>
      }
    }
  },
  
  plugins: [<span class="hljs-string">'truffle-plugin-verify'</span>],

  verify: {
    proxy: {
      host: <span class="hljs-string">'127.0.0.1'</span>,
      port: <span class="hljs-string">'41091'</span>
    }
  },

  api_keys: {
    etherscan: etherscanApiKey
  }
};
</code></pre><p>以上，配置完成后，回到命令行，执行以下命令：</p><pre data-type="codeBlock" text="//DaMiToken是合约名称，--debug可以看到具体错误信息
truffle run verify  DaMiToken --network rinkeby --debug
"><code><span class="hljs-comment">//DaMiToken是合约名称，--debug可以看到具体错误信息</span>
truffle run verify  DaMiToken <span class="hljs-operator">-</span><span class="hljs-operator">-</span>network rinkeby <span class="hljs-operator">-</span><span class="hljs-operator">-</span>debug
</code></pre><p>执行完毕后，可以看到成功：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/002c4f679a9bfd2fc541f0e2dd944f8bccae8b60ff631834b289e94f374a7555.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>打开 etherscan 的地址：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/89957801713cf3b24c85e7738c753d768142ad07a867736636c6dd2a0b3a879a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>可以成功看到，合约已经被整整齐齐的分成了多个文件，并且成功开源！</p><p>至此，教程完毕。</p><p>好，以上就是完整的分享了....希望大家可以有所收获，有问题也欢迎随时交流探讨！ 💎 |币圈萌新|NFT学习中|成为科学家的路上|💎</p><p>我的Twitter：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dami16z">@dami</a></p>]]></content:encoded>
            <author>yidakoumi@newsletter.paragraph.com (dami.eth)</author>
        </item>
        <item>
            <title><![CDATA[Solidity项目分析之 PXN 合约解读]]></title>
            <link>https://paragraph.com/@yidakoumi/solidity-pxn</link>
            <guid>3yviL6uxGLmLXa1ayyKb</guid>
            <pubDate>Sun, 08 May 2022 13:07:37 GMT</pubDate>
            <description><![CDATA[前言大家好啊，我是大咪，现在是北京时间的2022年05月07日11:03:25，最近在参与 youtuber 【nft黑魔法】老师的 discord 课程作业。 这周的作业是以读合约的视角，分析近期大热项目 PXN 的合约，除了代码方面的分析，我还加上了 etherscan 上的一些链上数据作为分析，区块链有意思的点就是在于链上追溯数据，一切都是公开透明的交易。 目前我也还是在学习阶段，希望本篇复盘可以对你在学习的路上有所帮助，若有问题，还望多多交流。 PS：PXN已经发售完毕，本次合约是分析的主网合约。我的推特：https://twitter.com/dami2333 黑魔法老师推特：https://twitter.com/MrsZaaa NFT黑魔法频道：https://www.youtube.com/c/NFT黑魔法 黑魔法discord：https://discord.gg/CTfK9fH3aQ首先，先来根据 opensea 上的官方项目，找到主网上的合约地址：随便点进一个挂单的 NFT ，点击 detail ：合约地址如下： https://etherscan.io/a...]]></description>
            <content:encoded><![CDATA[<h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">前言</h2><p>大家好啊，我是大咪，现在是北京时间的2022年05月07日11:03:25，最近在参与 youtuber 【nft黑魔法】老师的 discord 课程作业。</p><p>这周的作业是以读合约的视角，分析近期大热项目 PXN 的合约，除了代码方面的分析，我还加上了 etherscan 上的一些链上数据作为分析，区块链有意思的点就是在于链上追溯数据，一切都是公开透明的交易。</p><p>目前我也还是在学习阶段，希望本篇复盘可以对你在学习的路上有所帮助，若有问题，还望多多交流。</p><p>PS：PXN已经发售完毕，本次合约是分析的主网合约。</p><blockquote><p>我的推特：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dami2333">https://twitter.com/dami2333</a></p><p>黑魔法老师推特：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/MrsZaaa">https://twitter.com/MrsZaaa</a></p><p>NFT黑魔法频道：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/c/NFT%E9%BB%91%E9%AD%94%E6%B3%95">https://www.youtube.com/c/NFT黑魔法</a></p><p>黑魔法discord：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://discord.gg/CTfK9fH3aQ">https://discord.gg/CTfK9fH3aQ</a></p></blockquote><p>首先，先来根据 opensea 上的官方项目，找到主网上的合约地址：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9cadb75b3e4406c315301662d13001478d2205ce0653c8c9fb6ee3cc7f83c572.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>随便点进一个挂单的 NFT ，点击 detail ：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f4a99f2dd19c3d611312ba5763ef5332e2068be8a5a59cf416bf28a675639a37.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>合约地址如下： <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.io/address/0x160c404b2b49cbc3240055ceaee026df1e8497a0">https://etherscan.io/address/0x160c404b2b49cbc3240055ceaee026df1e8497a0</a></p><p>进入区块链浏览器后，点击 contract - write ，便可以看到合约的代码函数了：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5a2de0153d41d55147634f8ccc6efcd26c2cf6f437254e5ac3f367ff61f2e288.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>这里分享一个在社群中学到的知识，通过修改 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://etherscan.io">etherscan.io</a> -&gt; <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://eterscan.deth.net">eterscan.deth.net</a> ，可以直接把网址变为 vscode 的在线浏览模式，便于代码阅读。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://etherscan.deth.net/address/0x160c404b2b49cbc3240055ceaee026df1e8497a0#writeContract">https://etherscan.deth.net/address/0x160c404b2b49cbc3240055ceaee026df1e8497a0#writeContract</a></p><p>截图如下：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/06e3b6d13ff4df02d02c0bebc1abefe64c29e29d849edd907a4bd8b565a8a965.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">正文</h2><p>前置环境准备就绪，接下来按照以下几个结构进行分析。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">合约初印象</h3><p>继承了 ERC-721A 的合约，同时，继承了 Ownable 合约：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/db34524a80291b1b43066a3d2753c1d8001c017d3285f2c3227cddd275608813.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>ERC-721A 由 Azuki 团队创建，与 ERC-721 相比，它在同时铸造多个 NFT 时可节省很多 gas fee。</p><p>而 Ownable 合约的核心作用，是为项目限制了某些函数只能合约部署者（项目方自己）进行调用，比如下面的提现函数 withdrawFunds()，后面跟了一个修改器 onlyOwner ：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ff212d5b2a6c80ede235bc44cb3d02eb70568cfb7d395a80f9e67a3fd6e432a7.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>如果好奇具体是如何实现的，可以移步 github 自行查看： <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol">https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol</a></p><p>初印象结论：通过这两个继承合约可以看出来，一些设置类的函数被限制仅由项目方可调用，这点没问题，而 721A 可以为大家节省多个 NFT 同时 mint 时产生的 gas。</p><p>通过 etherscan ，点击 Write Contract 可以清晰的查找 mint 的函数，涉及了 4 个：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f56cd73e859357ed4fa6ad92a292813ce4bb1546018fad0313dc5e0e340813ab.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ca832442d8074f554b2172af2a6e0913255a019c672d86bc6f21afd91e448a82.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-mint" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Mint 函数分析</h3><p>从名字上不难看出，4 个 mint 函数对应着 4 类不同参与人群，按照正常业务顺序一个个来解读一下。</p><pre data-type="codeBlock" text="devMint : 开发者 mint 函数 

mintDutchAuction：荷兰拍卖 mint 函数 

mintWL：白名单 mint 函数 

teamMint：团队成员 mint 函数
"><code><span class="hljs-attr">devMint :</span> <span class="hljs-string">开发者</span> <span class="hljs-string">mint</span> <span class="hljs-string">函数</span> 

<span class="hljs-string">mintDutchAuction：荷兰拍卖</span> <span class="hljs-string">mint</span> <span class="hljs-string">函数</span> 

<span class="hljs-string">mintWL：白名单</span> <span class="hljs-string">mint</span> <span class="hljs-string">函数</span> 

<span class="hljs-string">teamMint：团队成员</span> <span class="hljs-string">mint</span> <span class="hljs-string">函数</span>
</code></pre><p>正常的业务流程，一般先是荷拍 mint ，之后进入白名单 mint。至于开发者和团队 mint 的时间，不确定，后面看源码去分析。</p><h4 id="h-1-mintdutchauction" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">1. mintDutchAuction() 分析</h4><p>先说根据这个函数，看出来的业务相关的信息。</p><p>合约的业务逻辑： 荷拍的 PNX 总发行数量为 4000 个，正式荷拍开始时间为北京时间 2022-05-05 11:00:00（CST），对应 UTC 的时间为 2022-05-05 03:00:00（凌晨），我们国家比世界标准要快 8 个小时。</p><p>荷拍，起始价格 2 ETH 起拍，每 15 分钟价格降低 0.05 ETH，意味着，1小时价格降低 0.2 ETH ，荷拍最低的价格为 0.1 ETH。</p><p>通过荷拍结束的过程，对白名单的定价也有影响，如果荷拍的最终价格定在了小于 0.7 ETH 以内，那么白单的价格则为【当前荷拍价格 / 2】，举个例子，比如最终荷拍的价格定在了 0.6 ETH ，那么白单则为 0.3 ETH ，而白单默认的价格设定的为 0.35 ETH。</p><p>再来从代码层面解读一下： 这个函数中，加上了修改器 callerIsUser ，限制了合约调用者只能为钱包地址进行调用，而不能通过合约地址调用。</p><pre data-type="codeBlock" text="modifier callerIsUser() {
  require(tx.origin == msg.sender, &quot;The caller is another contract&quot;);
  _;
}
"><code><span class="hljs-function"><span class="hljs-keyword">modifier</span> <span class="hljs-title">callerIsUser</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-built_in">require</span>(<span class="hljs-built_in">tx</span>.<span class="hljs-built_in">origin</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span> <span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>, <span class="hljs-string">"The caller is another contract"</span>);
  <span class="hljs-keyword">_</span>;
}
</code></pre><p>这里有个 tx.origin 和 msg.sender 知识点，可以通过一张图看明白上述代码的作用：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1118d23c3641fe5563813f504a4437c5c120734eb2587020cad695509a5368c5.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>原文地址：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://davidkathoh.medium.com/tx-origin-vs-msg-sender-93db7f234cb9">https://davidkathoh.medium.com/tx-origin-vs-msg-sender-93db7f234cb9</a></p><p>校验的业务逻辑：</p><ol><li><p>荷拍的状态是否激活，true 为激活，后续代码才能继续运行。【状态校验】</p></li><li><p>调用者的签名，通过项目前端网页调用后端动态生成了荷拍签名，再去和智能合约对当前调用者的地址加签后进行验证，这样可以防止&quot;合约机器人&quot;调用。【合约调用者校验】</p></li><li><p>当前 mint 数量 + 已经 mint 的数量是否小于等于荷拍的数量（4000个），防止超发【数量校验】</p></li><li><p>荷拍时间是否大于等于开启时间【时间校验】</p></li><li><p>当前区块链时间戳是否大于白名单开启时间，如果大于了白名单的开启时间，说明荷拍的时间已经结束，禁止后续代码的运行。【时间校验】</p></li><li><p>调用合约传入的 mint 数量，荷拍 mint 的最大数量小于等于 2，防止个人超出 mint 数量【数量校验】</p></li><li><p>当前调用者已经 mint 的数量 + 调用合约的 mint 数量小于等于2，防止个人超出 mint 数量【数量校验】</p></li><li><p>合约调用者的钱包剩余金额是否大于等于你需要 mint 的个数 * 当前荷拍的价格【金额校验】</p></li></ol><p>以上校验逻辑都通过，可以荷拍 mint 。</p><p>真正第一个荷拍出价 mint 成功的交易，是下面这笔：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b0358c2d7b897e552034799a231ecc104bbe1d49661bd25b8b92569792144b98.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>可以看下他的出价时间 May-05-2022 03:03:24 AM，mint数量2个，荷拍交易价格 4 ETH ，他给的 max priority 非常高，以致于成了第一个 mint 成功的人：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6fdcf16d35d7fad410dc4df1a13da0f433973c233cb5c06d6aa544952db95357.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>最后一个荷拍 mint 者，是这笔交易：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8b0f47576274372191257b9626331e5d77762851525f392341e16ddc7b24081b.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>详情，10 分钟荷拍 4000 个 PXN 全部售罄，可以看最后这笔 gas fee，总共才 $55 ：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4c3294c2d361a60898e2a5417391234e1885eb71ab3763ba2ee159ce7698266a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>开始的 gas war 和 结束的 gas fee，有着天壤之别啊。。。差了好多钱。。</p><p>源码不帖了，自行去上面的去看就好。</p><h4 id="h-2-mintwl" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">2. mintWL() 分析</h4><p>依然是先说根据这个函数，看出来的业务相关的信息。</p><p>白单的总发行数量为 6000，开始时间为荷拍开始时间的 24h 之后，也就是 正式荷拍开始时间为北京时间 2022-05-06 11:00:00（CST），对应 UTC 的时间为 2022-05-06 03:00:00（凌晨），持续时间为 24 小时，即白单 mint 结束时间为 UTC 的时间为 2022-05-07 03:00:00 （凌晨）。</p><p>白单的起始价格默认 0.35 ETH，而上面提到了，如果最终荷拍最低价 mint 小于了 0.7 ETH ，则会按照【当前荷拍最低价 / 2 】算出白单价格。</p><p>再来从代码层面解读一下： 校验逻辑：</p><ol><li><p>荷拍最终价格需要大于0，否则意味着荷拍还没有结束，不能进行白单mint【价格校验】</p></li><li><p>调用者的签名，通过项目前端网页调用后端动态生成了签名，再去和智能合约对当前调用者的地址加签后进行验证，这样可以防止&quot;合约机器人&quot;调用。【合约调用者校验】</p></li><li><p>已经 Mint 的白单数量 + 当前该交易 mint 的数量，必须小于 6000【防止超发 mint】</p></li><li><p>当前调用者是否已经白单 mint 过一次了，一个白单地址只能 mint 一次【防止超发 mint】</p></li><li><p>当前区块链时间戳大于白单开启时间，小于白单结束时间【时间校验】</p></li><li><p>合约调用者的钱包剩余金额是否大于等于你需要当前白单的价格【金额校验】</p></li></ol><p>以上校验都过了，调用者可以开始mint。</p><p>第一个白单 mint 成功的交易为：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/fa6669e9478443fbb36b6b07b38e999fecfda22174e1d3db6c6dfc9a23bf79e5.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>UTC时间为 2022-05-05 03:00:13 ，gas fee大约 0.8 ETH 左右。</p><p>最后一笔白单交易为：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/44e566216630392cadf819b8709bd83b24d6f09dc1bd814f56eaf6011b653e87.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>时间：May-07-2022 02:02:33 AM +UTC。 可以看到，这里有三笔交易失败的：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/aa219817e85c6a29f388c1b58e0db51ec35d5e25456ca452674f9f64b392626c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>我们把交易txid复制到tendly，可以看一下失败的详情：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a57c43697f2d2b3445cda079906111e6615786c9ed141d41ee89b251eb0fc834.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>地址： <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://dashboard.tenderly.co/tx/mainnet/0x71bca7dcb99cffde7c6cbe364aab0411a61dbeb364a5fe585f519a524839a690">https://dashboard.tenderly.co/tx/mainnet/0x71bca7dcb99cffde7c6cbe364aab0411a61dbeb364a5fe585f519a524839a690</a></p><p>提示，仅能在白单时间 mint ，显然是超了时间了，他这笔 mint 的时间为：May-07-2022 08:15:56 AM +UTC，白单结束时间为：2022-05-07 03:00:00 ，都超了 5 小时了，才想起来，亏死了。</p><h4 id="h-3-teammint" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">3. teamMint()分析</h4><p>这部分 mint ，是给项目的团队贡献者的 mint 奖励，项目方维护了一个 _teamList 的列表，根据这个列表，对团队成员所贡献的不同，可以 mint 的数量也不同。</p><p>而团队 mint 的开始时间也和白名单开始时间一样，但对于结束时间没有限制，意味着团队成员只要在白单开启时间后，想什么时候 mint 都可以。mint的价格和白单价格一致，都为 0.35 ETH。</p><p>校验逻辑：</p><ol><li><p>当前区块链时间戳大于白单开启时间【时间校验】</p></li><li><p>团队成员地址对应的 mint 数量校验【超发mint校验】</p></li><li><p>当前钱包的价格大于 mint 的数量 * 价格 校验【金额】</p></li><li><p>当前 mint 的数量不能大于总发行量 10000 （4000荷拍 + 6000白单）【超发校验】</p></li></ol><p>以上校验都通过后，可以正常 mint 。</p><p>看到的第一笔 team mint 交易为：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/26da65c42ff831ce74b2ee76ca89e4fd89bdeede2b7feb56f9d510a7a89a7bb6.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>Mint 了 4 个，时间：May-06-2022 03:00:13 AM +UTC。</p><h4 id="h-4-devmint" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">4. devMint()分析</h4><p>最后，这个函数是合约部署者的 mint ，以上所有人 mint 完之后，合约部署者可以在白单开始后的 24h以后 mint ，即 2022-05-07 03:00:00 以后的所有时间。</p><p>但合约部署者有意思的是，总发行数量 10000 ，减去当前 mint 的总数量，只要当调用了这个函数，剩下的所有 NFT ，都会打给这个开发者的地址去。目前链上还没有看到有调用这个函数，可能是因为团队成员还没有 mint 完。</p><p>刚才在分析 mintwl 的时候，有列出最后一笔交易，tokenid 是 9868 个，剩余 130+ 个 NFT。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8011ecf02adeea62b2c6efa620292078b1757a1cb95b84fbfc57cf1256bd394a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>代码校验逻辑：</p><ol><li><p>当前区块链时间戳大于等于白单开启时间后过了24小时【时间校验】</p></li><li><p>团队成员地址对应的 mint 数量校验【超发mint校验】</p></li><li><p>当前钱包的价格大于 mint 的数量 * 价格 校验【金额】</p></li><li><p>当前 mint 的数量不能大于总发行量 10000 （4000荷拍 + 6000白单）【超发校验】</p></li></ol><p>以上校验都通过后，可以正常 mint ，这里 mint 的逻辑是，按 10 个为一组，批量 mint ，最终如果还剩下个位数，在将剩余的个位数 NFT 发送至合约部署者钱包。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">安全疑问</h3><p>对于重入攻击方面的安全方面，可以看到，这次 PXN 没有对提现函数进行 nonReentrant 的修改器装饰，根本原因是因为他们把发送的地址写死了吗？</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1baf3700795923d779a042336b43f1d6d6197c328d3ba50eef084f83e8a7e2b7.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>反观 Azuki 的提现函数，确实有加 nonReentrant 防止：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0ff1e4b9297c49e4535bad2fb86a5b8ddecdae7ccfb79d3245ddacc3a52db96c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>后面也许等我的知识完善起来，就能明白了....</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">结语</h2><p>智能合约和正常 web2 世界里的代码不同，一旦部署，无法修改。 而安全方面的漏洞大多出现在 mint 函数中，要么是校验漏洞，要么是业务的逻辑漏洞。</p><p>而对于校验规则，可以形成一套 SOP ，就像 PXN 项目中的一样，上次分析气球人的合约也是类似的模板：</p><ol><li><p>荷拍最终价格需要大于0，否则意味着荷拍还没有结束，不能进行白单mint【价格校验】</p></li><li><p>调用者的签名，通过项目前端网页调用后端动态生成了签名，再去和智能合约对当前调用者的地址加签后进行验证，这样可以防止&quot;合约机器人&quot;调用。【合约调用者校验】</p></li><li><p>已经 Mint 的白单数量 + 当前该交易 mint 的数量，必须小于 6000【防止超发 mint】</p></li><li><p>当前调用者是否已经白单 mint 过一次了，一个白单地址只能 mint 一次【防止超发 mint】</p></li><li><p>当前区块链时间戳大于白单开启时间，小于白单结束时间【时间校验】</p></li><li><p>合约调用者的钱包剩余金额是否大于等于你需要当前白单的价格【金额校验】</p></li></ol><p>如果没有荷拍环节，就去掉荷拍部分的校验。</p><p>区块链有意思的地方在于公开，透明，代码只要是好项目，大部分都是会开源的，我们可以从优秀的项目中学习如何去写代码，如何闭坑，而对于智能合约而言，越简单，越清晰的逻辑反而越好。能避免复杂逻辑，就尽量避免吧。</p><p>还记得4月发生的事件吗，Akutar NFT 因为写错1个单词，导致 3400万 美金锁死在合约里，再也无法提现，不止是项目方哭😭，参与者也哭😭。</p><p>好，以上就是完整的分享了....希望大家可以有所收获，有问题也欢迎随时交流探讨！ 💎 |币圈萌新|NFT学习中|成为科学家的路上|💎</p><p>我的Twitter：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dami2333">https://twitter.com/dami2333</a></p>]]></content:encoded>
            <author>yidakoumi@newsletter.paragraph.com (dami.eth)</author>
        </item>
        <item>
            <title><![CDATA[solidity学习笔记]]></title>
            <link>https://paragraph.com/@yidakoumi/solidity</link>
            <guid>iQxLq5D5T7Hi1zOjmDPD</guid>
            <pubDate>Sat, 07 May 2022 02:53:29 GMT</pubDate>
            <description><![CDATA[前言本学习笔记源于以下网址，对于想快速学习 solidity 语言的朋友，推荐看看： https://cryptozombies.io/zh/ 以下内容，有部分是直接从网站上整理的个人认为关键的地方，而加粗的文字，均为笔者的思考，可以选择性阅读~ PS:笔记的目的，主要是为了便于后续的学习回顾查找，还有可以加深一遍自己的理解。lesson 1 笔记版本指令所有的 Solidity 源码都必须在开头处标明 Solidity 编译器的版本. 以避免将来新的编译器可能不兼容你的代码。 代码示例：pragma solidity ^0.8.0; 上述代码限定了当前的 solidity 编译器的版本必须为指定的 0.8.0，不能使用其它版本的编译器，比如像 Java ，1.8 语法是能兼容 1.6 的，但 1.6 的 jdk 却用不了 Java8 的语法。合约Solidity 的代码都包裹在合约里面. 一份合约就是以太应币应用的基本模块， 所有的变量和函数都属于一份合约, 它是你所有应用的起点。 代码实例：pragma solidity ^0.8.0; contract HelloWorld...]]></description>
            <content:encoded><![CDATA[<h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">前言</h2><p>本学习笔记源于以下网址，对于想快速学习 solidity 语言的朋友，推荐看看：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://cryptozombies.io/zh/">https://cryptozombies.io/zh/</a></p><p>以下内容，有部分是直接从网站上整理的个人认为关键的地方，而<strong>加粗的文字</strong>，均为笔者的思考，可以选择性阅读~</p><p>PS:笔记的目的，主要是为了便于后续的学习回顾查找，还有可以加深一遍自己的理解。</p><h2 id="h-lesson-1" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">lesson 1 笔记</h2><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">版本指令</h3><p>所有的 Solidity 源码都必须在开头处标明 Solidity 编译器的版本. 以避免将来新的编译器可能不兼容你的代码。</p><p>代码示例：</p><pre data-type="codeBlock" text="pragma solidity ^0.8.0;
"><code><span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.0;</span>
</code></pre><p><strong>上述代码限定了当前的 solidity 编译器的版本必须为指定的 0.8.0，不能使用其它版本的编译器，比如像 Java ，1.8 语法是能兼容 1.6 的，但 1.6 的 jdk 却用不了 Java8 的语法。</strong></p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">合约</h3><p>Solidity 的代码都包裹在<strong>合约</strong>里面. 一份<code>合约</code>就是以太应币应用的基本模块， 所有的变量和函数都属于一份合约, 它是你所有应用的起点。</p><p>代码实例：</p><pre data-type="codeBlock" text="pragma solidity ^0.8.0;
contract HelloWorld {
}
"><code><span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> ^0.8.0;</span>
<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">HelloWorld</span> </span>{
}
</code></pre><p><strong>关键字 contract ，类似于 Java 的 Class 类，但是这里理解成类的概念，还不是很好，因为在 solidity 里，还有一个关键字，叫 【struct】，这个关键字给我的感觉更像是和类对应的。但 Java 里没有 Class 的类语法，你也没有办法往下写代码的对吧。。</strong></p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">状态变量</h3><p>状态变量是被永久地保存在合约中。也就是说它们被写入以太币区块链中. 想象成写入一个数据库。</p><p>无符号整数: uint</p><p><code>uint</code> 无符号数据类型， 指<strong>其值不能是负数</strong>，对于有符号的整数存在名为 <code>int</code> 的数据类型。</p><blockquote><p><em>注: Solidity中，</em> <code>uint</code> 实际上是 <code>uint256</code>代名词， 一个256位的无符号整数。你也可以定义位数少的uints — <code>uint8</code>， <code>uint16</code>， <code>uint32</code>， 等…… 但一般来讲你愿意使用简单的 <code>uint</code>， 除非在某些特殊情况下。</p></blockquote><p>代码示例：</p><pre data-type="codeBlock" text="contract Example {
  // 这个无符号整数将会永久的被保存在区块链中
  uint myUnsignedInteger = 100;
}
"><code><span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">Example</span> </span>{
  <span class="hljs-comment">// 这个无符号整数将会永久的被保存在区块链中</span>
  <span class="hljs-keyword">uint</span> myUnsignedInteger <span class="hljs-operator">=</span> <span class="hljs-number">100</span>;
}
</code></pre><p><strong>这个写法有点类似 C 语言，但把关键字 uint 精简了， uint 默认是 256 位的，后续会有详细的笔记介绍，如何选择 uint 后面的指定单位。</strong></p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">数学运算</h3><ul><li><p>加法: <code>x + y</code></p></li><li><p>减法: <code>x - y</code>,</p></li><li><p>乘法: <code>x * y</code></p></li><li><p>除法: <code>x / y</code></p></li><li><p>取模 / 求余: <code>x % y</code> <em>(例如,</em> <code>13 % 5</code> 余 <code>3</code>, 因为13除以5，余3)</p></li></ul><p>Solidity 还支持 <strong><em>乘方操作</em></strong> (如：x 的 y次方） // 例如： 5 ** 2 = 25</p><p>代码示例：</p><pre data-type="codeBlock" text="uint x = 5 ** 2; // equal to 5^2 = 25
"><code><span class="hljs-keyword">uint</span> x <span class="hljs-operator">=</span> <span class="hljs-number">5</span> <span class="hljs-operator">*</span><span class="hljs-operator">*</span> <span class="hljs-number">2</span>; <span class="hljs-comment">// equal to 5^2 = 25</span>
</code></pre><p><strong>solidity基础的计算语法倒是和主流的高级语言类似，尤其是 Python。举个例子，比如我想截取一个数字，如3438141312的后3位，也就是312，用计算语法怎么写出来，而不是用字符串的形式。</strong></p><p>代码示例：</p><pre data-type="codeBlock" text="uint x = 3438141312 % 1000; // equal to 312
"><code><span class="hljs-keyword">uint</span> x <span class="hljs-operator">=</span> <span class="hljs-number">3438141312</span> <span class="hljs-operator">%</span> <span class="hljs-number">1000</span>; <span class="hljs-comment">// equal to 312</span>
</code></pre><p>Python也是一样的：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/900a4ab1779134f17924a8f6576a6c18b1fb859bf1826e845611c3dea58b4596.png" alt="python示例" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">python示例</figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">结构体</h3><p>Solidity 提供了 结构体，结构体允许你生成一个更复杂的数据类型，它有多个属性。</p><blockquote><p><em>注：我们刚刚引进了一个新类型,</em> <code>string</code>。 字符串用于保存任意长度的 UTF-8 编码数据。 如： <code>string greeting = &quot;Hello world!&quot;</code>。</p></blockquote><p>代码示例：</p><pre data-type="codeBlock" text="contract HelloWorld {
  struct Person {
    uint age;
    string name;
  }
}
"><code><span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">HelloWorld</span> </span>{
  <span class="hljs-keyword">struct</span> <span class="hljs-title">Person</span> {
    <span class="hljs-keyword">uint</span> age;
    <span class="hljs-keyword">string</span> name;
  }
}
</code></pre><p><strong>上面提到过的，struct，从抽象层次来理解，这个关键字才更像是 Java 的类的概念。也就是对象。因为你的属性都放在了 struct 里，而不是合约 HelloWorld 里。除此之外，引入新的关键词 string ，注意，是小写。</strong></p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">数组</h3><p>如果你想建立一个集合，可以用【<strong>数组】这样的数据类型. Solidity 支持两种数组: 【静态数组】</strong> 和【动态数组】:</p><pre data-type="codeBlock" text="// 固定长度为2的静态数组:
uint[2] fixedArray;
// 固定长度为5的string类型的静态数组:
string[5] stringArray;
// 动态数组，长度不固定，可以动态添加元素:
uint[] dynamicArray;
// 这是动态数组，我们可以不断添加元素
Person[] people; 
"><code>// 固定长度为2的静态数组:
uint<span class="hljs-section">[2]</span> fixedArray<span class="hljs-comment">;</span>
// 固定长度为5的string类型的静态数组:
string<span class="hljs-section">[5]</span> stringArray<span class="hljs-comment">;</span>
// 动态数组，长度不固定，可以动态添加元素:
uint<span class="hljs-section">[]</span> dynamicArray<span class="hljs-comment">;</span>
// 这是动态数组，我们可以不断添加元素
Person<span class="hljs-section">[]</span> people<span class="hljs-comment">; </span>
</code></pre><p><strong>记住：状态变量被永久保存在区块链中。所以在你的合约中创建动态数组来保存成结构的数据是非常有意义的。</strong>（这个是课程的，觉得非常有用，加粗了）</p><h4 id="h-" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">数组的使用：</h4><pre data-type="codeBlock" text="// 创建一个新的Person:
Person satoshi = Person(172, &quot;Satoshi&quot;);

// 将新创建的satoshi添加进people数组:
people.push(satoshi);
"><code><span class="hljs-comment">// 创建一个新的Person:</span>
Person satoshi <span class="hljs-operator">=</span> Person(<span class="hljs-number">172</span>, <span class="hljs-string">"Satoshi"</span>);

<span class="hljs-comment">// 将新创建的satoshi添加进people数组:</span>
people.<span class="hljs-built_in">push</span>(satoshi);
</code></pre><p><strong>和 Java 不同的是，创建数组可以直接在[]里定义有限长度的数组，动态的就不要写具体的数字长度了，而结构体也是可以被作为数组类型去创建的，可以理解为 Java 里的 List（用的是 List ，而没用数组表示，更容易被大家直观接受）。而关键词也不一样，用的 push（这个是我的个人思考）</strong> 公共数组 你可以定义 <code>public</code> 数组, Solidity 会自动创建 <strong><em>getter</em></strong> 方法. 语法如下: Person[] public people;
<strong>其它的合约可以从这个数组读取数据（但不能写入数据），所以这在合约中是一个有用的保存公共数据的模式。</strong>（这个是课程的，觉得非常有用，加粗了） 定义函数 这是一个名为 <code>eatHamburgers</code> 的函数，它接受两个参数：一个 <code>string</code>类型的 和 一个 <code>uint</code>类型的。现在函数内部还是空的。 代码示例： function eatHamburgers(string _name, uint _amount) {

}
<strong>定义函数的语法和 Python 如出一辙，都是使用 function 作为关键字来标识，入参的变量名字，代码规范是带上下划线，以区分全局变量。</strong> 函数访问权限关键词 Solidity 定义的函数的属性默认为<code>公共</code>。 这就意味着任何一方 (或其它合约) 都可以调用你合约里的函数。显然，不是什么时候都需要这样，而且这样的合约易于受到攻击。 所以将自己的函数定义为<code>私有</code>是一个好的编程习惯，只有当你需要外部世界调用它时才将它设置为<code>公共</code>。 代码示例： uint[] numbers;

//设置为私有的函数
function _addToArray(uint _number) private {
  numbers.push(_number);
}
这意味着只有我们合约中的其它函数才能够调用这个函数，给 <code>numbers</code> 数组添加新成员。 可以看到，在函数名字后面使用关键字 <code>private</code> 即可。和函数的参数类似，私有函数的名字用(<code>_</code>)起始。 返回值 代码示例： string greeting = &quot;What&apos;s up dog&quot;;

// Solidity 里，函数的定义里可包含返回值的数据类型(如本例中 string)。
function sayHello() public returns (string) {
  return greeting;
}
<strong>说实话，solidity这种设计风格看起来就很奇怪….返回值的关键字放在权限后面可以理解…但返回的写法还要多个小括号，看着和需要传参似的….而且用的是 returns ，复数的形式…不能李姐啊！！！总之，多写，多看，多记，可能习惯了将就好了….这个真没有 Java 或者 Python 看着舒服….</strong> 函数的修饰符 如果你的函数没有改变任何值或者写任何东西。 这种情况下我们可以把函数定义为 <strong><em>view</em></strong>, 意味着它只能读取数据不能更改数据: 代码示例： function sayHello() public view returns (string) {
Solidity 还支持 <strong><em>pure</em></strong> 函数, 表明这个函数甚至都不访问应用里的数据，例如： 代码示例： function _multiply(uint a, uint b) private pure returns (uint) {
  return a * b;
}
这个函数甚至都不读取应用里的状态 — 它的返回值完全取决于它的输入参数，在这种情况下我们把函数定义为 <strong><em>pure</em></strong>. <em>注：可能很难记住何时把函数标记为 pure/view。 幸运的是， Solidity 编辑器会给出提示，提醒你使用这些修饰符。</em> <strong>Solidity 里的函数是有状态的，你可以理解为你的代码有没有对数据进行操作。因为在以太坊上进行交互，每次写数据的操作，都需要花费真金白银…所以有了状态设计…像一些读操作的函数，就可以节省下金钱啊！！！</strong> <strong>solidity的代码，所有的数据大小，读写操作，都会和真金白银挂钩，所以，写 solidity 才是真正考验思维逻辑的语言….毕竟不同写法，可能节省的金钱真的天壤之别！</strong> 至于 view 、pure 的具体用法，后面的笔记里，还会有更详细的补充….在第一课的笔记里就先作为了解吧。 类型转换 有时你需要变换数据类型。例如: uint8 a = 5;
uint b = 6;
// 将会抛出错误，因为 a * b 返回 uint, 而不是 uint8:
uint8 c = a * b;
// 我们需要将 b 转换为 uint8:
uint8 c = a * uint8(b);
上面, <code>a * b</code> 返回类型是 <code>uint</code>, 但是当我们尝试用 <code>uint8</code> 类型接收时, 就会造成潜在的错误。如果把它的数据类型转换为 <code>uint8</code>, 就可以了，编译器也不会出错。 <strong>类型转化没啥可说的，基本上就是高级语言的强制转化的写法。</strong> 事件 <strong>事件</strong> 是合约和区块链通讯的一种机制。你的前端应用“监听”某些事件，并做出反应。 代码示例： // 这里建立事件
event IntegersAdded(uint x, uint y, uint result);

function add(uint _x, uint _y) public {
  uint result = _x + _y;
  //触发事件，通知app
  IntegersAdded(_x, _y, result);
  return result;
} 
你的 app 前端可以监听这个事件。JavaScript 实现如下: YourContract.IntegersAdded(function(error, result) {
  // 干些事
})
<strong>事件这个动作，是合约和各类 web3 库实现的交互关键字。当你的合约部署到链上的时候，你通过 js 也好，python 也好，都有这样一个 web3 的类库，通过 web3 的库，可以从链上读取到你部署的合约，在用该合约进行你所创建的事件进行交互。</strong> <strong>以客户端，服务端的架构理解的话，你可以理解为事件就是服务端主动触发的一个动作，这里的服务端可以理解为链上的合约。客户端就是你前端的代码。</strong> 以上，第一课的笔记告离段落…..</p>]]></content:encoded>
            <author>yidakoumi@newsletter.paragraph.com (dami.eth)</author>
        </item>
        <item>
            <title><![CDATA[【财神道|分享】邀请 MOD 分享拿白经验]]></title>
            <link>https://paragraph.com/@yidakoumi/mod</link>
            <guid>FOtGnmrStis0q5rBawID</guid>
            <pubDate>Sat, 07 May 2022 02:53:01 GMT</pubDate>
            <description><![CDATA[前言最近法哥的【财神道】社区里邀请了几个有 MOD 经验的朋友做分析，以 MOD 的角度来看，如何更好的拿白？ 下面是两个提到的链接，永久有效。 有想学习 nft 的朋友，可以加入社群，法哥 dc 社群邀请链接（永久）： https://discord.gg/n8xEw7QQY5 本次分享的原音频留存： https://open.spotify.com/episode/6k50tjDPhaea1efOaaHsT9笔记分享简单记录一下法哥 dc 群里分享的邀请经验。如何看个人时间的分配？（因为有主业，有副业） 把你玩的时间分配出来，上厕所的时候，刷抖音，完全可以换成刷刷 dc ，看看信息，信息就是金钱，如果你早知道【财神道】的项目，早点做贡献，是不是白捡钱？如何像猫姐一样这么优秀？（MOD大佬 - 猫姐） 猫姐为社群做的共享，语音频道组织活动，积极主动，拉动气氛，你说能不找你当 mod 么？如何简单快速的判断项目是否值得肝白？ 1）如果 dc 人数是 Twitter 的人数 1.5 倍，就有很危险了. 2）在线人数也是参考点，如果工作室人很多，那就也很危险了.为什么要搞社区的活动？...]]></description>
            <content:encoded><![CDATA[<h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">前言</h2><p>最近法哥的【财神道】社区里邀请了几个有 MOD 经验的朋友做分析，以 MOD 的角度来看，如何更好的拿白？</p><p>下面是两个提到的链接，永久有效。</p><p>有想学习 nft 的朋友，可以加入社群，法哥 dc 社群邀请链接（永久）：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://discord.gg/n8xEw7QQY5">https://discord.gg/n8xEw7QQY5</a></p><p>本次分享的原音频留存：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://open.spotify.com/episode/6k50tjDPhaea1efOaaHsT9">https://open.spotify.com/episode/6k50tjDPhaea1efOaaHsT9</a></p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">笔记分享</h2><p>简单记录一下法哥 dc 群里分享的邀请经验。</p><ol><li><p>如何看个人时间的分配？（因为有主业，有副业） 把你玩的时间分配出来，上厕所的时候，刷抖音，完全可以换成刷刷 dc ，看看信息，信息就是金钱，如果你早知道【财神道】的项目，早点做贡献，是不是白捡钱？</p></li><li><p>如何像猫姐一样这么优秀？（MOD大佬 - 猫姐） 猫姐为社群做的共享，语音频道组织活动，积极主动，拉动气氛，你说能不找你当 mod 么？</p></li><li><p>如何简单快速的判断项目是否值得肝白？ 1）如果 dc 人数是 Twitter 的人数 1.5 倍，就有很危险了. 2）在线人数也是参考点，如果工作室人很多，那就也很危险了.</p></li><li><p>为什么要搞社区的活动？（比如打德扑，玩游戏，唱歌等等..） 玩起来是破冰，建立气氛，在这个过程中，管理层其实也是在观察大家的能力，选人的一个过程.</p></li><li><p>NFT 发完怎么创造后续价值？（build value，by 法哥） mint后，要继续做事，不是说去 Twitter 上吹牛逼，抽奖之类的。拿到资金后，比如可以做工具...聚集一些人踏踏实实做实事。（就和实体公司拿到投资后一样。）</p></li><li><p>NFT 卖出的时候，有两个费用，是什么？ 一个是 OpenSea 的上架费（只有第一次，现在便宜了，大概$70），还有一个是 gas fee.</p></li><li><p>如何当 MOD ？ 和项目方共进退，经常在社群里活跃，混脸熟，帮助新人，创造价值。一旦有了 MOD 经验后，就有了履历，后续就可以有谈资格了.不建议当太多 MOD ...（因为身体的问题~）有的 MOD 有工资...MOD 有自己的小圈子，相互拿白... PS：MOD 好像有点讨厌工作室的样子....</p></li><li><p>有什么是比较好的做贡献的方式去拿白？ AMA的时候，可以提供翻译的价值！不过非常辛苦，不是英语专业的，非常累，需要非常专注！或者翻译公告.</p></li></ol>]]></content:encoded>
            <author>yidakoumi@newsletter.paragraph.com (dami.eth)</author>
        </item>
        <item>
            <title><![CDATA[discord聊天自动化机器人（Python脚本）]]></title>
            <link>https://paragraph.com/@yidakoumi/discord-python</link>
            <guid>EiuYgiCjdH5TiNXOcqd7</guid>
            <pubDate>Sat, 07 May 2022 02:51:16 GMT</pubDate>
            <description><![CDATA[前言Discord 在 NFT 领域，已经成为了必不可少的社群工具。大部分项目会以 Twitter 为媒体宣传，最终沉淀用户到 discord 中，而要想获得白名单，也不得不遵循项目方的一些玩法，比如早期的聊天肝等级。 当然，你完全可以选择雇佣人去帮你做这件事，只要 ROI 跑的正，这种方式往往要比自动化脚本来的更稳妥一些，毕竟是真人行为，相对脚本，封号（封discord）风险降低很多。 但若不想花这份钱，那则么办...这样一来，就有了一个需求，聊天机器人.... 当然，这里笔者写的机器人并不是那么智能，发消息的内容相关信息是需要你自行配置的。 ps：底层技术用的 python api 模拟请求。（懂 Python 的小伙伴一看就懂...）什么项目不适合聊天？举个例子🌰，前一阵的【阿狸NFT】白名单，社群里早期混进了很多机器人，二话不说直接开刷等级，随后规则明确，社群并不是靠肝等级作为白名单的，当遇到社群管理员不定期巡逻时，表明回复指定数字，或者禁言，机器人没办法自己分析这种语义....该机器人是做不到的。 所以，如果遇到以上情况，可以人为的隔段时间看看，手动暂停脚本即可。脚本...]]></description>
            <content:encoded><![CDATA[<h1 id="h-" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">前言</h1><p>Discord 在 NFT 领域，已经成为了必不可少的社群工具。大部分项目会以 Twitter 为媒体宣传，最终沉淀用户到 discord 中，而要想获得白名单，也不得不遵循项目方的一些玩法，比如早期的聊天肝等级。</p><p>当然，你完全可以选择雇佣人去帮你做这件事，只要 ROI 跑的正，这种方式往往要比自动化脚本来的更稳妥一些，毕竟是真人行为，相对脚本，封号（封discord）风险降低很多。</p><p>但若不想花这份钱，那则么办...这样一来，就有了一个需求，聊天机器人....</p><p>当然，这里笔者写的机器人并不是那么智能，发消息的内容相关信息是需要你自行配置的。</p><p>ps：底层技术用的 python api 模拟请求。（懂 Python 的小伙伴一看就懂...）</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">什么项目不适合聊天？</h3><p>举个例子🌰，前一阵的【阿狸NFT】白名单，社群里早期混进了很多机器人，二话不说直接开刷等级，随后规则明确，社群并不是靠肝等级作为白名单的，当遇到社群管理员不定期巡逻时，表明回复指定数字，或者禁言，机器人没办法自己分析这种语义....该机器人是做不到的。</p><p>所以，如果遇到以上情况，可以人为的隔段时间看看，手动暂停脚本即可。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">脚本成果演示</h3><p>下图是我自己创建的一个 discord 服务器，并且新建了一个名为 gm 的频道：</p><p>mirror的gif图片有点问题，可以移步图床链接🔗：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ibb.co/tLzmxtQ">https://ibb.co/tLzmxtQ</a></p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">代码分享</h3><p>代码方面，采用的是 Google 的云服务，这样省去了我们自己电脑装环境的一些问题。</p><p>打开下面的代码网页之后，用 google 登录，然后回到本篇文章，继续往后看如何配置运行。</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://colab.research.google.com/drive/1k1MjTw0HaIhXmyHIm-KsHrKECpu9ASPy?usp=sharing">https://colab.research.google.com/drive/1k1MjTw0HaIhXmyHIm-KsHrKECpu9ASPy?usp=sharing</a></p><h1 id="h-" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">前置代码配置</h1><p>在正式讲解之前，你需要自行打开上述代码文档，配置三个选项。</p><p>分别是【<strong>channel id（频道id）</strong>】，【<strong>机器人发送消息的内容</strong>】，以及最重要的 【<strong>authorization 认证</strong>】。</p><p>我们一个个来说。</p><h3 id="h-1channel-idid" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1、channel id（频道id）</h3><p>当我登录 discord 后，加入了一个 discord 服务器后，并且进入了某个频道：</p><p>你当前的网址 url 是这样的：</p><p>discord.com/channels/937164774674952222/937370268425400371</p><p>那么，channel id 则为 ：937370268425400371</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f1bb6213e68021e20a07b4d935e409351c9a7ad8465f7c2ca91cab7e9dead377.png" alt="channel id" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">channel id</figcaption></figure><p>回到我们的代码网页，把下面的配置改为自己的 channel id，这里是可以支持多个频道的，比如 gm 频道，官方中文频道：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/082ecf813ed05e99e4ec7dbeb6279f70077ce725320debf3bf9196962595f249.png" alt="channel id 修改配置" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">channel id 修改配置</figcaption></figure><p>配置多个的话，就是下面这个样子，双引号里面是频道id，多个频道用逗号隔开：</p><p><code>channels_id_list = [&quot;937370268425400371&quot;,&quot;937370268425400372&quot;]</code></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e066faa935f6b2ffd68e5860809575b3a4403ffa25ad2864d9cb44150d5faf89.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h3 id="h-2" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2、机器人发送消息的内容</h3><p>这里的文字可以替换成自己想让机器人说的，它会随机选择一句话来发送，所以当然是越多越好了，虽然有默认值，但是大家可以按照自己的口味改一改。</p><p>比如：</p><p><code>globals_message_list = [&quot;GM&quot;,&quot;你好啊&quot;,&quot;早上好&quot;,&quot;晚上好&quot;,&quot;你个大骗子&quot;,&quot;GN&quot;,&quot;怎么可能？&quot;]</code></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d52c9ce554fbe8d7afbf352e0f33f2f5f62c8b04dfeabc77e0d45b26262fd91f.png" alt="发送消息的配置" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">发送消息的配置</figcaption></figure><p>附加项，这里还有 2 个可以自行修改的值，即每条发送消息的间隔时间，像我现在写的时间，就是在 10~30s之间，随机间隔时间去发送，比如上条信息刚发完，有可能下一条信息过了 15s ，才会发送，也可能是 10s，这个是不定的，为了更像的模拟人为嘛：</p><p><code>time_min = 10</code></p><p><code>time_max = 30</code></p><p>你要是想让他发送快点，也可以设置成最小是 5，最大是10，这样时间就会缩短了：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c0666eafabb15dd6f92d6bdfcc4f82ecc6f4c53ea869e524996d74824e638ab4.png" alt="发送消息的时间间隔" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">发送消息的时间间隔</figcaption></figure><h3 id="h-3authorization" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3、authorization 认证</h3><p>这一步至关重要，请保存好您的 authorization 信息，因为有了它，任何人都可以用它对您的账号进行一些 api 层的操作，所以谨慎保管好。</p><p>当然，这个信息也会失效，我记得默认的有效期 discord 会保留 7 周（没记错的话...）。</p><p>如何获取？打开您的 discord 网页版，在用键盘的快捷键打开谷歌浏览器的【开发者工具】：</p><p>Mac的快捷键： option+command+i</p><p>Windows的快捷键：ctrl+shift+i</p><p>当然，也可以从 Chrome 这里进去：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/57ea255793c7ec9d7a24f7464a0d2b3f21672f09a0888fc8b5662fad4778bbab.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>打开后，点到 network（网络）选项页：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b38911204c225a8c8791a9e3ae210e8b8a9624304f7f799de6c6b159e49ecbcb.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>然后依次点击：</p><p>1、 XHR 选项卡</p><p>2、再随便点一个频道</p><p>3、随便找一个 Name，点击英文字符</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/18f52346ca77cb792b42551143fe307d464cb1f6b21e0df470ae3e441b0d472c.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>点开下方的 Name 后，可以看到这样的代码：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/fa86a2e2ff3b692d696e9d62278806b854f7719f1aa353242ab068e66ee9eccd.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>把 authorization: 后面对应的那串英文，记录下来，放到代码对应的配置项中：</p><p><code>authorization_list = [&quot;OTI4**************************************GA&quot;]</code></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/afa169f958eb78f30c2fe65c1521339b4249fb04d4f87d36d3fd6e98a8245720.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>配置好以上信息，大功告成！~</p><p><strong>再次提醒，authorization 对应的字串非常重要，不要公开！不要公开！不要公开！</strong></p><h1 id="h-" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">运行代码</h1><p>点击代码左侧的红色运行标志，然后就可以回到你的网页去看是否发送消息啦：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/62211d20ec8c6041e0772709553975abc342f417749ea170af3b6e6e9681053a.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>成功的话，拉到网页最下面，有信息提示：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a6ce9377326f1399dd04d82dad63eca5ca97bbb8b206c13b8f939d2f4a44e7cc.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h1 id="h-" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">停止代码</h1><p>停止代码，点终止图标即可：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f6a74565b9af561d3d92bde53217862c97985bae03ffb4e805422473534dc0c4.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>如果点了没反应，可以多点2，3下，会弹出下面这个提示，点击yes：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6874fbd499cd4e4f434fe02b957704fcb8707e20e3aba570fe2986dedfcd1385.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>代码停掉后，图标变回开始的图标，说明停止成功：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e269cc15ac99716cb44da2506c10e373656ecc3053eb66a870e30186983c5291.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>下面的日志，可以把鼠标移动到管理员图标上，就会变成叉子，点击即可清除：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/348104d5bea54bf1aa7ecd8b637cbbdaa55a3b3abefdec168235eefc3c95a765.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h1 id="h-" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">其他的一些问题</h1><p>如果你关掉你的google云服务网页，脚本没有停止的话，程序还是会执行的，具体会执行多久，我自己还没有亲自实验过，官方提示，是12个小时。所以要是怕被管理识别到，还是手动停止掉，再去关闭 google 的云服务。</p><p>再者就是发送消息的时间间隔问题，建议不要太短，比如 3s 以下，毕竟要让机器人装的像人一些....</p><p><strong>注：若害怕脚本不稳定（网络ip方面的封号问题），可以用自己的discord小号尝试一段时间，绕开自己常用的主号测试！</strong></p><p>好，以上就是完整的分享了....希望大家可以玩的愉快！</p><p>💎 |币圈萌新|NFT学习中|成为科学家的路上|💎</p><p>我的Twitter：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/jacksu15ice">https://twitter.com/jacksu15ice</a></p>]]></content:encoded>
            <author>yidakoumi@newsletter.paragraph.com (dami.eth)</author>
        </item>
        <item>
            <title><![CDATA[MetaMask小狐狸钱包新手入门使用教程]]></title>
            <link>https://paragraph.com/@yidakoumi/metamask</link>
            <guid>ONOkeWOess8EOgd9dFns</guid>
            <pubDate>Sat, 07 May 2022 02:49:20 GMT</pubDate>
            <description><![CDATA[零、前言本教程为系列教程，本篇是小狐狸钱包篇。后续会把系列教程的相关链接更新在文章开头。 我从去年（ 2021 年） 12 月底，决定开始学习接触区块链的世界，深知作为一个小白，想要入门时的无力感，各种名词黑话，各种看不懂，信息过于嘈杂也毫无体系感。 虽然我现在仍处于新手期，还在学习路上，但希望可以把自己踩过的坑，以及小白的痛点经验，尽可能地以通俗易懂的形式分享出来，帮助大家少走一些弯路。 关于名词的介绍，大可放心，一切用举例加以说明。 希望本篇文章可以对你有所帮助~ 下面开始正文。一、钱包是什么？钱包两字，顾名思义，现实生活中，我们是用来装钱的。 而在区块链世界中，钱包就是保存了区块链中各种币（比特币、以太币等）的一个软件。 在正式介绍小狐狸钱包之前，我们需要先了解一下，什么是以太坊？以太坊是一个去中心化的、具有智能合约功能的开源区块链。以太币（ETH）是该平台的原生加密货币。在加密货币中，以太币的市值仅次于比特币。以太坊是由程序员Vitalik Buterin（V神）在2013年创作的。以太坊官网PS：关于以太坊的更多内容，大家可以去以太坊官方网站进行学习，这里不过多赘述，你...]]></description>
            <content:encoded><![CDATA[<h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">零、前言</h2><p>本教程为系列教程，本篇是小狐狸钱包篇。后续会把系列教程的相关链接更新在文章开头。</p><p>我从去年（ 2021 年） 12 月底，决定开始学习接触区块链的世界，深知作为一个小白，想要入门时的无力感，各种名词黑话，各种看不懂，信息过于嘈杂也毫无体系感。</p><p>虽然我现在仍处于新手期，还在学习路上，但希望可以把自己踩过的坑，以及小白的痛点经验，尽可能地以通俗易懂的形式分享出来，帮助大家少走一些弯路。</p><p>关于名词的介绍，大可放心，一切用举例加以说明。</p><p>希望本篇文章可以对你有所帮助~</p><p>下面开始正文。</p><h1 id="h-" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">一、钱包是什么？</h1><p>钱包两字，顾名思义，现实生活中，我们是用来装钱的。</p><p>而在区块链世界中，钱包就是保存了区块链中各种币（比特币、以太币等）的一个软件。</p><p>在正式介绍小狐狸钱包之前，我们需要先了解一下，什么是以太坊？</p><blockquote><p>以太坊是一个去中心化的、具有智能合约功能的开源区块链。</p></blockquote><blockquote><p>以太币（ETH）是该平台的原生加密货币。</p></blockquote><blockquote><p>在加密货币中，以太币的市值仅次于比特币。以太坊是由程序员Vitalik Buterin（V神）在2013年创作的。</p></blockquote><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/ccc3838d837e9726eb6e142bc3af0f01686a6404365aac33e0f0c408459a053e.png" alt="以太坊官网" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">以太坊官网</figcaption></figure><p>PS：关于以太坊的更多内容，大家可以去以太坊官方网站进行学习，这里不过多赘述，你只需要知道，它的技术理念是基于比特币，在比特币技术的基础上，还可以支持运行代码的一个区块链。</p><p>官网：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum.org/en/what-is-ethereum/">https://ethereum.org/en/what-is-ethereum/</a></p><p>正如以太坊官网介绍，如果想参与基于投资【以太坊】诞生的项目（比如现在火热的 NFT 市场，像国民表情包冷兔、阿狸），必不可少的就是以太坊钱包，而 MetaMask 就是这样的一款钱包软件。</p><blockquote><p>NFT（non-fungible token，学名，非同质化代币），它是存储在区块链上的不可交换的数据单位，区块链是一种数字账簿形式。</p></blockquote><blockquote><p>NFT数据单位的类型可能与照片、视频和音频等数字文件有关。</p></blockquote><blockquote><p>因为每个代币都是唯一可识别的，所以NFT与区块链加密货币不同。</p></blockquote><p>光看概念，过于抽象，举个例子🌰。</p><p>国内在 2021 年，支付宝曾经推出蚂蚁链（现在改名，叫【鲸探】了），上面掀起过一阵潮流，比如下图的我抢到的猪八戒 NFT，准确的说，在国内它的中文名字叫【数字收藏品】：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9de80e2af787a3d00137d169882da210f02bfe8e50f086aba62c4089b878ec40.png" alt="央视动漫发行的数字收藏品" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">央视动漫发行的数字收藏品</figcaption></figure><p>而目前海外的 NFT 市场，以感官去认知的话，可以简单理解为一群艺术家创作出来的有趣图片，当然，这里说的<strong>仅是视觉感官，而非价值意义</strong>：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6626c9e572b4c48103f89b6d00ed9444f319837dc2e80993f3de5bcbc31bf561.png" alt="图片来源：https://opensea.io/collection/boredapeyachtclub" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">图片来源：https://opensea.io/collection/boredapeyachtclub</figcaption></figure><p>好了，回归正题，在海外市场，意味着：</p><p><strong>有了钱包，你才可以在 NFT 市场中进行交易。</strong></p><h1 id="h-metamask" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">二、MetaMask钱包下载</h1><p>首先要下载 MetaMask 钱包，认准官方网站，你可以直接在 Google 上进行搜索：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8e40e047a56556c716f1acbc07b5c83e6ee50d6601c4d58c7505201da5330b0e.png" alt="🔍metamask" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">🔍metamask</figcaption></figure><p>切记，域名是以 .io 结尾的，不要去假官方网站下载，以防被骗。</p><p>这里也给出官方地址：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://metamask.io/">https://metamask.io/</a></p><p>在网页端，点击 download 进入到下载页面，在点击 install metamask for chrome ：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/33882dbf8197c87f4fe20b8350589e67bd743a8a951a517d56042a4145372d7c.png" alt="下载" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">下载</figcaption></figure><p>点击，添加至 Chrome ：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/216ed84d3e074142b21b0c815dcc5b5cb8c327a5c69da1f5cfd97caf2e32ee17.png" alt="添加至浏览器" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">添加至浏览器</figcaption></figure><p>可以在拓展图标里，把小狐狸钱包显示出来：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0b52a9c0ba7852f9146bbd97ef0eafe65e86852075db1b2547534053a57ca515.png" alt="固定图标" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">固定图标</figcaption></figure><p>当你第一次安装完插件时，会跳出第一使用 MetaMask 页面，说明安装成功：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/361214fc222341f557cdb9b8232bd3c59452a3bf35319bf67117f6f92c72dbee.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><h1 id="h-metamask" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">三、注册 MetaMask</h1><p>如果你是第一次使用 MetaMask 钱包，那么选择右侧，进行创建：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/aa385ec77c04ef788e1be219aa79254b1e67133154c3a3e65556ddc7b5ea172f.png" alt="创建" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">创建</figcaption></figure><p>选择，我同意：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a042d1f6587935c9bdb6871b4d6e6f88ea3af43e080840484ad42c04fceddbbc.png" alt="我同意" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">我同意</figcaption></figure><p>输入自己的密码，注意，这里的创建密码，指的是钱包的登录密码，类似我们登录QQ的账户密码：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/802547cae7b53f069b43884483d2b1a69f91c4ff5e96666f420dcd94819ff38d.png" alt="创建密码" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">创建密码</figcaption></figure><p>点击创建，这里是官方介绍的一段关于助记词如何保证你钱包安全的教程，建议看一下，看完点击下一步：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d50532e873fb90044a39710293c7bb8458535b4ada0ce51a97d0fe0af47bc468.png" alt="官方视频" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">官方视频</figcaption></figure><p><strong>助记词，非常重要！！！</strong></p><p><strong>助记词，非常重要！！！</strong></p><p><strong>助记词，非常重要！！！（重要的话说三遍）</strong></p><p>点击此处显示密语，你就可以看到自己的助记词了。</p><p><strong>官方建议，把它抄写在纸上，多抄几个，放在不同的地方保存，切记不要直接记在的云笔记里！</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e3edd2564c7995f052ed8d25dd6a915f8f22e755ffeeb0feb904b47fb682a4db.png" alt="助记词" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">助记词</figcaption></figure><p>为什么说助记词非常重要？因为有了助记词，不论是谁，都能直接把你钱包直接恢复。假如你的助记词落入了他人之手，那么你钱包里的钱，就可以无条件被别人转走了。</p><p>不让记在云笔记里的原因也是如此，毕竟黑客的手段层出不穷，如果拿到你的助记词，你的钱就没了。所以，线下的物理记录，一定要保存好。</p><p><strong>再次提醒：助记词和刚才步骤经历的账户密码不一样，如果一旦丢了，你的钱包资产就再也找不回来了。我听过有大佬血淋淋的案例，早期他买入比特币很久，采用的是线下物理记录助记词，结果时隔几年，一直没有在意当初买的数字资产，20年的时候才想起要登录钱包上去看看资产变为多少了，但之前的电子设备早已更换，新设备重新安装钱包，就要通过助记词恢复账号，结果发现自己把助记词弄丢了，千万资产一夜之间找不回来了....非常痛心，这个不是编的故事，而是真实发生过的案例...发出来就是想告诉大家，助记词非常重要！！！</strong></p><h1 id="h-metamask" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">四、MetaMask 常用的基础功能</h1><p>当你记好助记词后，页面会进入到如下：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/16bc5f771361a748a934641a6e6615ce79fd6c7a191467d16c2013191be12bae.png" alt="metamask主页" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">metamask主页</figcaption></figure><p>可以先将它关闭。</p><p>打开小狐狸的方式，最常见的还是从浏览器的扩展图标进行进入，点击狐狸头像 🦊：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2660cb2476f9731732ba1e35bbc51c0a9de179bbf3f9aed5da461a32f88f4ffe.png" alt="点击图标" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">点击图标</figcaption></figure><p>我们从上往下看，一项项介绍。</p><h3 id="h-1" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1、网络</h3><p>在小狐狸最上方，有一个网络显示，点击一下，可以看到，我们当前默认新创建的钱包处于以太坊的主网络中。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4d13134695b4e2437b9d20ed8425b45d17533db28e3e606482095d24af9cced0.png" alt="网络" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">网络</figcaption></figure><p>用户可以根据不同的应用需求，添加自己需要的网络。比如你在玩一款由币安投资的区块链游戏，那么人家游戏是币安投资的，所以基础货币流通肯定也是币安的代币，那你就需要把网络切换到【币安智能链，英文简称：BSC，Binance Smart Chain】的主网络上，使用 BNB 才可以与游戏进行一些基础交易。</p><p>你玩什么应用，就要对应到应用所需的网络中，比如 OpenSea 的 NFT 市场，对应的则是【以太坊主网】，对应代币则为 ETH 。</p><p>如何添加并且切换网络呢？</p><p>这里提供一个网站，通过 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://chainlist.org/">https://chainlist.org/</a> ，可以进行链接钱包，自动添加网络。</p><p>具体操作如下，点击 connect wallet 链接钱包：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a0d3df792fba68a9a70865efe025fb7b17a7aa4ba7b0da78af930c66be989a0c.png" alt="链接钱包" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">链接钱包</figcaption></figure><p>弹框，点击下一步：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/729438979ae35c92b82cd92b9aa8d40943ab9c028d4ee0c4557b32ee4d332fa3.png" alt="下一步" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">下一步</figcaption></figure><p>点击连接：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a6782fd5dde4b5d32b1b7e075f368d9f1ab79fb80133384c3dc14a9c8d3cb715.png" alt="连接" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">连接</figcaption></figure><p>币安的网络可以搜索 ，bnb，点击 add to metamask：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/eaa76aaff4ede02a9a71de062544933943cabadd7c7df0b9b6007f5b2995a193.png" alt="搜索网络名称" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">搜索网络名称</figcaption></figure><p>approve，授权：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/980954660f1a7398187df5ccad1166c351c7fb38581a59f2fe81b16fe8d59205.png" alt="确认授权" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">确认授权</figcaption></figure><p>切换到 BSC (币安智能链)网络后，发现下面的代币也随之改变了，变成了 BNB：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4f542acb7a25a82e636a010f333be232a0204c707b50d60389c9d062a98d183d.png" alt="切换网络" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">切换网络</figcaption></figure><h3 id="h-2" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">2、添加代币</h3><p>名称解释：</p><p>代币，英文名，token。</p><p>钱包的网络下，除了主网默认的代币外，还可以手动添加代币，前提是该代币也是基于此网络的。</p><p>怎么理解代币，每个区块链技术都有可能会有自己的代币，你可以理解为它们自己的货币，如果你想用人家的技术，或者玩别人平台的游戏，那么就需要用到人家发行的代币。</p><p>就像我们玩 QQ 一样，你想买 QQ 皮肤，那就需要充值 Q 币一样。你想玩王者荣耀，就需要充值王者点券一样。不同平台对应着自己的平台虚拟币。</p><p>以 【以太坊】主网举例，下图我们可以看到，默认代币 ETH 。</p><p>这里举个例子，更通俗易懂。</p><p>前一阵，区块链游戏 LOK （League of Kingdoms），一款类似于海岛奇兵的免费链游，正式发行了它的代币，名字叫 $LOKA。</p><p>但显然，我现在的钱包网络里，以太坊主网下面明显是没有该币种的。我应该如何添加它呢？</p><p>首先，点击下图的 import token（导入代币）蓝字：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5f0ad9d69d1a98da1d3abc1c182ba190d1cdebab49aa8bf46795eac8bb255233.png" alt="import tokens" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">import tokens</figcaption></figure><p>进入后，可以看到下图搜索，LOKA，发现并没有搜到：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/155504612cca86ac04349c79a640d4b74d2f4e483a7ac50a10eb4fcea60409ab.png" alt="搜索token" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">搜索token</figcaption></figure><p>既然搜不到，只好点击【自定义代币】了：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c848de94dc7edb15be5dc4029b8e2e19d29ad89bf758dac60a8984ab66ac46e4.png" alt="自定义代币" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">自定义代币</figcaption></figure><p>可以看到，第一行就需要我们填写合约地址，那我们如何查找它的合约地址呢？</p><p>这里推荐一个我自己常用的网站 coinmarketcap。</p><p>顺便可以用谷歌邮箱注册一下，是一个非常好用的币圈资讯类工具网站：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://coinmarketcap.com/invite?ref=GXK9W11L">https://coinmarketcap.com/invite?ref=GXK9W11L</a></p><p>PS：多说一句， coinmarketcap 每日有钻石💎签到的任务，足够数量的💎，可以在该平台上免费换取 NFT。白嫖的机会不要错过哦~</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/33b5470f426e174baccbe69e62cd79c5bf1916cc4a51e6954151c00babbeb1c1.png" alt="coinmarketcap签到💎奖励" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">coinmarketcap签到💎奖励</figcaption></figure><p>回归正题：</p><p>搜索栏🔍，LOKA，便可以看到代币名字出现：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/da88c8aecbb6ed0e869831908299e9879bcbba3e886f7343d8458ca121996f62.png" alt="coinmarketcap搜索" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">coinmarketcap搜索</figcaption></figure><p>进入后，找到 contracts 这一项，便是代币的合约地址了，把它复制一下：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3e94111cea80f0af5aec165fdb614bb58723e5d459411dd75db9abfe94db4de2.png" alt="合约地址" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">合约地址</figcaption></figure><p>粘贴到合约地址上，稍等2s，下面的代币符号和精度会自动填充，然后点击【add custom token】：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/17034f519fb003978b866ffd605ea5df9ede12e078ef5b0c32cae19850e09338.png" alt="添加自定义token" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">添加自定义token</figcaption></figure><p>点击【import tokens】：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7f0db051cb120415af645ede1a78bb92f9cf76fffd285923cfd41f61fba12fa1.png" alt="导入token" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">导入token</figcaption></figure><p>LOKA代币添加成功：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2bca97babb5130b4fb2440780600f6fedd4b7ee8a5f7b333de4e4860457a7310.png" alt="添加token成功" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">添加token成功</figcaption></figure><h3 id="h-3" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3、钱包地址</h3><p>Account1下面有一串 0x..... 的符号，即为钱包地址，可以理解为现实世界的银行卡号。当要发生转账交易的时候，必须知道你的卡号才能给你转钱。钱包地址，同理。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a8bfb4a3036d87b4ad586b33af9e86ce50acb464e2b46e1b4d6b63118aa4f15c.png" alt="钱包地址" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">钱包地址</figcaption></figure><p>当你创建完新钱包后，钱从哪里来？肯定是需要从有钱的资金账户里给你转进来。（可以是你自己的交易所账户，也可以是找有货币的好朋友，让他们帮你转入）</p><p>很多新手最困惑的地方也在于此，那这里我们放在后面的转账部分说。</p><p>关于钱包地址，<strong>在小狐狸钱包中，你不论切换哪个网络，它只要是一个账户下的，钱包地址都是统一的一个</strong>，比如可以看下图：</p><p>当前是以太坊为主网络，地址为 0xCC1...43A4 ：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/12a982338a1bbe6e6fd87c9ca1e32b3ea5c9c3618fa9b5422fdaa08e8da89f37.png" alt="以太坊网络钱包地址" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">以太坊网络钱包地址</figcaption></figure><p>切换到 BSC 网络，可以看到地址依然为 0xCC1...43A4 ：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9878fa12b734ae46330b44c8fbbf8b9f4979bf798b41765f75e952e4d9b90152.png" alt="币安网络钱包地址" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">币安网络钱包地址</figcaption></figure><p><strong>大家初次使用，可以自行切换网络，把两个地址粘贴出来，做个对比，看看是否相同。</strong></p><p><strong>那如何改变自己的钱包地址呢，或者准确的说，作为第一个学习的钱包账号，我授权了很多第三方网站，很担心后期的资金风险，我应该如何新建账号？</strong></p><p>我们可以点击右侧头像图片，在弹出的框中，你可以看到下图的几个选项：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3b1f5ad8130e9cd73acd68892b69caf56ad8c687979cef3796f1efa7b6f24795.png" alt="点击头像" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">点击头像</figcaption></figure><p>点击，新创建账户，起一个你想要的名字：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c3ff2bda891bfb8692ef94d3d9b8b752a1ba7e6752fe52fb06ea18d90163df24.png" alt="创建取名" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">创建取名</figcaption></figure><p>创建完成后，可以看到，我的账户中多了新创建的账户：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e81950a0b0d8ad55662023087b5115f9b498b8661c924ff13e6936ac262d76a0.png" alt="成功创建新账户" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">成功创建新账户</figcaption></figure><p>查看地址 0x07E...10af，已经变为新的地址了：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/15bdbf47887ccb8a3dc040d95a1acbb7fe4f37960e1ae2596b0fefe2d10276c2.png" alt="新账户钱包地址" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">新账户钱包地址</figcaption></figure><p>新创建账户，可以有效的解决资产分散规范的问题，比如你一个账户作为只用来交易【以太坊主网络】的账号，另一账户只用来作为交易【BSC，币安智能链主网络】。</p><p>也可以解决隔离作用，比如像上面提到的，新手小白学习阶段，你钱包第一个账户会授权很多网站，参与空投之类的，从而造成的授权网站不安全的问题。</p><h3 id="h-4" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">4、转账</h3><p>名词解释：</p><p>USDT，泰达币，1：1锚定美元的一种基础数字货币。</p><p>ETH，以太币，以太坊的代币。</p><p>准确的说，转账部分不算是钱包的操作，更多的是交易所或者其他资金账户里的操作。为了便于大家实操理解，关于转账的操作，这里放上一个交易所提币的图片，供大家参考。</p><p>以 MetaMask 网络为以太坊举例，我们要先在交易所里购买 ETH ，如下图：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/afc8b7b36cc7c1b915ef95a86674667687b50c8527e6aab8a018af544628ff61.png" alt="交易所购买ETH" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">交易所购买ETH</figcaption></figure><p>可以看到，图中这里是用 USTD 进行购买的 ETH ，当前时间价格，1ETH ≈ 2300 USDT。图中右边绿色2411.73的价格，是当前买入的第一个价格，如果着急购买，可以把自己的【限价委托】下面的【价格格，改为和这个一样的数字，我委托的价格是，2410.98 USDT。</p><p>PS：我用的交易所是【欧易】，英文：OKEX（前一阵改名，叫 OKX 了），目前支持大陆交易（微信，支付宝，银行卡）购买 USDT 。推荐使用不常用的银行卡进行转账交易。</p><p>官方注册网址：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.ouyicn.click/join/11768704">https://www.ouyicn.click/join/11768704</a></p><p>注册的时候，首选 Google 邮箱进行注册。kyc认证可以用大陆身份证进行认证，解除每日交易的限额。</p><p>购币的操作有些敏感，很多小白会卡在这一步很久，但其实，当你迈出注册账号，并且过了 kyc 验证的那一步，转账入金的好奇心，终归不再是门槛，而是打开新世界的大门....所以具体操作，不罗列，大家可以自行研究，因为，真的不难，只要是用过手机的人....相信都可以研究出来！</p><p>当你成功购买 ETH 后，在 APP 的资产项里，进行提币操作：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/222a576bc08c8dca637e3fbf531418bac9cc037078f0807359ee0d26ac866109.png" alt="资产-提币" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">资产-提币</figcaption></figure><p>点击提币：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e1f6aa00a6e9df44d007254ccea0397107e598dcd70cf798ac564a7e929fae4c.png" alt="提币详情" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">提币详情</figcaption></figure><p>提现网络，选择 ETH-ERC20，注意别选错了....这个是 ETH 主网对应的协议。</p><p>提现地址，填写小狐狸钱包的账户钱包地址，也就是 0x... 那串。</p><p>数量，根据你已购的 ETH 进行转账。</p><p>手续费，购买的 ETH 余额里，要留出手续费。</p><p><strong>提示：为了确认自己的第一次操作无误，建议先小额进行 ETH 转账，无非就是多花一次 0.005 ETH 的手续费。</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b6a6bff749f7fa4a01a58c6e27cc68bb36de3cb3a4494f3f7628f5864e3ca531.png" alt="网站币种转化： https://coinmarketcap.com/converter/" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">网站币种转化： https://coinmarketcap.com/converter/</figcaption></figure><p><strong>0.005 ETH ，大约 70 RMB，一次手续费虽然不便宜，但是多少可以规避大金额转错账的情况。</strong></p><h1 id="h-" class="text-4xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">五、常见问题</h1><h3 id="h-1" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1、语言在哪里设置？</h3><p>打开设置-通用，语言（根据自己常用语言设定）：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/61f9530c8d394aa5179e158f733cfd1b08b9374cbe061d9e94c10626e34c7748.png" alt="设置" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">设置</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2399c2c4b34775682bf9ae345e47154c9a20ff8713314abd3de3d0e7119ab028.png" alt="语言" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">语言</figcaption></figure><h2 id="h-2" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">2、助记词忘记了怎么办？</h2><p>当你没有换设备，或者浏览器没有卸载插件的前提下，可以按照如下方式查看当前的助记词：</p><p>打开设置：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/61f9530c8d394aa5179e158f733cfd1b08b9374cbe061d9e94c10626e34c7748.png" alt="设置" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">设置</figcaption></figure><p>找到【安全-隐私】：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4381e6e89526a9fb95a4e7fff2ea44b76319a4b28f48acfe0224f7c39b0caa5e.png" alt="安全与隐私" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">安全与隐私</figcaption></figure><p>点进去，输入密码即可：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e0581b45ba3aee5cd5c247929d8e5d023fb034d0a750712e7ffa6b30a8f737f8.png" alt="显示助记词" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">显示助记词</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/a657a960d379538fa016f8526a1663ccd663113e2a1b89726d4dbcb5c2658d9f.png" alt="输入密码" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">输入密码</figcaption></figure><p>输入账户密码后，即可看到助记词，不做演示了，信息敏感，大家自行实验。</p><h3 id="h-3" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3、助记词恢复钱包，账户丢失问题</h3><p>小狐狸在网页端账户有多个，助记词恢复后，发现账户丢失。</p><p>案例：先用浏览器插件创建了一个账号1，成功后把这个账户导入到了小狐狸app中，再用浏览器插件创建了账号2，发现助记词一样，这时浏览器插件有两个账户，小狐狸app只有一个账户了。</p><p>具体可以看下官方的解释：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://metamask.zendesk.com/hc/en-us/articles/360015489271-How-to-add-missing-accounts-after-restoring-with-seed-phrase">https://metamask.zendesk.com/hc/en-us/articles/360015489271-How-to-add-missing-accounts-after-restoring-with-seed-phrase</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://metamask.zendesk.com/hc/en-us/articles/360058120992-My-Seed-Phrase-Secret-Recovery-Phrase-restored-the-wrong-account?source=search&amp;auth_token=eyJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50X2lkIjoyMzEzMDkzLCJ1c2VyX2lkIjoxMjY1MDc3NDUyMjQ5LCJ0aWNrZXRfaWQiOjI1MDQ1MCwiY2hhbm5lbF9pZCI6NjMsInR5cGUiOiJTRUFSQ0giLCJleHAiOjE2Mjk4NTQ5MTZ9.7hhPCTN2kyHS6AIN597k46WiQ0yl7LBoI9Xc6WsRuUY">https://metamask.zendesk.com/hc/en-us/articles/360058120992-My-Seed-Phrase-Secret-Recovery-Phrase-restored-the-wrong-account?source=search&amp;auth_token=eyJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50X2lkIjoyMzEzMDkzLCJ1c2VyX2lkIjoxMjY1MDc3NDUyMjQ5LCJ0aWNrZXRfaWQiOjI1MDQ1MCwiY2hhbm5lbF9pZCI6NjMsInR5cGUiOiJTRUFSQ0giLCJleHAiOjE2Mjk4NTQ5MTZ9.7hhPCTN2kyHS6AIN597k46WiQ0yl7LBoI9Xc6WsRuUY</a></p><p>大意就是，官方解释道，目前的移动端暂时不支持恢复。</p><p>如果你通过助记词在手机上恢复钱包，发现丢失了账户，那么可以手动点击，Create New Account：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/85ca8b04ce89465bc82ad947a5c376b4dd4b6b9c4834eb7eca09ea24908a31f0.png" alt="创建新账户" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">创建新账户</figcaption></figure><p><strong>最终的账户生成的新账户地址，其实是和你网页端钱包地址是一样的。</strong></p><p>笔者猜测：</p><p>MetaMask这个账户地址，我估计是根据助记词生成的 而且是按顺序的，每个助记词，从 0 - 100 个账户，每个账户都有一套生成规则。</p><p>后来看了钱包的算法，大意是这样：</p><p>由助记词生成私钥，有一个根私钥，也就是我们新建账户后，metamask默认创建的Account1，它作为 Root 私钥，同时根据 Root 私钥生成公钥，当你新建账户时，根据该 Account1 账户，派生出第二个私钥，在根据私钥生成对应的第二个公钥，也就是 Account2 的钱包地址。</p><p>目前，通过助记词恢复账号的时候，metamask会默认只有一个根账户，其余钱包地址账户如果余额依然在链上，那么不会消失，只需要手动新创建一下账户即可，原来的老账户即可恢复。</p><p>所以，对于现在的移动端，暂时不支持恢复，然后手动点一下创建账户，相当于通过助记词用算法直接把账户地址按照顺序算出来了... 由于之前账户交易已经上链了，账户地址里的钱还会存在。</p><p>以上就是小狐狸钱包常用的功能了，后续交易的具体操作，会更新在其它系列文章里。</p><p>感谢观看，希望可以对你有所帮助。</p><p>💎 |币圈萌新|NFT学习中|成为科学家的路上|💎</p><p>我的Twitter：<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://twitter.com/dami16z">@dami</a></p>]]></content:encoded>
            <author>yidakoumi@newsletter.paragraph.com (dami.eth)</author>
        </item>
    </channel>
</rss>