{"id":2395,"date":"2026-11-03T14:36:21","date_gmt":"2026-11-03T06:36:21","guid":{"rendered":"https:\/\/lezoo6.com\/index.php\/news\/daily\/erc4626-share-inflation-donation-attack\/"},"modified":"2026-11-03T14:36:21","modified_gmt":"2026-11-03T06:36:21","slug":"erc4626-share-inflation-donation-attack","status":"publish","type":"page","link":"https:\/\/lezoo6.com\/index.php\/news\/daily\/erc4626-share-inflation-donation-attack\/","title":{"rendered":"\u591a\u5b58 1 \u4e2a\u6700\u5c0f\u5355\u4f4d\uff0c\u522b\u4eba\u5b58 15,000 USDC \u53ea\u6362\u5230 1 \u4efd\uff1aERC-4626 \u7684\u4efd\u989d\u6362\u7b97\u4e0e\u6350\u8d60\u653b\u51fb"},"content":{"rendered":"<style>.cl-wrap{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:26px;line-height:1.85;color:#1f2937;font-size:16px}.cl-wrap h2{font-size:20px;margin:30px 0 12px;padding-bottom:8px;border-bottom:2px solid #4338ca;color:#111827}.cl-wrap h3{font-size:17px;margin:26px 0 10px;color:#111827}.cl-wrap p{margin:12px 0}.cl-table{width:100%;border-collapse:collapse;font-size:14px;margin:14px 0}.cl-table th,.cl-table td{border:1px solid #e5e7eb;padding:9px 11px;text-align:left;vertical-align:top}.cl-table th{background:#eef2ff;font-weight:600;color:#312e81}.cl-table td.g{color:#15803d}.cl-table td.y{color:#b45309}.cl-table td.r{color:#b91c1c}.cl-card{background:#eef2ff;border-left:4px solid #4338ca;border-radius:8px;padding:14px 18px;margin:16px 0}.cl-warn{background:#fffbeb;border:1px solid #fde68a;border-radius:10px;padding:14px 18px;margin:18px 0;color:#78350f}.cl-faq{border-top:1px solid #e5e7eb;padding:14px 0}.cl-faq b{display:block;color:#111827;margin-bottom:4px}.cl-faq p{margin:0;color:#4b5563;font-size:15px}.cl-links{font-size:15px;line-height:2.1;padding-left:20px}.cl-links a{color:#4338ca;text-decoration:none}.cl-note{background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:14px 16px;font-size:13px;color:#475569;line-height:1.75;margin-top:20px}.cl-ol{padding-left:22px}.cl-ol li{margin:8px 0}.cl-ul{padding-left:22px}.cl-ul li{margin:8px 0}code{background:#f1f5f9;padding:1px 5px;border-radius:4px;font-size:14px}<\/style>\n<div class=\"cl-wrap\">\n<p>ERC-4626 \u628a\u91d1\u5e93\u7684\u5b58\u5165\u3001\u53d6\u51fa\u3001\u4efd\u989d\u6362\u7b97\u7edf\u4e00\u6210\u4e00\u7ec4\u51fd\u6570\uff0c\u94b1\u5305\u548c\u805a\u5408\u5668\u4e0d\u5fc5\u4e3a\u6bcf\u4e2a\u534f\u8bae\u5355\u72ec\u5199\u9002\u914d\u3002\u4ee3\u4ef7\u662f\u8001\u95ee\u9898\u4e5f\u88ab\u6807\u51c6\u5316\u4e86\uff1a\u4efd\u989d\u4ef7\u683c\u7531 <code>totalAssets \/ totalSupply<\/code> \u7b97\u51fa\uff0c\u800c <code>totalAssets<\/code> \u8ba4\u7684\u662f\u300c\u8fd9\u4e2a\u5408\u7ea6\u91cc\u73b0\u5728\u6709\u591a\u5c11\u8d44\u4ea7\u300d\uff0c\u4e0d\u662f\u300c\u8c01\u5b58\u8fdb\u6765\u7684\u300d\u3002\u53ea\u8981\u80fd\u7ed5\u8fc7 <code>deposit<\/code> \u76f4\u63a5\u5411\u5408\u7ea6\u8f6c\u8d26\uff0c\u4ef7\u683c\u5c31\u4f1a\u88ab\u63a8\u52a8\u3002\u4e0b\u9762\u7528\u4e00\u4e2a 6 \u4f4d\u5c0f\u6570\u7684\u7a33\u5b9a\u5e01\u7b97\u4e00\u904d\uff1a\u653b\u51fb\u8005\u82b1 10,000 \u7f8e\u5143\uff0c\u8ba9\u4e0b\u4e00\u4e2a\u5b58\u5165 15,000 \u7f8e\u5143\u7684\u4eba\u53ea\u62ff\u5230 1 \u4efd\uff0c\u968f\u540e\u5206\u8d70\u5176\u4e2d 2,500 \u7f8e\u5143\u3002<\/p>\n<h2>\u4e00\u3001\u4efd\u989d\u4ef7\u683c\u53ea\u6709\u4e00\u4e2a\u5f0f\u5b50\uff0c\u800c\u4e14\u5fc5\u987b\u5411\u4e0b\u53d6\u6574<\/h2>\n<p>EIP-4626 \u5728 2021 \u5e74 12 \u6708 22 \u65e5\u521b\u5efa\uff0c\u4f9d\u8d56 EIP-20 \u4e0e EIP-2612\uff0c\u89c4\u5b9a\u91d1\u5e93\u53ea\u5bf9\u5e94\u5355\u4e00 ERC-20 \u8d44\u4ea7\u3002<code>convertToShares<\/code> \u4e0e <code>convertToAssets<\/code> \u4e24\u4e2a\u6362\u7b97\u51fd\u6570\u90fd<b>\u5fc5\u987b\u5411\u4e0b\u53d6\u6574\uff08MUST round down\uff09<\/b>\uff0c\u4e14\u4e0d\u5f97\u56e0\u8c03\u7528\u8005\u4e0d\u540c\u800c\u53d8\u5316\u3002\u89c4\u8303\u8fd8\u8981\u6c42 <code>totalAssets<\/code> \u5305\u542b\u590d\u5229\u3001\u5305\u542b\u5bf9\u91d1\u5e93\u6536\u53d6\u7684\u8d39\u7528\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u53d6\u6574\u65b9\u5411\u56fa\u5b9a\u7ad9\u5728\u91d1\u5e93\u4e00\u4fa7\uff1a\u7528\u6237\u5b58\u8fdb\u53bb\u65f6\u53ef\u80fd\u5c11\u62ff\u4e00\u4efd\uff0c\u53d6\u51fa\u6765\u65f6\u53ef\u80fd\u5c11\u62ff\u4e00\u70b9\u3002\u5e73\u65f6\u8fd9\u70b9\u8bef\u5dee\u53ef\u4ee5\u5ffd\u7565\uff0c\u4f46\u5f53\u603b\u4efd\u989d\u53ea\u6709 1 \u4efd\u65f6\uff0c\u5b83\u5c31\u662f\u653b\u51fb\u7684\u652f\u70b9\u3002<\/p>\n<div class=\"cl-card\"><code>shares = assets \u00d7 totalSupply \/ totalAssets<\/code>\uff08\u5411\u4e0b\u53d6\u6574\uff09<br \/><code>assets = shares \u00d7 totalAssets \/ totalSupply<\/code>\uff08\u5411\u4e0b\u53d6\u6574\uff09<\/div>\n<h2>\u4e8c\u3001\u4e3a\u4ec0\u4e48\u300c\u76f4\u63a5\u8f6c\u8d26\u300d\u80fd\u6539\u4ef7\u683c<\/h2>\n<p>\u91d1\u5e93\u901a\u5e38\u7528 <code>asset.balanceOf(address(this))<\/code> \u8ba1\u7b97\u603b\u8d44\u4ea7\u3002\u8fd9\u6761\u8bfb\u6cd5\u7701\u4e8b\uff0c\u5374\u628a\u300c\u4f59\u989d\u300d\u548c\u300c\u5df2\u8bb0\u8d26\u5b58\u6b3e\u300d\u6df7\u4e3a\u4e00\u8c08\uff1a\u4efb\u4f55\u4eba\u5f80\u5408\u7ea6\u5730\u5740\u8f6c\u4e00\u7b14\u5e01\uff0c\u4f59\u989d\u7acb\u523b\u53d8\u5927\uff0c<code>totalAssets<\/code> \u8ddf\u7740\u53d8\u5927\uff0c\u4f46 <code>totalSupply<\/code> \u4e00\u4efd\u6ca1\u591a\u3002\u4efd\u989d\u5355\u4ef7\u4e8e\u662f\u88ab\u51ed\u7a7a\u62ac\u9ad8\u3002\u8fd9\u7b14\u8f6c\u8d26\u5728\u94fe\u4e0a\u6ca1\u6709\u4efb\u4f55\u6807\u8bb0\uff0c\u4e8b\u540e\u770b\u53ea\u662f\u4e00\u7b14\u666e\u901a\u7684 ERC-20 <code>transfer<\/code>\u3002<\/p>\n<p>\u53cd\u8fc7\u6765\u770b\uff0c\u8fd9\u5c31\u662f\u300c\u6350\u8d60\u300d\uff1a\u6350\u8d60\u8005\u628a\u81ea\u5df1\u7684\u94b1\u53d8\u6210\u5168\u4f53\u4efd\u989d\u6301\u6709\u4eba\u7684\u51c0\u8d44\u4ea7\u3002\u5982\u679c\u6b64\u65f6\u4efd\u989d\u603b\u6570\u6781\u5c11\uff0c\u6350\u8d60\u8005\u540c\u65f6\u53c8\u662f\u51e0\u4e4e\u552f\u4e00\u7684\u6301\u6709\u4eba\uff0c\u90a3\u4e48\u540e\u6765\u8005\u5b58\u5165\u65f6\u6309\u9ad8\u4ef7\u6362\u7b97\uff0c\u7b49\u4e8e\u628a\u81ea\u5df1\u7684\u94b1\u6309\u6bd4\u4f8b\u9001\u7ed9\u4e86\u8001\u6301\u6709\u4eba\u3002<\/p>\n<h2>\u4e09\u3001\u4e00\u6b21\u5b8c\u6574\u7684\u7b97\u4f8b\uff1a10,000 \u7f8e\u5143\u4e70\u8d70 2,500 \u7f8e\u5143<\/h2>\n<p>\u8bbe\u8d44\u4ea7\u662f 6 \u4f4d\u5c0f\u6570\u7684\u7a33\u5b9a\u5e01\uff081 USDC = 1,000,000 \u4e2a\u6700\u5c0f\u5355\u4f4d\uff09\uff0c\u91d1\u5e93\u521a\u521b\u5efa\u3001\u603b\u8d44\u4ea7\u4e0e\u603b\u4efd\u989d\u90fd\u662f 0\u3002<\/p>\n<ol class=\"cl-ol\">\n<li>\u653b\u51fb\u8005\u5b58\u5165 1 \u4e2a\u6700\u5c0f\u5355\u4f4d\uff080.000001 USDC\uff09\uff0c\u6309 <code>1 \u00d7 0 \/ 0<\/code> \u7684\u8fb9\u754c\u5904\u7406\u5f97\u5230 1 \u4efd\u3002\u6b64\u65f6 totalAssets = 1\uff0ctotalSupply = 1\u3002<\/li>\n<li>\u653b\u51fb\u8005\u76f4\u63a5\u5411\u91d1\u5e93\u5730\u5740\u8f6c\u8d26 10,000 USDC\uff08\u4e0d\u8d70 deposit\uff09\u3002totalAssets = 10,000,000,001\uff0ctotalSupply \u4ecd\u662f 1\u3002<\/li>\n<li>\u53d7\u5bb3\u8005\u5b58\u5165 15,000 USDC\u3002\u4efd\u989d = 15,000,000,000 \u00d7 1 \u00f7 10,000,000,001 = 1.4999\u2026\uff0c\u5411\u4e0b\u53d6\u6574\u5f97 <b>1 \u4efd<\/b>\u3002<\/li>\n<li>\u6b64\u65f6 totalAssets = 25,000,000,001\uff0ctotalSupply = 2\u3002\u53d7\u5bb3\u8005\u8d4e\u56de 1 \u4efd\uff0c\u62ff\u5230 25,000,000,001 \u00f7 2 = 12,500,000,000\uff0c\u5373 <b>12,500 USDC<\/b>\u3002<\/li>\n<\/ol>\n<p>\u7ed3\u679c\uff1a\u53d7\u5bb3\u8005\u4e00\u7b14\u5b58\u8fdb\u53bb 15,000\uff0c\u8d26\u9762\u4e0a\u7acb\u523b\u53ea\u5269 12,500\uff0c<b>\u51c0\u635f\u5931 2,500 USDC<\/b>\uff1b\u653b\u51fb\u8005\u6295\u5165 10,000 \u52a0 1 \u4e2a\u6700\u5c0f\u5355\u4f4d\uff0c\u8d4e\u56de 1 \u4efd\u62ff\u56de 12,500\uff0c<b>\u51c0\u8d5a 2,500 USDC<\/b>\u3002<\/p>\n<p>\u6ce8\u610f\u8fd9\u4e2a\u95e8\u69db\uff1a\u53ea\u8981\u6350\u8d60\u989d\u5927\u4e8e\u53d7\u5bb3\u8005\u7684\u5b58\u6b3e\u989d\uff0c\u53d7\u5bb3\u8005\u7684\u4efd\u989d\u5c31\u4f1a\u88ab\u538b\u5230 0 \u6216 1\u3002\u653b\u51fb\u8005\u4e0d\u9700\u8981\u731c\u53d7\u5bb3\u8005\u5b58\u591a\u5c11\uff0c\u4ed6\u53ea\u9700\u8981\u6350\u5f97\u6bd4\u300c\u9884\u8ba1\u6700\u5927\u5355\u7b14\u5b58\u6b3e\u300d\u66f4\u591a\uff0c\u6216\u8005\u76ef\u7740\u5185\u5b58\u6c60\u91cc\u5f85\u786e\u8ba4\u7684\u5b58\u6b3e\u4ea4\u6613\u52a0\u4ef7\u63d2\u961f\u3002<\/p>\n<h2>\u56db\u3001\u865a\u62df\u4efd\u989d\u628a\u95e8\u69db\u62ac\u9ad8\u4e86\uff0c\u4f46\u6ca1\u6709\u5f52\u96f6<\/h2>\n<p>\u4e3b\u6d41\u5b9e\u73b0\uff08OpenZeppelin \u7684 ERC4626\uff09\u7528\u4e00\u4e2a\u865a\u62df\u504f\u79fb\u6765\u5bf9\u51b2\uff1a\u8ba1\u7b97\u4efd\u989d\u65f6\u7ed9\u5206\u5b50\u52a0\u4e0a <code>10^offset<\/code> \u4efd\u865a\u62df\u4efd\u989d\uff0c\u7ed9\u5206\u6bcd\u52a0\u4e0a 1 \u4e2a\u865a\u62df\u8d44\u4ea7\uff0c\u5373 <code>shares = assets \u00d7 (totalSupply + 10^offset) \/ (totalAssets + 1)<\/code>\u3002\u8fd9\u628a\u300c\u4efd\u989d\u88ab\u538b\u5230 0\u300d\u7684\u6761\u4ef6\u4ece\u300c\u6350\u8d60\u989d > \u5b58\u6b3e\u989d\u300d\u6539\u6210\u4e86\u300c\u6350\u8d60\u989d > \u5b58\u6b3e\u989d \u00d7 (1 + 10^offset)\u300d\u3002<\/p>\n<table class=\"cl-table\">\n<tr>\n<th>decimalsOffset<\/th>\n<th>\u865a\u62df\u4efd\u989d<\/th>\n<th>\u628a\u53d7\u5bb3\u8005\u4efd\u989d\u538b\u5230 0 \u6240\u9700\u6350\u8d60\u989d<\/th>\n<th>\u5bf9 15,000 USDC \u5b58\u6b3e<\/th>\n<\/tr>\n<tr>\n<td>0\uff08\u9ed8\u8ba4\uff09<\/td>\n<td>1<\/td>\n<td class=\"y\">> 1 \u500d\u5b58\u6b3e\u989d<\/td>\n<td>\u9700\u6350 &gt; 30,000<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>1,000<\/td>\n<td class=\"g\">> 1,000 \u500d\u5b58\u6b3e\u989d<\/td>\n<td>\u9700\u6350 &gt; 1,500 \u4e07<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>1,000,000<\/td>\n<td class=\"g\">> 100 \u4e07\u500d\u5b58\u6b3e\u989d<\/td>\n<td>\u9700\u6350 &gt; 150 \u4ebf<\/td>\n<\/tr>\n<\/table>\n<p>\u7528\u7b2c\u4e09\u8282\u7684\u540c\u4e00\u7ec4\u6570\u5b57\u3001offset \u53d6 0 \u590d\u7b97\uff1a\u53d7\u5bb3\u8005\u4efd\u989d = 15,000,000,000 \u00d7 2 \u00f7 10,000,000,002 = 2.9999\u2026 \u2192 2 \u4efd\uff1b\u603b\u4efd\u989d\u53d8\u4e3a 3\uff0c\u53d7\u5bb3\u8005\u8d4e\u56de 2 \u4efd\u5f97 16,666 USDC\uff0c\u53cd\u800c\u591a\u62ff\u4e86 1,666\uff0c\u653b\u51fb\u8005\u4e8f\u6389\u540c\u6837\u91d1\u989d\u3002\u53ef\u89c1\u9ed8\u8ba4\u504f\u79fb\u5728\u8fd9\u7b14\u89c4\u6a21\u4e0a\u5df2\u7ecf\u8db3\u591f\uff1b\u4f46\u5b83\u53ea\u662f\u628a\u653b\u51fb\u6210\u672c\u4e58\u4e86\u4e00\u4e2a\u5e38\u6570\uff0c\u4e0d\u662f\u628a\u653b\u51fb\u53d8\u6210\u4e0d\u53ef\u80fd\u3002\u9879\u76ee\u65b9\u82e5\u628a offset \u8bbe\u6210 3 \u6216 6\uff0c\u6210\u672c\u4f1a\u518d\u62ac\u4e09\u4e2a\u3001\u516d\u4e2a\u6570\u91cf\u7ea7\u3002<\/p>\n<h2>\u4e94\u3001\u5411\u4e0b\u53d6\u6574\u3001\u9996\u6b21\u5b58\u6b3e\u4e0e\u300c\u7a7a\u91d1\u5e93\u300d\u4e09\u5904\u6700\u5bb9\u6613\u51fa\u4e8b<\/h2>\n<p>\u628a\u4e0a\u9762\u51e0\u8282\u538b\u6210\u53ef\u6838\u5bf9\u7684\u70b9\uff1a\u7b2c\u4e00\uff0c\u53d6\u6574\u65b9\u5411\u56fa\u5b9a\u5728\u91d1\u5e93\u4fa7\uff0c\u51e1\u662f\u300c\u7528\u6237\u6309\u4efd\u989d\u8d4e\u56de\u300d\u7684\u8def\u5f84\uff0c\u90fd\u8981\u5047\u5b9a\u81ea\u5df1\u4f1a\u5c11\u62ff dust\uff1b\u7b2c\u4e8c\uff0c<code>totalSupply<\/code> \u6781\u5c0f\u65f6\u98ce\u9669\u6700\u9ad8\uff0c\u7a7a\u91d1\u5e93\u7684\u7b2c\u4e00\u7b14\u5b58\u6b3e\u5e94\u8be5\u7531\u534f\u8bae\u81ea\u5df1\u5b8c\u6210\uff0c\u6216\u8005\u8981\u6c42\u6700\u5c0f\u9996\u5b58\u989d\uff1b\u7b2c\u4e09\uff0c<code>totalAssets<\/code> \u7684\u8bfb\u6cd5\u51b3\u5b9a\u4e86\u653b\u51fb\u9762\uff0c\u7528\u5185\u90e8\u8bb0\u8d26\u53d8\u91cf\uff08\u5b58\u5165\u52a0\u3001\u53d6\u51fa\u51cf\u3001\u6536\u76ca\u5355\u72ec\u7ed3\u7b97\uff09\u6bd4\u76f4\u63a5\u8bfb\u4f59\u989d\u66f4\u96be\u88ab\u6350\u8d60\u63a8\u52a8\uff0c\u4f46\u4f1a\u727a\u7272\u300c\u522b\u4eba\u6253\u8d4f\u4e5f\u7b97\u6536\u76ca\u300d\u7684\u4fbf\u5229\u3002<\/p>\n<table class=\"cl-table\">\n<tr>\n<th>\u6838\u5bf9\u9879<\/th>\n<th>\u8981\u770b\u4ec0\u4e48<\/th>\n<th>\u4e0d\u5408\u89c4\u7684\u540e\u679c<\/th>\n<\/tr>\n<tr>\n<td>totalAssets \u6765\u6e90<\/td>\n<td>\u662f\u5185\u90e8\u8bb0\u8d26\uff0c\u8fd8\u662f <code>balanceOf(this)<\/code><\/td>\n<td>\u53ef\u88ab\u76f4\u63a5\u8f6c\u8d26\u62ac\u4ef7<\/td>\n<\/tr>\n<tr>\n<td>\u53d6\u6574\u65b9\u5411<\/td>\n<td>deposit\/mint \u662f\u5426\u5411\u4e0b\u53d6\u6574<\/td>\n<td>\u7528\u6237\u591a\u62ff\u4efd\u989d\uff0c\u91d1\u5e93\u88ab\u6162\u6162\u62bd\u5e72<\/td>\n<\/tr>\n<tr>\n<td>\u865a\u62df\u504f\u79fb<\/td>\n<td><code>_decimalsOffset()<\/code> \u8fd4\u56de\u503c<\/td>\n<td>\u9ed8\u8ba4 0 \u65f6\u95e8\u69db\u53ea\u6709 1 \u500d\u5b58\u6b3e\u989d<\/td>\n<\/tr>\n<tr>\n<td>\u9996\u5b58\u4fdd\u62a4<\/td>\n<td>\u662f\u5426\u6709\u6700\u5c0f\u9996\u5b58\u6216\u79cd\u5b50\u4efd\u989d<\/td>\n<td>\u7a7a\u91d1\u5e93\u53ef\u88ab 1 \u4e2a\u6700\u5c0f\u5355\u4f4d\u5360\u4f4f<\/td>\n<\/tr>\n<tr>\n<td>\u8d39\u7528\u8ba1\u63d0<\/td>\n<td>totalAssets \u662f\u5426\u5df2\u6263\u7ba1\u7406\u8d39<\/td>\n<td>\u4efd\u989d\u4ef7\u683c\u865a\u9ad8\uff0c\u8d4e\u56de\u65f6\u6324\u5151<\/td>\n<\/tr>\n<\/table>\n<h2>\u516d\u3001\u5b83\u4e0d\u662f\u300c\u6240\u6709\u91d1\u5e93\u90fd\u4e0d\u5b89\u5168\u300d\uff0c\u4f46\u4e5f\u6709\u660e\u786e\u8fb9\u754c<\/h2>\n<p>\u6350\u8d60\u653b\u51fb\u6210\u7acb\u9700\u8981\u4e09\u4e2a\u6761\u4ef6\u540c\u65f6\u6ee1\u8db3\uff1a\u603b\u4efd\u989d\u6781\u5c0f\u3001\u603b\u8d44\u4ea7\u76f4\u63a5\u8bfb\u4f59\u989d\u3001\u5b58\u5728\u4e00\u7b14\u8db3\u591f\u5927\u7684\u540e\u7eed\u5b58\u6b3e\u3002\u6210\u719f\u91d1\u5e93\u901a\u5e38\u7528\u5185\u90e8\u8bb0\u8d26\u6216\u5927\u989d\u865a\u62df\u504f\u79fb\u628a\u8fd9\u4e09\u6761\u62c6\u6389\uff0c\u518d\u52a0\u4e0a\u9996\u5b58\u9650\u5236\uff0c\u98ce\u9669\u968f\u4e4b\u4e0b\u964d\u3002\u771f\u6b63\u8be5\u8b66\u60d5\u7684\u662f\u65b0\u90e8\u7f72\u3001\u6d41\u52a8\u6027\u8fd8\u5f88\u5c0f\u3001\u4e14\u7528\u300c\u4f59\u989d\u5373\u8d44\u4ea7\u300d\u5199\u6cd5\u7684\u91d1\u5e93\u2014\u2014\u5b83\u4eec\u6700\u5bb9\u6613\u88ab\u4e00\u7b14\u8f6c\u8d26\u6539\u5199\u4ef7\u683c\uff0c\u800c\u94fe\u4e0a\u4e8b\u524d\u770b\u4e0d\u51fa\u5f02\u5e38\u3002<\/p>\n<p>\u5224\u65ad\u65b9\u6cd5\u5f88\u7b80\u5355\uff1a\u6253\u5f00\u5408\u7ea6\uff0c\u627e <code>totalAssets()<\/code> \u7684\u5b9e\u73b0\u3002\u5982\u679c\u5b83\u8fd4\u56de\u7684\u662f\u4ee3\u5e01\u7684 <code>balanceOf<\/code>\uff0c\u518d\u786e\u8ba4 <code>totalSupply<\/code> \u5f53\u524d\u662f\u591a\u5c11\u3001\u6709\u6ca1\u6709\u6700\u5c0f\u9996\u5b58\u3002\u4e09\u4e2a\u6570\u4e00\u770b\uff0c\u98ce\u9669\u5927\u5c0f\u57fa\u672c\u5c31\u5b9a\u4e86\u3002<\/p>\n<p>\u628a\u4e0a\u9762\u51e0\u8282\u6536\u6210\u4e00\u53e5\u7ed3\u8bba\uff1a\u4efd\u989d\u6362\u7b97\u672c\u8eab\u6ca1\u9519\uff0c\u9519\u5728\u628a\u300c\u4f59\u989d\u300d\u5f53\u6210\u300c\u51c0\u8d44\u4ea7\u300d\u4e14\u5141\u8bb8\u4efd\u989d\u603b\u6570\u8d8b\u8fd1\u4e8e 1\u3002\u5931\u6548\u6761\u4ef6\u6709\u4e09\u6761\uff1a\u91d1\u5e93\u8bbe\u7f6e\u4e86\u975e\u96f6\u7684 decimalsOffset \u4e14\u91d1\u989d\u8db3\u591f\u5927\uff1btotalAssets \u4f7f\u7528\u5185\u90e8\u8bb0\u8d26\uff1b\u534f\u8bae\u81ea\u8eab\u6301\u6709\u79cd\u5b50\u4efd\u989d\u5e76\u8bbe\u4e86\u9996\u5b58\u4e0b\u9650\u3002\u4e09\u6761\u91cc\u6ee1\u8db3\u4e24\u6761\uff0c\u672c\u6587\u7684\u7b97\u4f8b\u5c31\u4e0d\u518d\u6210\u7acb\u3002<\/p>\n<h2>\u5e38\u89c1\u95ee\u9898<\/h2>\n<div class=\"cl-faq\"><b>Q1\uff1a\u4e3a\u4ec0\u4e48\u53d7\u5bb3\u8005\u62ff\u5230\u7684\u662f 1 \u4efd\u800c\u4e0d\u662f 1.49 \u4efd\uff1f<\/b><\/p>\n<p>\u56e0\u4e3a EIP-4626 \u89c4\u5b9a\u6362\u7b97\u5fc5\u987b\u5411\u4e0b\u53d6\u6574\uff0c1.4999 \u4f1a\u88ab\u622a\u6210 1\u3002\u89c4\u8303\u8fd9\u6837\u5199\u662f\u4e3a\u4e86\u4fdd\u8bc1\u91d1\u5e93\u4e0d\u4f1a\u56e0\u53d6\u6574\u800c\u5c11\u8d44\u4ea7\uff0c\u4ee3\u4ef7\u662f\u7528\u6237\u5728\u6781\u7aef\u6bd4\u4f8b\u4e0b\u4f1a\u635f\u5931\u8f83\u5927\u3002<\/p>\n<\/div>\n<div class=\"cl-faq\"><b>Q2\uff1a\u76f4\u63a5\u8f6c\u8d26\u548c deposit \u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/b><\/p>\n<p>deposit \u4f1a\u540c\u65f6\u589e\u52a0 totalAssets \u4e0e totalSupply\uff0c\u4efd\u989d\u4ef7\u683c\u4e0d\u53d8\uff1b\u76f4\u63a5\u8f6c\u8d26\u53ea\u589e\u52a0 totalAssets\uff0c\u4efd\u989d\u4ef7\u683c\u88ab\u62ac\u9ad8\uff0c\u4e14\u6ca1\u6709\u4efb\u4f55\u8bb0\u8d26\u51ed\u8bc1\u3002<\/p>\n<\/div>\n<div class=\"cl-faq\"><b>Q3\uff1a\u628a decimalsOffset \u8c03\u5927\u5c31\u5b89\u5168\u4e86\u5417\uff1f<\/b><\/p>\n<p>\u5b83\u53ea\u628a\u653b\u51fb\u6210\u672c\u6309 10 \u7684\u5e42\u6b21\u62ac\u9ad8\uff0c\u5e76\u4e0d\u80fd\u6d88\u9664\u3002\u8fd8\u8981\u914d\u5408\u9996\u5b58\u4e0b\u9650\u3001\u5185\u90e8\u8bb0\u8d26\u4e0e\u5b58\u6b3e\u4e0a\u9650\uff0c\u624d\u80fd\u8ba9\u300c\u6350\u4e00\u7b14\u5c31\u6539\u4ef7\u300d\u4e0d\u5212\u7b97\u3002<\/p>\n<\/div>\n<p><script type=\"application\/ld+json\">{\"@context\":\"https:\/\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"\u4e3a\u4ec0\u4e48\u53d7\u5bb3\u8005\u62ff\u5230\u7684\u662f 1 \u4efd\u800c\u4e0d\u662f 1.49 \u4efd\uff1f\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"\u56e0\u4e3a EIP-4626 \u89c4\u5b9a\u6362\u7b97\u5fc5\u987b\u5411\u4e0b\u53d6\u6574\uff0c1.4999 \u4f1a\u88ab\u622a\u6210 1\u3002\u89c4\u8303\u8fd9\u6837\u5199\u662f\u4e3a\u4e86\u4fdd\u8bc1\u91d1\u5e93\u4e0d\u4f1a\u56e0\u53d6\u6574\u800c\u5c11\u8d44\u4ea7\uff0c\u4ee3\u4ef7\u662f\u7528\u6237\u5728\u6781\u7aef\u6bd4\u4f8b\u4e0b\u4f1a\u635f\u5931\u8f83\u5927\u3002\"}},{\"@type\":\"Question\",\"name\":\"\u76f4\u63a5\u8f6c\u8d26\u548c deposit \u6709\u4ec0\u4e48\u533a\u522b\uff1f\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"deposit \u4f1a\u540c\u65f6\u589e\u52a0 totalAssets \u4e0e totalSupply\uff0c\u4efd\u989d\u4ef7\u683c\u4e0d\u53d8\uff1b\u76f4\u63a5\u8f6c\u8d26\u53ea\u589e\u52a0 totalAssets\uff0c\u4efd\u989d\u4ef7\u683c\u88ab\u62ac\u9ad8\uff0c\u4e14\u6ca1\u6709\u4efb\u4f55\u8bb0\u8d26\u51ed\u8bc1\u3002\"}},{\"@type\":\"Question\",\"name\":\"\u628a decimalsOffset \u8c03\u5927\u5c31\u5b89\u5168\u4e86\u5417\uff1f\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"\u5b83\u53ea\u628a\u653b\u51fb\u6210\u672c\u6309 10 \u7684\u5e42\u6b21\u62ac\u9ad8\uff0c\u5e76\u4e0d\u80fd\u6d88\u9664\u3002\u8fd8\u8981\u914d\u5408\u9996\u5b58\u4e0b\u9650\u3001\u5185\u90e8\u8bb0\u8d26\u4e0e\u5b58\u6b3e\u4e0a\u9650\uff0c\u624d\u80fd\u8ba9\u300c\u6350\u4e00\u7b14\u5c31\u6539\u4ef7\u300d\u4e0d\u5212\u7b97\u3002\"}}]}<\/script><\/p>\n<h3>\u76f8\u5173\u9605\u8bfb<\/h3>\n<ul class=\"cl-links\">\n<li><a href=\"https:\/\/lezoo6.com\/index.php\/news\/daily\/flash-loan-fee-atomicity\/\">\u95ea\u7535\u8d37\u7684\u4fdd\u8d39\u3001\u539f\u5b50\u6027\u4e0e\u88ab\u8bef\u8bfb\u7684\u300c\u95ea\u7535\u8d37\u653b\u51fb\u300d<\/a><\/li>\n<li><a href=\"https:\/\/lezoo6.com\/index.php\/news\/daily\/erc20-approve-permit-3009-field-compare\/\">ERC-20 approve\u3001permit \u4e0e 3009\uff1a\u4e09\u79cd\u6388\u6743\u5b57\u6bb5\u5bf9\u7167<\/a><\/li>\n<li><a href=\"https:\/\/lezoo6.com\/index.php\/learn\/academy\/utilization-kink-borrow-rate-curve\/\">\u5229\u7528\u7387\u5230 80% \u4e4b\u540e\uff0c\u501f\u6b3e\u5229\u7387\u4e3a\u4ec0\u4e48\u7a81\u7136\u7ffb\u5341\u500d<\/a><\/li>\n<\/ul>\n<div class=\"cl-note\"><b>\u8d44\u6599\u6765\u6e90\uff08\u8bbf\u95ee\u65e5\u671f\u5747\u4e3a 2026-11-03\uff09<\/b><br \/>EIP-4626\u300aTokenized Vaults\u300b\uff082021-12-22 \u521b\u5efa\uff0c\u8981\u6c42\u6362\u7b97\u5411\u4e0b\u53d6\u6574\uff09\uff0c<a href=\"https:\/\/eips.ethereum.org\/EIPS\/eip-4626\" rel=\"nofollow noopener\" target=\"_blank\">https:\/\/eips.ethereum.org\/EIPS\/eip-4626<\/a><br \/>OpenZeppelin Contracts \u6587\u6863\uff1aERC4626 \u4e0e _decimalsOffset \u7684\u8bf4\u660e\uff0c<a href=\"https:\/\/docs.openzeppelin.com\/contracts\/5.x\/erc4626\" rel=\"nofollow noopener\" target=\"_blank\">https:\/\/docs.openzeppelin.com\/contracts\/5.x\/erc4626<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4efd\u989d\u4ef7\u683c\u7b49\u4e8e\u603b\u8d44\u4ea7\u9664\u4ee5\u603b\u4efd\u989d\uff0c\u800c\u603b\u8d44\u4ea7\u8ba4\u7684\u662f\u5408\u7ea6\u4f59\u989d\u3002\u672c\u6587\u7528 6 \u4f4d\u5c0f\u6570\u7684\u7a33\u5b9a\u5e01\u628a\u300c\u76f4\u63a5\u8f6c\u8d26\u62ac\u4ef7\u300d\u8fd9\u7b14\u8d26\u7b97\u5b8c\u6574\uff0c\u5e76\u7ed9\u51fa\u865a\u62df\u4efd\u989d\u628a\u653b\u51fb\u6210\u672c\u62ac\u9ad8\u591a\u5c11\u500d\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":857,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-2395","page","type-page","status-publish"],"_links":{"self":[{"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/pages\/2395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/comments?post=2395"}],"version-history":[{"count":0,"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/pages\/2395\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/pages\/857"}],"wp:attachment":[{"href":"https:\/\/lezoo6.com\/index.php\/wp-json\/wp\/v2\/media?parent=2395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}