{"id":95034,"date":"2026-08-16T01:57:06","date_gmt":"2026-08-15T17:57:06","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/95034.html"},"modified":"2026-08-16T01:57:06","modified_gmt":"2026-08-15T17:57:06","slug":"ai-web3-%e5%ba%94%e7%94%a8%e8%ae%be%e8%ae%a1%e4%b8%8e%e6%99%ba%e8%83%bd%e5%90%88%e7%ba%a6%e8%be%85%e5%8a%a9%e5%bc%80%e5%8f%91%ef%bc%9a%e5%88%ab%e8%ae%a9%e6%bc%94%e7%a4%ba%e6%95%88%e6%9e%9c%e9%aa%97","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/95034.html","title":{"rendered":"AI + Web3 \u5e94\u7528\u8bbe\u8ba1\u4e0e\u667a\u80fd\u5408\u7ea6\u8f85\u52a9\u5f00\u53d1\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60"},"content":{"rendered":"<h2>AI &#043; Web3 \u5e94\u7528\u8bbe\u8ba1\u4e0e\u667a\u80fd\u5408\u7ea6\u8f85\u52a9\u5f00\u53d1&#xff1a;\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60<\/h2>\n<p>\u6f14\u793a Demo \u91cc\u7528 Prompt \u751f\u6210 Solidity \u5408\u7ea6&#xff0c;\u79d2\u53d1 ERC-20 \u751a\u81f3\u79d2\u51fa\u95ea\u7535\u8d37\u903b\u8f91&#xff0c;\u770b\u8d77\u6765\u5f88\u4e1d\u6ed1\u3002\u771f\u62ff\u5230\u672c\u5730\u94fe\u6216\u8005\u6d4b\u8bd5\u7f51\u8dd1\u4e00\u8f6e&#xff0c;\u5927\u591a\u76f4\u63a5\u62a5\u9519&#xff0c;\u751a\u81f3\u4f34\u968f\u4e25\u91cd\u7684\u5b89\u5168\u91cd\u5165\u6f0f\u6d1e\u3002<\/p>\n<p>LLM \u5728\u4ee3\u7801\u751f\u6210\u9886\u57df\u867d\u7136\u8868\u73b0\u4f18\u5f02&#xff0c;\u4f46 smart contract \u8fd9\u79cd\u4e00\u7ecf\u90e8\u7f72\u4e0d\u53ef\u7be1\u6539\u3001\u5bf9\u8fb9\u754c\u72b6\u6001\u6781\u5ea6\u654f\u611f\u7684\u573a\u666f&#xff0c;\u5355\u9760 LLM \u7684\u201c\u5e7b\u89c9\u8f93\u51fa\u201d\u5b8c\u5168\u662f\u707e\u96be\u3002<\/p>\n<p>\u642d\u5efa\u4e00\u4e2a\u53ef\u590d\u73b0\u3001\u53ef\u81ea\u52a8\u9a8c\u8bc1\u7684\u672c\u5730\u667a\u80fd\u5408\u7ea6\u8f85\u52a9\u5f00\u53d1\u811a\u624b\u67b6&#xff0c;\u662f\u5728 AI&#043;Web3 \u4ea4\u53c9\u9886\u57df\u5e72\u6d3b\u7684\u57fa\u672c\u524d\u63d0\u3002<\/p>\n<hr \/>\n<h3>\u672c\u5730\u5f00\u53d1\u811a\u624b\u67b6\u67b6\u6784<\/h3>\n<p>\u4e3a\u4e86\u907f\u514d AI \u968f\u673a\u751f\u6210\u7684\u5408\u7ea6\u4ee3\u7801\u76f4\u63a5\u6c61\u67d3\u751f\u4ea7\u73af\u5883&#xff0c;\u5fc5\u987b\u5728 AI \u903b\u8f91\u5c42\u4e0e\u533a\u5757\u94fe\u8282\u70b9\u4e4b\u95f4\u5f3a\u884c\u63d2\u5165\u4e00\u4e2a\u201c\u4ee3\u7801\u9759\u6001\u68c0\u67e5 &#043; \u5355\u5143\u6d4b\u8bd5\u6c99\u76d2\u201d\u5c42\u3002<\/p>\n<p>\u6574\u4e2a\u811a\u624b\u67b6\u6838\u5fc3\u7531\u4e09\u4e2a\u90e8\u5206\u7ec4\u6210&#xff1a;<\/p>\n<li>\u672c\u5730\u79c1\u94fe\u8282\u70b9&#xff1a;\u57fa\u4e8e Anvil (Foundry) \u6216 Hardhat Network \u8fd0\u884c&#xff0c;\u542f\u52a8\u901f\u5ea6\u6beb\u79d2\u7ea7&#xff0c;\u4e14\u652f\u6301\u4efb\u610f\u533a\u5757\u72b6\u6001\u91cd\u653e\u3002<\/li>\n<li>LLM \u7f16\u6392\u5f15\u64ce&#xff1a;\u7ed3\u5408 Prompt \u6a21\u677f\u4e0e AST \u8bed\u6cd5\u6811\u89e3\u6790&#xff0c;\u5c06\u81ea\u7136\u8bed\u8a00\u9700\u6c42\u8f6c\u5316\u4e3a\u6807\u51c6 Solidity \u6e90\u7801\u3002<\/li>\n<li>\u9a8c\u8bc1\u6b7b\u5faa\u73af\u53cd\u9988\u5668&#xff08;Feedback Loop&#xff09;&#xff1a;\u628a\u7f16\u8bd1\u9519\u8bef&#xff08;solc output&#xff09;\u3001\u9759\u6001\u5206\u6790\u62a5\u544a&#xff08;Slither\/Aderyn&#xff09;\u4ee5\u53ca Forge\/Hardhat \u6d4b\u8bd5\u7528\u4f8b\u6267\u884c\u7ed3\u679c\u6253\u5305\u56de\u4f20\u7ed9 LLM \u8fdb\u884c\u81ea\u6108\u4fee\u8865\u3002<\/li>\n<p>flowchart TD<br \/>\n    A[\u81ea\u7136\u8bed\u8a00\u9700\u6c42 Prompt] &#8211;&gt; B[LLM \u667a\u80fd\u5408\u7ea6\u751f\u6210\u6a21\u5757]<br \/>\n    B &#8211;&gt; C[Solidity AST \u6821\u9a8c\u4e0e\u683c\u5f0f\u5316]<br \/>\n    C &#8211;&gt; D{Slither \u9759\u6001\u5b89\u5168\u626b\u63cf}<br \/>\n    D &#8212; \u5b58\u5728\u4e25\u91cd\u6f0f\u6d1e\/\u8bed\u6cd5\u9519\u8bef &#8211;&gt; E[\u6784\u5efa Error Stack &amp; Slither \u62a5\u544a]<br \/>\n    E &#8211;&gt; B<br \/>\n    D &#8212; \u626b\u63cf\u901a\u8fc7 &#8211;&gt; F[Anvil \u672c\u5730\u6c99\u76d2\u6d4b\u8bd5\u8dd1\u7528\u4f8b]<br \/>\n    F &#8212; Test Fail &#8211;&gt; E<br \/>\n    F &#8212; Test Pass &#8211;&gt; G[\u8f93\u51fa\u751f\u4ea7\u53ef\u590d\u73b0\u811a\u624b\u67b6\u4e0e\u5408\u7ea6]<\/p>\n<hr \/>\n<h3>\u9762\u5411\u751f\u4ea7\u73af\u5883\u7684\u81ea\u52a8\u5316\u81ea\u6108\u5f00\u53d1\u811a\u672c<\/h3>\n<p>\u4e0b\u9762\u7684 TypeScript \u811a\u672c\u5b9e\u73b0\u4e86\u4e00\u4e2a\u5b8c\u6574\u7684\u8f85\u52a9\u5f00\u53d1\u5de5\u4f5c\u6d41\u3002\u5b83\u4f7f\u7528 Node.js \u8c03\u5ea6 solc \u7f16\u8bd1\u5668\u4e0e forge test&#xff0c;\u8ba9\u5927\u6a21\u578b\u5728\u672c\u5730\u79bb\u7ebf\u6c99\u76d2\u91cc\u5b8c\u6210\u201c\u4ee3\u7801\u751f\u6210-\u672c\u5730\u7f16\u8bd1-\u6d4b\u8bd5\u9a8c\u8bc1-\u81ea\u52a8\u4fee\u590d\u201d\u95ed\u73af\u3002<\/p>\n<p>import { exec } from &#039;child_process&#039;;<br \/>\nimport * as fs from &#039;fs&#039;;<br \/>\nimport * as path from &#039;path&#039;;<br \/>\nimport promisify from &#039;util&#039;;<\/p>\n<p>const execAsync &#061; promisify(exec);<\/p>\n<p>interface AgentResponse {<br \/>\n  code: string;<br \/>\n  explanation: string;<br \/>\n}<\/p>\n<p>export class SmartContractAICreator {<br \/>\n  private projectRoot: string;<br \/>\n  private maxRetries: number;<\/p>\n<p>  constructor(projectRoot: string, maxRetries &#061; 3) {<br \/>\n    this.projectRoot &#061; projectRoot;<br \/>\n    this.maxRetries &#061; maxRetries;<br \/>\n  }<\/p>\n<p>  \/**<br \/>\n   * \u6a21\u62df\u8c03\u7528 LLM API \u751f\u6210\u4ee3\u7801<br \/>\n   *\/<br \/>\n  private async mockLLMGenerate(prompt: string, errorContext?: string): Promise&lt;AgentResponse&gt; {<br \/>\n    \/\/ \u5b9e\u9645\u751f\u4ea7\u4e2d\u66ff\u6362\u4e3a OpenAI \/ Anthropic API \u8c03\u7528<br \/>\n    \/\/ \u63d0\u793a\u8bcd\u5fc5\u987b\u5f3a\u5236\u9650\u5236\u8f93\u51fa\u683c\u5f0f\u4e0e\u5b89\u5168\u7684 ERC \u89c4\u8303<br \/>\n    if (!errorContext) {<br \/>\n      return {<br \/>\n        code: &#096;\/\/ SPDX-License-Identifier: MIT<br \/>\npragma solidity ^0.8.20;<\/p>\n<p>import &#034;&#064;openzeppelin\/contracts\/token\/ERC20\/ERC20.sol&#034;;<br \/>\nimport &#034;&#064;openzeppelin\/contracts\/access\/Ownable.sol&#034;;<\/p>\n<p>contract VaultToken is ERC20, Ownable {<br \/>\n    mapping(address &#061;&gt; uint256) public userBalances;<\/p>\n<p>    constructor() ERC20(&#034;VaultToken&#034;, &#034;VTK&#034;) Ownable(msg.sender) {}<\/p>\n<p>    function mint(address to, uint256 amount) external onlyOwner {<br \/>\n        _mint(to, amount);<br \/>\n    }<\/p>\n<p>    function deposit() external payable {<br \/>\n        require(msg.value &gt; 0, &#034;Zero deposit&#034;);<br \/>\n        userBalances[msg.sender] &#043;&#061; msg.value;<br \/>\n    }<\/p>\n<p>    function withdraw(uint256 amount) external {<br \/>\n        require(userBalances[msg.sender] &gt;&#061; amount, &#034;Insufficient balance&#034;);<br \/>\n        userBalances[msg.sender] -&#061; amount;<br \/>\n        (bool success, ) &#061; payable(msg.sender).call{value: amount}(&#034;&#034;);<br \/>\n        require(success, &#034;Transfer failed&#034;);<br \/>\n    }<br \/>\n}&#096;,<br \/>\n        explanation: &#034;\u521d\u6b21\u751f\u6210\u7684\u5177\u5907\u57fa\u7840\u5b58\u6b3e\u4e0e\u53d6\u6b3e\u529f\u80fd\u7684 Vault \u5408\u7ea6&#034;<br \/>\n      };<br \/>\n    } else {<br \/>\n      \/\/ \u643a\u5e26 Error \u4e0a\u4e0b\u6587\u65f6\u7684\u4fee\u590d Prompt \u751f\u6210<br \/>\n      return {<br \/>\n        code: &#096;\/\/ SPDX-License-Identifier: MIT<br \/>\npragma solidity ^0.8.20;<\/p>\n<p>import &#034;&#064;openzeppelin\/contracts\/token\/ERC20\/ERC20.sol&#034;;<br \/>\nimport &#034;&#064;openzeppelin\/contracts\/access\/Ownable.sol&#034;;<br \/>\nimport &#034;&#064;openzeppelin\/contracts\/utils\/ReentrancyGuard.sol&#034;;<\/p>\n<p>contract VaultToken is ERC20, Ownable, ReentrancyGuard {<br \/>\n    mapping(address &#061;&gt; uint256) public userBalances;<\/p>\n<p>    constructor() ERC20(&#034;VaultToken&#034;, &#034;VTK&#034;) Ownable(msg.sender) {}<\/p>\n<p>    function mint(address to, uint256 amount) external onlyOwner {<br \/>\n        _mint(to, amount);<br \/>\n    }<\/p>\n<p>    function deposit() external payable {<br \/>\n        require(msg.value &gt; 0, &#034;Zero deposit&#034;);<br \/>\n        userBalances[msg.sender] &#043;&#061; msg.value;<br \/>\n    }<\/p>\n<p>    function withdraw(uint256 amount) external nonReentrant {<br \/>\n        require(userBalances[msg.sender] &gt;&#061; amount, &#034;Insufficient balance&#034;);<br \/>\n        userBalances[msg.sender] -&#061; amount;<br \/>\n        (bool success, ) &#061; payable(msg.sender).call{value: amount}(&#034;&#034;);<br \/>\n        require(success, &#034;Transfer failed&#034;);<br \/>\n    }<br \/>\n}&#096;,<br \/>\n        explanation: &#034;\u6dfb\u52a0\u4e86 ReentrancyGuard \u9632\u8303\u9632\u91cd\u5165\u653b\u51fb&#034;<br \/>\n      };<br \/>\n    }<br \/>\n  }<\/p>\n<p>  \/**<br \/>\n   * \u5199\u5165\u672c\u5730 Forge \u5de5\u7a0b<br \/>\n   *\/<br \/>\n  private async writeContractFile(filename: string, content: string): Promise&lt;string&gt; {<br \/>\n    const targetPath &#061; path.join(this.projectRoot, &#039;src&#039;, filename);<br \/>\n    await fs.promises.mkdir(path.dirname(targetPath), { recursive: true });<br \/>\n    await fs.promises.writeFile(targetPath, content, &#039;utf-8&#039;);<br \/>\n    return targetPath;<br \/>\n  }<\/p>\n<p>  \/**<br \/>\n   * \u6267\u884c\u672c\u5730 Forge \u7f16\u8bd1\u4e0e\u6d4b\u8bd5<br \/>\n   *\/<br \/>\n  private async runLocalVerification(): Promise&lt;{ success: boolean; logs: string }&gt; {<br \/>\n    try {<br \/>\n      \/\/ \u4f7f\u7528 forge test \u547d\u4ee4\u5728\u672c\u5730 Anvil \u6c99\u76d2\u73af\u5883\u4e2d\u8fd0\u884c\u5408\u7ea6\u9a8c\u8bc1<br \/>\n      const { stdout, stderr } &#061; await execAsync(&#039;forge test &#8211;match-path test\/VaultToken.t.sol&#039;, {<br \/>\n        cwd: this.projectRoot<br \/>\n      });<br \/>\n      return { success: true, logs: stdout };<br \/>\n    } catch (err: any) {<br \/>\n      return {<br \/>\n        success: false,<br \/>\n        logs: &#096;Stdout: ${err.stdout || &#039;&#039;}\\\\nStderr: ${err.stderr || &#039;&#039;}\\\\nMessage: ${err.message}&#096;<br \/>\n      };<br \/>\n    }<br \/>\n  }<\/p>\n<p>  \/**<br \/>\n   * \u6838\u5fc3\u6d41\u63a7\u95ed\u73af<br \/>\n   *\/<br \/>\n  public async buildContractWithAI(userRequirement: string): Promise&lt;string&gt; {<br \/>\n    let currentAttempt &#061; 0;<br \/>\n    let lastError &#061; &#039;&#039;;<\/p>\n<p>    while (currentAttempt &lt; this.maxRetries) {<br \/>\n      console.log(&#096;[AI-Web3 Scaffold] \u5c1d\u8bd5\u6784\u5efa\u5408\u7ea6 (\u7b2c ${currentAttempt &#043; 1} \u6b21)&#8230;&#096;);<br \/>\n      const llmResult &#061; await this.mockLLMGenerate(userRequirement, lastError);<\/p>\n<p>      const contractPath &#061; await this.writeContractFile(&#039;VaultToken.sol&#039;, llmResult.code);<br \/>\n      console.log(&#096;[AI-Web3 Scaffold] \u5df2\u5199\u51fa\u4ee3\u7801\u81f3 ${contractPath}&#096;);<\/p>\n<p>      console.log(&#096;[AI-Web3 Scaffold] \u6b63\u5728\u8fd0\u884c\u672c\u5730 Forge \u6c99\u76d2\u9a8c\u8bc1&#8230;&#096;);<br \/>\n      const verificationResult &#061; await this.runLocalVerification();<\/p>\n<p>      if (verificationResult.success) {<br \/>\n        console.log(&#096;[AI-Web3 Scaffold] \u9a8c\u8bc1\u6210\u529f&#xff01;\u5408\u7ea6\u51c6\u5907\u5b8c\u6bd5\u3002&#096;);<br \/>\n        return llmResult.code;<br \/>\n      }<\/p>\n<p>      console.warn(&#096;[AI-Web3 Scaffold] \u6c99\u76d2\u9a8c\u8bc1\u5931\u8d25&#xff0c;\u6355\u83b7\u9519\u8bef\u4fe1\u606f\u3002&#096;);<br \/>\n      lastError &#061; verificationResult.logs;<br \/>\n      currentAttempt&#043;&#043;;<br \/>\n    }<\/p>\n<p>    throw new Error(&#096;[AI-Web3 Scaffold] \u8fbe\u5230\u6700\u5927\u91cd\u8bd5\u6b21\u6570 ${this.maxRetries}&#xff0c;\u5408\u7ea6\u751f\u6210\u5931\u8d25\u3002\u6700\u540e\u9519\u8bef:\\\\n${lastError}&#096;);<br \/>\n  }<br \/>\n}<\/p>\n<hr \/>\n<h3>\u672c\u5730\u65ad\u8a00\u6d4b\u8bd5\u811a\u672c<\/h3>\n<p>\u4e0a\u9762\u6d41\u6c34\u7ebf\u5f15\u7528\u7684 Forge \u667a\u80fd\u5408\u7ea6\u6d4b\u8bd5\u6587\u4ef6 test\/VaultToken.t.sol \u5fc5\u987b\u7cbe\u786e\u6355\u6349\u91cd\u5165\u653b\u51fb\u4e0e\u8d44\u91d1\u8ba1\u7b97\u5f02\u5e38\u3002\u76f4\u63a5\u7528 Solidity \u7f16\u5199\u672c\u5730\u6d4b\u8bd5&#xff0c;\u80fd\u591f\u5b8c\u5168\u8131\u79bb\u5916\u90e8\u7f51\u7edc\u73af\u5883\u3002<\/p>\n<p>\/\/ SPDX-License-Identifier: MIT<br \/>\npragma solidity ^0.8.20;<\/p>\n<p>import &#034;forge-std\/Test.sol&#034;;<br \/>\nimport &#034;..\/src\/VaultToken.sol&#034;;<\/p>\n<p>contract Attacker {<br \/>\n    VaultToken public target;<\/p>\n<p>    constructor(address payable _target) {<br \/>\n        target &#061; VaultToken(_target);<br \/>\n    }<\/p>\n<p>    receive() external payable {<br \/>\n        if (address(target).balance &gt;&#061; 1 ether) {<br \/>\n            target.withdraw(1 ether);<br \/>\n        }<br \/>\n    }<\/p>\n<p>    function attack() external payable {<br \/>\n        target.deposit{value: 1 ether}();<br \/>\n        target.withdraw(1 ether);<br \/>\n    }<br \/>\n}<\/p>\n<p>contract VaultTokenTest is Test {<br \/>\n    VaultToken public vault;<br \/>\n    Attacker public attacker;<\/p>\n<p>    function setUp() public {<br \/>\n        vault &#061; new VaultToken();<br \/>\n        attacker &#061; new Attacker(payable(address(vault)));<br \/>\n        vm.deal(address(attacker), 2 ether);<br \/>\n        vm.deal(address(this), 10 ether);<br \/>\n    }<\/p>\n<p>    function test_DepositAndWithdraw() public {<br \/>\n        vault.deposit{value: 5 ether}();<br \/>\n        assertEq(vault.userBalances(address(this)), 5 ether);<\/p>\n<p>        vault.withdraw(2 ether);<br \/>\n        assertEq(vault.userBalances(address(this)), 3 ether);<br \/>\n    }<\/p>\n<p>    function test_ReentrancyAttackProtection() public {<br \/>\n        \/\/ \u5145\u503c\u521d\u59cb\u6c89\u6dc0\u8d44\u91d1<br \/>\n        vault.deposit{value: 5 ether}();<\/p>\n<p>        \/\/ \u671f\u5f85\u653b\u51fb\u8005\u7684\u63d0\u73b0\u56e0\u4e3a\u91cd\u5165\u9501\u9501\u6b7b\u6216\u72b6\u6001\u66f4\u65b0\u800c\u62a5\u9519<br \/>\n        vm.expectRevert();<br \/>\n        attacker.attack();<br \/>\n    }<br \/>\n}<\/p>\n<hr \/>\n<h3>\u907f\u5751\u4e0e\u73af\u5883\u6cbb\u7406\u7b56\u7565<\/h3>\n<li>\n<p>\u786e\u5b9a\u6027 RPC \u72b6\u6001\u8282\u70b9\u6d4b\u8bd5\u7f51&#xff08;\u5982 Sepolia\u3001Amoy&#xff09;\u5076\u5c14\u4f1a\u51fa\u73b0 RPC \u54cd\u5e94\u8d85\u65f6\u6216 Gas \u4f30\u7b97\u6ce2\u52a8\u3002\u751f\u4ea7\u53ef\u590d\u73b0\u7684\u73af\u5883\u5fc5\u987b\u7ed1\u5b9a anvil &#8211;fork-block-number\u3002\u56fa\u5b9a\u4f4f\u533a\u5757\u9ad8\u5ea6&#xff0c;AI \u63d0\u53d6\u5230\u7684\u94fe\u4e0a ABI \u4e0e Token \u4f59\u989d\u72b6\u6001\u624d\u5177\u5907\u552f\u4e00\u786e\u5b9a\u6027\u3002<\/p>\n<\/li>\n<li>\n<p>OpenZeppelin \u7248\u672c\u9501\u6b7bLLM \u5728\u751f\u6210\u5408\u7ea6\u4ee3\u7801\u65f6\u7ecf\u5e38\u6df7\u6dc6 OpenZeppelin v4 \u4e0e v5 \u7684\u8bed\u6cd5\u7ec6\u8282\u3002\u6bd4\u5982 v5 \u4e2d Ownable \u7684\u6784\u9020\u51fd\u6570\u5fc5\u987b\u663e\u5f0f\u4f20\u5165 initialOwner&#xff08;\u5982 Ownable(msg.sender)&#xff09;&#xff0c;\u800c v4 \u5219\u4e0d\u9700\u8981\u3002\u5982\u679c\u73af\u5883\u91cc\u7684 package.json \u6216 foundry.toml \u6ca1\u9501\u5b9a\u5927\u7248\u672c&#xff0c;\u672c\u5730\u7f16\u8bd1\u4f1a\u9891\u7e41\u62a5\u8bed\u6cd5\u9519\u8bef\u3002<\/p>\n<\/li>\n<li>\n<p>Prompt \u4e2d\u7684 AST \u7ea6\u675f\u6ce8\u5165\u4e0e\u5176\u7528\u81ea\u7136\u8bed\u8a00\u53cd\u590d\u53ee\u5631 LLM\u201c\u4e0d\u8981\u5fd8\u8bb0\u9632\u91cd\u5165\u9501\u201d&#xff0c;\u4e0d\u5982\u5728 Prompt \u4e2d\u5f3a\u5236\u8981\u6c42\u5b9a\u4e49\u81ea\u5b9a\u4e49 Modifier \u6216\u8005\u6307\u5b9a\u5fc5\u987b\u7ee7\u627f ReentrancyGuard\u3002\u540c\u65f6\u8ba9\u811a\u624b\u67b6\u5728\u7f16\u8bd1\u524d\u5148\u901a\u8fc7\u6b63\u5219\u6216\u8005 AST \u89e3\u6790\u5668\u5224\u65ad\u5408\u7ea6\u7ee7\u627f\u5217\u8868\u4e2d\u662f\u5426\u5305\u542b ReentrancyGuard\u3002\u7f3a\u5c11\u5173\u952e\u5b57\u76f4\u63a5\u62e6\u622a&#xff0c;\u7701\u53bb\u4e00\u6b21 LLM \u8c03\u7528\u3002<\/p>\n<\/li>\n<li>\n<p>\u81ea\u52a8\u5316\u6e05\u9664\u786c\u7f16\u7801\u72b6\u6001AI \u751f\u6210\u7684\u5408\u7ea6\u4ee3\u7801\u91cc\u6781\u5176\u559c\u6b22\u786c\u7f16\u7801\u6d4b\u8bd5\u79c1\u94a5\u6216\u56fa\u5b9a\u5730\u5740\u3002\u5fc5\u987b\u5728\u811a\u624b\u67b6\u6253\u5305\u6b65\u9aa4\u52a0\u4e00\u9053\u6b63\u5219\u8fc7\u6ee4&#xff1a;\u5339\u914d 0x[a-fA-F0-9]{40} \u548c 0x[a-fA-F0-9]{64}\u3002\u4e00\u65e6\u5339\u914d\u6210\u529f\u76f4\u63a5\u62a5\u8b66\u544a&#xff0c;\u9632\u6b62\u5371\u9669\u79c1\u94a5\u6cc4\u6f0f\u5230\u7248\u672c\u7ba1\u7406\u7cfb\u7edf\u4e2d\u3002<\/p>\n<\/li>\n<p>\u901a\u8fc7\u628a\u8fd9\u5957\u903b\u8f91\u843d\u5230\u672c\u5730\u5de5\u7a0b\u91cc&#xff0c;\u5c31\u80fd\u628a AI \u4ece\u201c\u5439\u725b\u903c\u7684\u6f14\u793a Demo\u201d\u62c9\u56de\u5230\u201c\u8e0f\u5b9e\u5e72\u6d3b\u7684\u8f85\u52a9 Copilot\u201d\u3002\u771f\u6b63\u7684\u6548\u7387\u63d0\u5347&#xff0c;\u6765\u81ea\u672c\u5730\u6c99\u76d2\u6781\u901f\u53cd\u9988\u4e0e\u81ea\u6108\u5faa\u73af&#xff0c;\u800c\u4e0d\u662f\u770b\u754c\u9762\u79d2\u51fa\u51e0\u5341\u884c\u4e0d\u53ef\u8fd0\u884c\u7684\u5047\u4ee3\u7801\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AI  Web3 \u5e94\u7528\u8bbe\u8ba1\u4e0e\u667a\u80fd\u5408\u7ea6\u8f85\u52a9\u5f00\u53d1&#xff1a;\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60<br \/>\n\u6f14\u793a Demo \u91cc\u7528 Prompt \u751f\u6210 Solidity \u5408\u7ea6&#xff0c;\u79d2\u53d1 ERC-20 \u751a\u81f3\u79d2\u51fa\u95ea\u7535\u8d37\u903b\u8f91&#xff0c;\u770b\u8d77\u6765\u5f88\u4e1d\u6ed1\u3002\u771f\u62ff\u5230\u672c\u5730\u94fe\u6216\u8005\u6d4b\u8bd5\u7f51\u8dd1\u4e00\u8f6e&#xff0c;\u5927\u591a\u76f4\u63a5\u62a5\u9519&#xff0c;\u751a\u81f3\u4f34\u968f\u4e25\u91cd\u7684\u5b89\u5168\u91cd\u5165\u6f0f\u6d1e\u3002<br \/>\nLLM \u5728\u4ee3\u7801\u751f\u6210\u9886\u57df\u867d\u7136\u8868\u73b0\u4f18\u5f02&#xff0c;\u4f46 smart contract \u8fd9\u79cd\u4e00\u7ecf\u90e8\u7f72\u4e0d\u53ef\u7be1\u6539\u3001\u5bf9\u8fb9\u754c\u72b6\u6001\u6781\u5ea6\u654f\u611f\u7684\u573a\u666f&#xff0c;\u5355\u9760<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[723,1160],"topic":[],"class_list":["post-95034","post","type-post","status-publish","format-standard","hentry","category-server","tag-react","tag-1160"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>AI + Web3 \u5e94\u7528\u8bbe\u8ba1\u4e0e\u667a\u80fd\u5408\u7ea6\u8f85\u52a9\u5f00\u53d1\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/95034.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AI + Web3 \u5e94\u7528\u8bbe\u8ba1\u4e0e\u667a\u80fd\u5408\u7ea6\u8f85\u52a9\u5f00\u53d1\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"AI Web3 \u5e94\u7528\u8bbe\u8ba1\u4e0e\u667a\u80fd\u5408\u7ea6\u8f85\u52a9\u5f00\u53d1&#xff1a;\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 \u6f14\u793a Demo \u91cc\u7528 Prompt \u751f\u6210 Solidity \u5408\u7ea6&#xff0c;\u79d2\u53d1 ERC-20 \u751a\u81f3\u79d2\u51fa\u95ea\u7535\u8d37\u903b\u8f91&#xff0c;\u770b\u8d77\u6765\u5f88\u4e1d\u6ed1\u3002\u771f\u62ff\u5230\u672c\u5730\u94fe\u6216\u8005\u6d4b\u8bd5\u7f51\u8dd1\u4e00\u8f6e&#xff0c;\u5927\u591a\u76f4\u63a5\u62a5\u9519&#xff0c;\u751a\u81f3\u4f34\u968f\u4e25\u91cd\u7684\u5b89\u5168\u91cd\u5165\u6f0f\u6d1e\u3002 LLM \u5728\u4ee3\u7801\u751f\u6210\u9886\u57df\u867d\u7136\u8868\u73b0\u4f18\u5f02&#xff0c;\u4f46 smart contract \u8fd9\u79cd\u4e00\u7ecf\u90e8\u7f72\u4e0d\u53ef\u7be1\u6539\u3001\u5bf9\u8fb9\u754c\u72b6\u6001\u6781\u5ea6\u654f\u611f\u7684\u573a\u666f&#xff0c;\u5355\u9760\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/95034.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-15T17:57:06+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/95034.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/95034.html\",\"name\":\"AI + Web3 \u5e94\u7528\u8bbe\u8ba1\u4e0e\u667a\u80fd\u5408\u7ea6\u8f85\u52a9\u5f00\u53d1\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-15T17:57:06+00:00\",\"dateModified\":\"2026-08-15T17:57:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/95034.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/95034.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/95034.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI + Web3 \u5e94\u7528\u8bbe\u8ba1\u4e0e\u667a\u80fd\u5408\u7ea6\u8f85\u52a9\u5f00\u53d1\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AI + Web3 \u5e94\u7528\u8bbe\u8ba1\u4e0e\u667a\u80fd\u5408\u7ea6\u8f85\u52a9\u5f00\u53d1\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/95034.html","og_locale":"zh_CN","og_type":"article","og_title":"AI + Web3 \u5e94\u7528\u8bbe\u8ba1\u4e0e\u667a\u80fd\u5408\u7ea6\u8f85\u52a9\u5f00\u53d1\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"AI Web3 \u5e94\u7528\u8bbe\u8ba1\u4e0e\u667a\u80fd\u5408\u7ea6\u8f85\u52a9\u5f00\u53d1&#xff1a;\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 \u6f14\u793a Demo \u91cc\u7528 Prompt \u751f\u6210 Solidity \u5408\u7ea6&#xff0c;\u79d2\u53d1 ERC-20 \u751a\u81f3\u79d2\u51fa\u95ea\u7535\u8d37\u903b\u8f91&#xff0c;\u770b\u8d77\u6765\u5f88\u4e1d\u6ed1\u3002\u771f\u62ff\u5230\u672c\u5730\u94fe\u6216\u8005\u6d4b\u8bd5\u7f51\u8dd1\u4e00\u8f6e&#xff0c;\u5927\u591a\u76f4\u63a5\u62a5\u9519&#xff0c;\u751a\u81f3\u4f34\u968f\u4e25\u91cd\u7684\u5b89\u5168\u91cd\u5165\u6f0f\u6d1e\u3002 LLM \u5728\u4ee3\u7801\u751f\u6210\u9886\u57df\u867d\u7136\u8868\u73b0\u4f18\u5f02&#xff0c;\u4f46 smart contract \u8fd9\u79cd\u4e00\u7ecf\u90e8\u7f72\u4e0d\u53ef\u7be1\u6539\u3001\u5bf9\u8fb9\u754c\u72b6\u6001\u6781\u5ea6\u654f\u611f\u7684\u573a\u666f&#xff0c;\u5355\u9760","og_url":"https:\/\/www.wsisp.com\/helps\/95034.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-15T17:57:06+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/95034.html","url":"https:\/\/www.wsisp.com\/helps\/95034.html","name":"AI + Web3 \u5e94\u7528\u8bbe\u8ba1\u4e0e\u667a\u80fd\u5408\u7ea6\u8f85\u52a9\u5f00\u53d1\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-15T17:57:06+00:00","dateModified":"2026-08-15T17:57:06+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/95034.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/95034.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/95034.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"AI + Web3 \u5e94\u7528\u8bbe\u8ba1\u4e0e\u667a\u80fd\u5408\u7ea6\u8f85\u52a9\u5f00\u53d1\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/95034","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=95034"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/95034\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=95034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=95034"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=95034"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=95034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}