<?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>0xMask</title>
        <link>https://paragraph.com/@codermy</link>
        <description>undefined</description>
        <lastBuildDate>Sun, 03 May 2026 19:02:34 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>0xMask</title>
            <url>https://storage.googleapis.com/papyrus_images/93204fadb25b70ead3ffa171bd1fe27998904d6ad9a3ccdd9d2c6e724a27b119.jpg</url>
            <link>https://paragraph.com/@codermy</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[ERC721R，RugPull的N种方式？]]></title>
            <link>https://paragraph.com/@codermy/erc721r-rugpull-n</link>
            <guid>xnZt5qlxqgLPmG1ecKho</guid>
            <pubDate>Tue, 12 Apr 2022 13:27:07 GMT</pubDate>
            <description><![CDATA[最近这几天ERC721R着实的刷了一波波屏。 不止一个群里友群沸腾起来了，以后可以顺利的冲土狗了，甚至想找第一个用721R合约的冲冲，其实事实证明的这样吗？ Web3的世界，代码就是法律，一切都得从代码出发。首先我们打开官网可以看到有这样的话。就是漏洞的方法伏笔，在代码中也可以找到这个的function refund(uint256[] calldata tokenIds) external { require(refundGuaranteeActive(), "Refund expired"); for (uint256 i = 0; i &#x3C; tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; require(msg.sender == ownerOf(tokenId), "Not token owner"); transferFrom(msg.sender, refundAddress, tokenId); } uint256 refundAmount = tokenIds.length * mintPric...]]></description>
            <content:encoded><![CDATA[<p>最近这几天<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://erc721r.org/">ERC721R</a>着实的刷了一波波屏。 不止一个群里友群沸腾起来了，以后可以顺利的冲土狗了，甚至想找第一个用721R合约的冲冲，其实事实证明的这样吗？</p><p>Web3的世界，代码就是法律，一切都得从代码出发。首先我们打开官网可以看到有这样的话。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f60fd7428d836516e8b5b18c5733e693ec5cb1665bba214fcf7cebe0ce17d004.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="function refund(uint256[] calldata tokenIds) external {
        require(refundGuaranteeActive(), &quot;Refund expired&quot;);

        for (uint256 i = 0; i &lt; tokenIds.length; i++) {
            uint256 tokenId = tokenIds[i];
            require(msg.sender == ownerOf(tokenId), &quot;Not token owner&quot;);
            transferFrom(msg.sender, refundAddress, tokenId);
        }

        uint256 refundAmount = tokenIds.length * mintPrice;
        Address.sendValue(payable(msg.sender), refundAmount);
    }
"><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">refund</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span>[] <span class="hljs-keyword">calldata</span> tokenIds</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> </span>{
        <span class="hljs-built_in">require</span>(refundGuaranteeActive(), <span class="hljs-string">"Refund expired"</span>);

        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">uint256</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i <span class="hljs-operator">&#x3C;</span> tokenIds.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
            <span class="hljs-keyword">uint256</span> tokenId <span class="hljs-operator">=</span> tokenIds[i];
            <span class="hljs-built_in">require</span>(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span> ownerOf(tokenId), <span class="hljs-string">"Not token owner"</span>);
            transferFrom(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>, refundAddress, tokenId);
        }

        <span class="hljs-keyword">uint256</span> refundAmount <span class="hljs-operator">=</span> tokenIds.<span class="hljs-built_in">length</span> <span class="hljs-operator">*</span> mintPrice;
        Address.sendValue(<span class="hljs-keyword">payable</span>(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>), refundAmount);
    }
</code></pre><p>我们可以看到退还的NFT是退往refundAddress地址的，而这是一个变量，合约持有人可以通过下面的方法来设置退还的地址。</p><pre data-type="codeBlock" text="function setRefundAddress(address _refundAddress) external onlyOwner {
        refundAddress = _refundAddress;
    }
"><code><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">setRefundAddress</span>(<span class="hljs-params"><span class="hljs-keyword">address</span> _refundAddress</span>) <span class="hljs-title"><span class="hljs-keyword">external</span></span> <span class="hljs-title">onlyOwner</span> </span>{
        refundAddress <span class="hljs-operator">=</span> _refundAddress;
    }
</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/11ddab54a580a4d0a77851fec3acb0f1028aa7640f6adbf608ef793a3bc786e7.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个NFT</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1156fb349171f2ef1fa06638be51120ebff3059811118802ace2e2b72c281afa.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的</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/760b7a7fe8f0de490830e988142d2ec1429bc5936593ce4723c62a8bdba9063d.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>我就是准备地毯拉的项目方交付，我准备把RefundAddress设置成自己的地址</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7535ae721bf7300e10dc1720d9d79e3450c46fb3b89204ae1ea9ec650c972066.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>然后有普通玩家，觉得现在不行了，或者破发了，想要一个，调用rufud</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0bb84c3d3f2b8ad7aa4e93838b7099f659c5c9ce0e8aa78b5b401e2077e2b22f.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/35400590828d5d89e8f1939e9d4973edd529c397a240aa2b037b421db87cd231.png" alt="退款后钱包余额，退款前忘记截图了，是1.26" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">退款后钱包余额，退款前忘记截图了，是1.26</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/9375b0d2702b98cbad9611ef52c315410aa688b46142bfbe3be516990a5e39db.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/aa79d57dd897c59be88f7ea1e2f22b8d9ce60a1416f1ff70f0a0c2ed158b92db.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><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/bbf66afdcaac725e5c9de6ae30203476dc2268a7dbae318ae5218b644b52383c.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><p>我们照着上面的再模特，并且薄荷三个。</p><p>（（（）（（（））看就无效了，退还的eth为0，nft还会被转移。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/fe58fb24ce0ea9916343e5604f189565d404172caa7b43d4e1065b672832c70a.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是有转移，但并没有退还</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/fb0fdf2004a570f1347181f32ccac3aadcd9695f292546190ae292a2531cb51d.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/1100cc881e3993e53865e8017a033efddfd6dbfa3142142ae4603c1ff5d8e263.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>故：不要轻易使用 721R 契约修改的土狗，要冲的话需要检查是否薄荷的价格，并且是否可以转移的 nft 需要是黑洞</strong></p>]]></content:encoded>
            <author>codermy@newsletter.paragraph.com (0xMask)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/467f137cd495a5601e56c8338a82ee78a41a73bf9601c59a441089d7b4d68556.jpg" length="0" type="image/jpg"/>
        </item>
        <item>
            <title><![CDATA[Solidity部署和开源解决方案-多文件]]></title>
            <link>https://paragraph.com/@codermy/solidity</link>
            <guid>j1G2PrA5YpDY1GOWjTUo</guid>
            <pubDate>Sun, 20 Mar 2022 05:35:59 GMT</pubDate>
            <description><![CDATA[部署的教程有很多，像remix、hardhat等等，这里就不多赘述了，但是如何对合约开源，没有找到特别详细的方案。一、HeadHat插件Hardhat 是一个用于编译、部署、测试和调试以太坊软件的开发环境，可以用来在本地调试Solidity语言 https://hardhat.org/plugins/nomiclabs-hardhat-etherscan.html官方解释很详细，就不过多赘述，下面是具体用法。 https://hardhat.org/plugins/nomiclabs-hardhat-etherscan.html二、Etherscan区块浏览器不同网络使用各自的区块浏览器就行，首先我们需要在remix中安装flattener插件 这个插件的作用就是将多个文件打包成一个 点击Verify and publish此时选择单文件就行使用上述插件后会生成一个带_flat的文件，打开它全部复制到 Enter the Solidity Contract Code below 中即可，不用管abi通过验证码后Verify and publish即可]]></description>
            <content:encoded><![CDATA[<p>部署的教程有很多，像remix、hardhat等等，这里就不多赘述了，但是如何对合约开源，没有找到特别详细的方案。</p><h2 id="h-headhat" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">一、HeadHat插件</h2><p>Hardhat 是一个用于编译、部署、测试和调试以太坊软件的开发环境，可以用来在本地调试Solidity语言</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://hardhat.org/plugins/nomiclabs-hardhat-etherscan.html">https://hardhat.org/plugins/nomiclabs-hardhat-etherscan.html</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0c41525faa2a140d666643d07e1ff946cc4928292b15acc2c2b6e9569ae83fb7.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://hardhat.org/plugins/nomiclabs-hardhat-etherscan.html">https://hardhat.org/plugins/nomiclabs-hardhat-etherscan.html</a></p><h2 id="h-etherscan" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">二、Etherscan区块浏览器</h2><p>不同网络使用各自的区块浏览器就行，首先我们需要在remix中安装flattener插件</p><p>这个插件的作用就是将多个文件打包成一个</p><p>点击Verify and publish</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3cca29693765aff35f680dbacebe25935e8e939c3d1106c886426f38a64788d7.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/4a26d21c583f418d39ec0fd2f0ae48192e608e45c20d16d6aa76265bec3dc160.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>使用上述插件后会生成一个带_flat的文件，打开它全部复制到 <strong>Enter the Solidity Contract Code below</strong> 中即可，不用管abi</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b7870cec8beca054a567cb8a223a85bacb9ac93c9ff593f1f819eceec644c748.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>通过验证码后Verify and publish即可</p>]]></content:encoded>
            <author>codermy@newsletter.paragraph.com (0xMask)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/467f137cd495a5601e56c8338a82ee78a41a73bf9601c59a441089d7b4d68556.jpg" length="0" type="image/jpg"/>
        </item>
    </channel>
</rss>