{"id":2780,"date":"2024-08-16T15:38:09","date_gmt":"2024-08-16T07:38:09","guid":{"rendered":"https:\/\/longhuayiyongyang.com\/?p=2780"},"modified":"2024-08-16T15:38:12","modified_gmt":"2024-08-16T07:38:12","slug":"%e6%95%b0%e5%ad%97%e8%b4%a7%e5%b8%81%e5%8c%ba%e5%9d%97%e9%93%be%e5%90%88%e7%ba%a6%e6%80%8e%e4%b9%88%e5%81%9a-%e6%95%b0%e5%ad%97%e8%b4%a7%e5%b8%81%e5%8c%ba%e5%9d%97%e9%93%be%e5%90%88%e7%ba%a6%e7%9a%84","status":"publish","type":"post","link":"https:\/\/www.longhuayiyongyang.com\/2780.html","title":{"rendered":"\u6570\u5b57\u8d27\u5e01\u533a\u5757\u94fe\u5408\u7ea6\u600e\u4e48\u505a \u6570\u5b57\u8d27\u5e01\u533a\u5757\u94fe\u5408\u7ea6\u7684\u5165\u95e8\u6559\u7a0b"},"content":{"rendered":"\n

\u6570\u5b57\u8d27\u5e01\u533a\u5757\u94fe\u5408\u7ea6\u7684\u5165\u95e8\u6559\u7a0b\u8981\u7406\u89e3\u57fa\u7840\u7684\u6982\u5ff5\u3001\u9009\u62e9\u5408\u9002\u7684\u533a\u5757\u94fe\u5e73\u53f0\u3001\u5b66\u4e60\u667a\u80fd\u5408\u7ea6\u7f16\u7a0b\u3001\u7f16\u5199\u7b80\u5355\u7684\u667a\u80fd\u5408\u7ea6\u3001\u4f7f\u7528\u667a\u80fd\u5408\u7ea6\u7b49\u3002<\/strong>
<\/strong>\u8981\u660e\u786e\u51e0\u4e2a\u6838\u5fc3\u6982\u5ff5\uff1a<\/strong><\/p>\n\n\n\n

\u533a\u5757\u94fe\uff1a\u4e00\u79cd\u5206\u5e03\u5f0f\u6570\u636e\u5e93\uff0c\u80fd\u591f\u5b89\u5168\u3001\u900f\u660e\u5730\u8bb0\u5f55\u4ea4\u6613\u6570\u636e\u3002<\/p>\n\n\n\n

\u667a\u80fd\u5408\u7ea6\uff1a\u4e00\u79cd\u81ea\u52a8\u6267\u884c\u5408\u540c\u6761\u6b3e\u7684\u4ee3\u7801\uff0c\u5f53\u6ee1\u8db3\u7279\u5b9a\u6761\u4ef6\u65f6\u4f1a\u81ea\u52a8\u89e6\u53d1\u76f8\u5e94\u64cd\u4f5c\u3002<\/p>\n\n\n\n

\u6570\u5b57\u8d27\u5e01\uff1a\u57fa\u4e8e\u533a\u5757\u94fe\u6280\u672f\u53d1\u884c\u7684\u7535\u5b50\u8d27\u5e01\uff0c\u53ef\u4ee5\u7528\u6765\u8d2d\u4e70\u5546\u54c1\u548c\u670d\u52a1\u3002<\/p>\n\n\n

\n
\"\"<\/figure><\/div>\n\n\n

<\/p>\n\n\n\n

\u6570\u5b57\u8d27\u5e01\u533a\u5757\u94fe\u5408\u7ea6\u7684\u5165\u95e8\u6559\u7a0b<\/strong><\/p>\n\n\n\n

\u4e00\u3001\u9009\u62e9\u5408\u9002\u7684\u533a\u5757\u94fe\u5e73\u53f0<\/strong>
\u9009\u62e9\u4e00\u4e2a\u9002\u5408\u5f00\u53d1\u667a\u80fd\u5408\u7ea6\u7684\u533a\u5757\u94fe\u5e73\u53f0\u81f3\u5173\u91cd\u8981\uff0c\u76ee\u524d\u4e3b\u6d41\u7684\u5e73\u53f0\u5305\u62ec\u4ee5\u592a\u574a\uff08Ethereum\uff09\u3001\u6ce2\u573a\uff08TRON\uff09\u7b49\u3002\u4ee5\u592a\u574a\u662f\u6700\u6210\u719f\u4e14\u5e7f\u6cdb\u4f7f\u7528\u7684\u5e73\u53f0\u4e4b\u4e00\uff0c\u5b83\u652f\u6301Solidity\u8bed\u8a00\u7f16\u5199\u667a\u80fd\u5408\u7ea6\u3002<\/p>\n\n\n\n

\u4e8c\u3001\u5b66\u4e60\u667a\u80fd\u5408\u7ea6\u7f16\u7a0b<\/strong><\/p>\n\n\n\n

1. \u5b66\u4e60\u7f16\u7a0b\u8bed\u8a00<\/strong>
\u5bf9\u4e8e\u521d\u5b66\u8005\u800c\u8a00\uff0c\u5b66\u4e60Solidity\u8bed\u8a00\u662f\u4e00\u4e2a\u597d\u7684\u8d77\u70b9\u3002Solidity\u662f\u4e00\u79cd\u4e13\u95e8\u4e3a\u4ee5\u592a\u574a\u667a\u80fd\u5408\u7ea6\u8bbe\u8ba1\u7684\u9ad8\u7ea7\u7f16\u7a0b\u8bed\u8a00\u3002<\/p>\n\n\n\n

2. \u719f\u6089\u5f00\u53d1\u73af\u5883<\/strong>
\u5b89\u88c5\u5e76\u914d\u7f6e\u597d\u5f00\u53d1\u73af\u5883\uff0c\u4f8b\u5982\u4f7f\u7528Remix IDE\u6216Truffle Suite\u8fd9\u6837\u7684\u5de5\u5177\u6765\u7f16\u5199\u3001\u6d4b\u8bd5\u548c\u90e8\u7f72\u667a\u80fd\u5408\u7ea6\u3002<\/p>\n\n\n\n

\u4e09\u3001\u7f16\u5199\u7b80\u5355\u7684\u667a\u80fd\u5408\u7ea6<\/strong><\/p>\n\n\n\n

1.\u521b\u5efa\u8d26\u6237<\/strong>
\u4ee5\u592a\u574a\u4e0a\u521b\u5efa\u4e00\u4e2a\u8d26\u6237\u7528\u4e8e\u53d1\u9001\u548c\u63a5\u6536\u4ea4\u6613\uff0c\u53ef\u4ee5\u4f7f\u7528Mist\u94b1\u5305\u6216MetaMask\u63d2\u4ef6\uff08\u8bf7\u6ce8\u610f\uff0c\u6839\u636e\u8981\u6c42\uff0c\u8fd9\u91cc\u4e0d\u8be6\u7ec6\u4ecb\u7ecd\u5177\u4f53\u7684\u94b1\u5305\u5de5\u5177\uff09\u3002<\/p>\n\n\n\n

2. \u7f16\u5199\u4ee3\u7801<\/strong>
\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u667a\u80fd\u5408\u7ea6\u793a\u4f8b\uff0c\u7528\u4e8e\u6f14\u793a\u5982\u4f55\u521b\u5efa\u4e00\u4e2a\u53ef\u4ee5\u5b58\u50a8\u548c\u8f6c\u79fb\u6570\u5b57\u8d27\u5e01\u7684\u5408\u7ea6\uff1a
\/\/ SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract SimpleToken { mapping(address => uint256) public balances; function deposit() public payable { balances[msg.sender] += msg.value; } function withdraw(uint256 _value) public { require(balances[msg.sender] >= _value, “Insufficient balance.”); (bool success, ) = msg.sender.call{value: _value}(“”); require(success, “Transfer failed.”); balances[msg.sender] -= _value; } }<\/p>\n\n\n\n

3. \u6d4b\u8bd5\u5408\u7ea6<\/strong>
\u672c\u5730\u73af\u5883\u4e2d\u90e8\u7f72\u5e76\u6d4b\u8bd5\u5408\u7ea6\u7684\u529f\u80fd\uff0c\u786e\u4fdd\u6240\u6709\u903b\u8f91\u6b63\u786e\u65e0\u8bef\u3002<\/p>\n\n\n\n

4. \u90e8\u7f72\u5408\u7ea6<\/strong>
\u5c06\u5408\u7ea6\u90e8\u7f72\u5230\u4ee5\u592a\u574a\u6d4b\u8bd5\u7f51\u6216\u4e3b\u7f51\u4e0a\uff0c\u5e76\u786e\u4fdd\u6709\u8db3\u591f\u7684\u4ee5\u592a\u5e01\uff08ETH\uff09\u652f\u4ed8gas\u8d39\u7528\u3002<\/p>\n\n\n\n

\u56db\u3001\u4f7f\u7528\u667a\u80fd\u5408\u7ea6<\/strong><\/p>\n\n\n\n

1. \u4ea4\u4e92\u63a5\u53e3<\/strong>
\u521b\u5efa\u4e00\u4e2a\u524d\u7aef\u754c\u9762\u6216\u4f7f\u7528\u547d\u4ee4\u884c\u5de5\u5177\u6765\u4e0e\u667a\u80fd\u5408\u7ea6\u4ea4\u4e92\u3002<\/p>\n\n\n\n

2. \u8c03\u7528\u51fd\u6570<\/strong>
\u901a\u8fc7\u8c03\u7528\u5408\u7ea6\u4e2d\u7684\u51fd\u6570\u6765\u6267\u884c\u5b58\u6b3e\u3001\u63d0\u6b3e\u7b49\u64cd\u4f5c\u3002<\/p>\n\n\n\n

\u4e94\u3001\u6269\u5c55\u529f\u80fd<\/strong>
\u968f\u7740\u5bf9\u667a\u80fd\u5408\u7ea6\u7684\u7406\u89e3\u52a0\u6df1\uff0c\u53ef\u4ee5\u8fdb\u4e00\u6b65\u63a2\u7d22\u66f4\u590d\u6742\u7684\u5408\u7ea6\u529f\u80fd\uff0c\u6bd4\u5982\u521b\u5efa\u53bb\u4e2d\u5fc3\u5316\u5e94\u7528\uff08DApps\uff09\u6216\u5b9e\u73b0\u66f4\u590d\u6742\u7684\u8eab\u4efd\u9a8c\u8bc1\u7cfb\u7edf\u3002<\/p>\n\n\n

\n
\"\"<\/figure><\/div>\n\n\n

<\/p>\n\n\n\n

\u901a\u8fc7\u638c\u63e1\u667a\u80fd\u5408\u7ea6\u7684\u57fa\u7840\u77e5\u8bc6\u3001\u9009\u62e9\u5408\u9002\u7684\u533a\u5757\u94fe\u5e73\u53f0\u3001\u5b66\u4e60\u7f16\u7a0b\u8bed\u8a00\u3001\u7f16\u5199\u548c\u90e8\u7f72\u667a\u80fd\u5408\u7ea6\uff0c\u5c31\u80fd\u5f00\u59cb\u6784\u5efa\u81ea\u5df1\u7684\u6570\u5b57\u8d27\u5e01\u533a\u5757\u94fe\u5408\u7ea6\u4e86\u3002\u968f\u7740\u6280\u672f\u7684\u4e0d\u65ad\u53d1\u5c55\uff0c\u672a\u6765\u8fd8\u6709\u66f4\u591a\u7684\u53ef\u80fd\u6027\u7b49\u5f85\u7740\u6211\u4eec\u53bb\u63a2\u7d22\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u6570\u5b57\u8d27\u5e01\u533a\u5757\u94fe\u5408\u7ea6\u7684\u5165\u95e8\u6559\u7a0b\u8981\u7406\u89e3\u57fa\u7840\u7684\u6982\u5ff5\u3001\u9009\u62e9\u5408\u9002\u7684\u533a\u5757\u94fe\u5e73\u53f0\u3001\u5b66\u4e60\u667a\u80fd\u5408\u7ea6\u7f16\u7a0b\u3001\u7f16\u5199\u7b80\u5355\u7684\u667a\u80fd\u5408\u7ea6\u3001\u4f7f\u7528 […]<\/p>\n","protected":false},"author":8,"featured_media":2783,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[26,7],"class_list":["post-2780","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-digital_encyclopedia","tag-26","tag-7"],"_links":{"self":[{"href":"https:\/\/www.longhuayiyongyang.com\/wp-json\/wp\/v2\/posts\/2780","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.longhuayiyongyang.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.longhuayiyongyang.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.longhuayiyongyang.com\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.longhuayiyongyang.com\/wp-json\/wp\/v2\/comments?post=2780"}],"version-history":[{"count":1,"href":"https:\/\/www.longhuayiyongyang.com\/wp-json\/wp\/v2\/posts\/2780\/revisions"}],"predecessor-version":[{"id":2784,"href":"https:\/\/www.longhuayiyongyang.com\/wp-json\/wp\/v2\/posts\/2780\/revisions\/2784"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.longhuayiyongyang.com\/wp-json\/wp\/v2\/media\/2783"}],"wp:attachment":[{"href":"https:\/\/www.longhuayiyongyang.com\/wp-json\/wp\/v2\/media?parent=2780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.longhuayiyongyang.com\/wp-json\/wp\/v2\/categories?post=2780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.longhuayiyongyang.com\/wp-json\/wp\/v2\/tags?post=2780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}