PageSourceSearch

https://solidity.tw/head-first-eof/

html solidity.tw collected 2026-10-04 13:30:09 UTC 18,897 bytes, 46 lines download raw bytes

1<!DOCTYPE html>
2<html lang="zh-TW">
3  <head>
4    <meta charset="utf-8">
5    <meta name="viewport" content="width=device-width,initial-scale=1">
6    <title>深入淺出 EOFv1 | 一本關於 Ethereum 與 Solidity 智能合約的書</title>
7    <meta name="generator" content="VuePress 1.9.10">
8    
9    <meta name="description" content="在 2022 年,我們該如何學習智能合約開發">
10    
11    <link rel="preload" href="/assets/css/0.styles.9f477098.css" as="style"><link rel="preload" href="/assets/js/app.b4a0f8ef.js" as="script"><link rel="preload" href="/assets/js/2.ce7b5ffa.js" as="script"><link rel="preload" href="/assets/js/1.843ff0e7.js" as="script"><link rel="preload" href="/assets/js/67.faa6f699.js" as="script"><link rel="prefetch" href="/assets/js/10.c12fac62.js"><link rel="prefetch" href="/assets/js/11.c2affc04.js"><link rel="prefetch" href="/assets/js/12.f054eba6.js"><link rel="prefetch" href="/assets/js/13.e4d40fa1.js"><link rel="prefetch" href="/assets/js/14.ed0a28d5.js"><link rel="prefetch" href="/assets/js/15.d25bd3fe.js"><link rel="prefetch" href="/assets/js/16.97c2c4a8.js"><link rel="prefetch" href="/assets/js/17.849d402a.js"><link rel="prefetch" href="/assets/js/18.cdc68d17.js"><link rel="prefetch" href="/assets/js/19.e30826d9.js"><link rel="prefetch" href="/assets/js/20.8effbcd5.js"><link rel="prefetch" href="/assets/js/21.9653cdd5.js"><link rel="prefetch" href="/assets/js/22.cb4ae59c.js"><link rel="prefetch" href="/assets/js/23.b6fc1300.js"><link rel="prefetch" href="/assets/js/24.778ffaf6.js"><link rel="prefetch" href="/assets/js/25.ff81639a.js"><link rel="prefetch" href="/assets/js/26.af99b220.js"><link rel="prefetch" href="/assets/js/27.74198ac3.js"><link rel="prefetch" href="/assets/js/28.a47a9604.js"><link rel="prefetch" href="/assets/js/29.4f16422d.js"><link rel="prefetch" href="/assets/js/3.16c4453f.js"><link rel="prefetch" href="/assets/js/30.f298419f.js"><link rel="prefetch" href="/assets/js/31.1a21d7a4.js"><link rel="prefetch" href="/assets/js/32.14fd2d9a.js"><link rel="prefetch" href="/assets/js/33.416bd998.js"><link rel="prefetch" href="/assets/js/34.82b44d0c.js"><link rel="prefetch" href="/assets/js/35.27e3d54a.js"><link rel="prefetch" href="/assets/js/36.c3b1843c.js"><link rel="prefetch" href="/assets/js/37.d6736751.js"><link rel="prefetch" href="/assets/js/38.ef4141df.js"><link rel="prefetch" href="/assets/js/39.15fc33ad.js"><link rel="prefetch" href="/assets/js/4.7b5274ce.js"><link rel="prefetch" href="/assets/js/40.0c8f408e.js"><link rel="prefetch" href="/assets/js/41.95c43a4c.js"><link rel="prefetch" href="/assets/js/42.37e3dbc1.js"><link rel="prefetch" href="/assets/js/43.726b47f6.js"><link rel="prefetch" href="/assets/js/44.0c623027.js"><link rel="prefetch" href="/assets/js/45.a9d47927.js"><link rel="prefetch" href="/assets/js/46.a01f013b.js"><link rel="prefetch" href="/assets/js/47.f909334f.js"><link rel="prefetch" href="/assets/js/48.f3ce3acc.js"><link rel="prefetch" href="/assets/js/49.bf17f86c.js"><link rel="prefetch" href="/assets/js/5.a90aa973.js"><link rel="prefetch" href="/assets/js/50.76543ed3.js"><link rel="prefetch" href="/assets/js/51.a77781e8.js"><link rel="prefetch" href="/assets/js/52.522cda49.js"><link rel="prefetch" href="/assets/js/53.4e88f52c.js"><link rel="prefetch" href="/assets/js/54.565c39aa.js"><link rel="prefetch" href="/assets/js/55.d04ba7d8.js"><link rel="prefetch" href="/assets/js/56.7ce37e58.js"><link rel="prefetch" href="/assets/js/57.17e6376e.js"><link rel="prefetch" href="/assets/js/58.62087995.js"><link rel="prefetch" href="/assets/js/59.c526d55f.js">
11<link rel="prefetch" href="/assets/js/6.acf7bb6e.js"><link rel="prefetch" href="/assets/js/60.ab86d4cc.js"><link rel="prefetch" href="/assets/js/61.dc1027c2.js"><link rel="prefetch" href="/assets/js/62.d1faa0e3.js"><link rel="prefetch" href="/assets/js/63.27478a7c.js"><link rel="prefetch" href="/assets/js/64.774fdd9e.js"><link rel="prefetch" href="/assets/js/65.bdeefe51.js"><link rel="prefetch" href="/assets/js/66.569b3bd4.js"><link rel="prefetch" href="/assets/js/7.dfcce160.js"><link rel="prefetch" href="/assets/js/vendors~docsearch.d9dffa33.js">
12    <link rel="stylesheet" href="/assets/css/0.styles.9f477098.css">
13  </head>
14  <body>
15    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">一本關於 Ethereum 與 Solidity 智能合約的書</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link">
16  首頁
17</a></div><div class="nav-item"><a href="/ethereum-101/" class="nav-link">
18  那些關於 Ethereum 的事
19</a></div><div class="nav-item"><a href="https://youtube.com/playlist?list=PLHmOMPRfmOxQYDnXAc1hKY6ra4WDU8ZlM" target="_blank" rel="noopener noreferrer" class="nav-link external">
20  在 2022 年,我們該如何寫智能合約
21  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://www.youtube.com/playlist?list=PLHmOMPRfmOxTiqyaSu1EXs8ioESZtOSHN" target="_blank" rel="noopener noreferrer" class="nav-link external">
22  淺入淺出 EVM Object Format
23  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <a href="https://github.com/hydai/solidity.tw" target="_blank" rel="noopener noreferrer" class="repo-link">
24    GitHub
25    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link">
26  首頁
27</a></div><div class="nav-item"><a href="/ethereum-101/" class="nav-link">
28  那些關於 Ethereum 的事
29</a></div><div class="nav-item"><a href="https://youtube.com/playlist?list=PLHmOMPRfmOxQYDnXAc1hKY6ra4WDU8ZlM" target="_blank" rel="noopener noreferrer" class="nav-link external">
30  在 2022 年,我們該如何寫智能合約
31  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound">
31<path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="https://www.youtube.com/playlist?list=PLHmOMPRfmOxTiqyaSu1EXs8ioESZtOSHN" target="_blank" rel="noopener noreferrer" class="nav-link external">
32  淺入淺出 EVM Object Format
33  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <a href="https://github.com/hydai/solidity.tw" target="_blank" rel="noopener noreferrer" class="repo-link">
34    GitHub
35    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>Head First Eof</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/head-first-eof/" aria-current="page" class="active sidebar-link">深入淺出 EOFv1</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/head-first-eof/#前言" class="sidebar-link">前言</a></li><li class="sidebar-sub-header"><a href="/head-first-eof/#關於-eof" class="sidebar-link">關於 EOF</a></li><li class="sidebar-sub-header"><a href="/head-first-eof/#大綱" class="sidebar-link">大綱</a></li></ul></li><li><a href="/head-first-eof/10-EIP-3541.html" class="sidebar-link">EIP-3541 禁止以 0xEF 開頭的新智慧合約</a></li><li><a href="/head-first-eof/11-EIP-3540.html" class="sidebar-link">EIP-3540 電腦程式的新衣服 - EVM 物件格式 (EOF)</a></li><li><a href="/head-first-eof/12-EIP-3670.html" class="sidebar-link">EIP-3670: 智慧合約的程式碼檢查</a></li><li><a href="/head-first-eof/13-EIP-4200.html" class="sidebar-link">EIP-4200:EOF - 靜態相對跳躍</a></li><li><a href="/head-first-eof/14-EIP-7480.html" class="sidebar-link">EIP-7480: EOF - 資料區段存取指令</a></li><li><a href="/head-first-eof/15-EIP-663.html" class="sidebar-link">EIP-663:SWAPN、DUPN 和 EXCHANGE 指令</a></li><li><a href="/head-first-eof/16-EIP-7069.html" class="sidebar-link">EIP-7069 改良版呼叫指令</a></li><li><a href="/head-first-eof/17-EIP-4750.html" class="sidebar-link">EIP-4750 EOF 函式功能</a></li><li><a href="/head-first-eof/18-EIP-6206.html" class="sidebar-link">EIP-6206 - JUMPF 與非回傳函式</a></li><li><a href="/head-first-eof/19-EIP-7620.html" class="sidebar-link">EIP-7620:EOF 合約部署新方式</a></li><li><a href="/head-first-eof/20-EIP-7698.html" class="sidebar-link">EIP-7698: EOF - 部署交易</a></li><li><a href="/head-first-eof/21-EIP-5450.html" class="sidebar-link">EIP-5450: EOF - 堆疊驗證</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="深入淺出-eofv1"><a href="#深入淺出-eofv1" class="header-anchor">#</a> 深入淺出 EOFv1</h1> <p>為一系列以 EVM Object Format 為主題的教學課程,包含影片與文章,為「淺入淺出 EOF」的重製版本。將以完全初學者的角度入手,從各種背景知識開始介紹,由淺入深的讓讀者對 EOF 能有更完整的印象。</p> <ul><li><a href="https://www.youtube.com/playlist?list=PLHmOMPRfmOxQo8mIUkW2DNj9l4Y3MW9KW" target="_blank" rel="noopener noreferrer">
35影片播放清單(現正熱映中)<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>。</li> <li><a href="/head-first-eof-lecture-notes">影片講義</a>:為影片的講義。</li></ul> <p>本系列文章正在生產中,預計於 2025 Q1 結尾釋出。</p> <h2 id="前言"><a href="#前言" class="header-anchor">#</a> 前言</h2> <p>目前已經更新的「淺入淺出 EOF」與「深入淺出 EOF」影片系列是我對目前 EOFv1 的基礎介紹,而之前被敲碗更多的是希望能以文章的方式,來闡述我對 EOF 的理解,與內容的頗析。因此我將重新以文字的方式來呈現這些內容,希望用更有結構化的方式,幫助讀者理解這些內容。</p> <h2 id="關於-eof"><a href="#關於-eof" class="header-anchor">#</a> 關於 EOF</h2> <p>EVM Object format 的第一個版本其實積累了多年來許多針對以太坊虛擬機(EVM)的改善與增強,由於近年來以太坊的發展重心並不在 EVM 本身,更多的是在共識機制、隱私保護、可擴展性等議題,如:PoS、zk-SNARKs、sharding 等等,因此 EVM Object Format 的相關提案雖然已經發展很長的時間了,但一直都沒能進到硬分叉的階段。</p> <p>等待這麼久的 EOFv1 終於不再是三環三線夢裡相見,終於在近期的 Pectra 升級裡被加入到以太坊主網中,這對於智慧合約開發的發展來說毫無疑問地是個重要的里程碑,不只會改變現在的智慧合約的底層架構,提供一套更全面的基礎建設,使得靜態分析等相關工具許多工具得以升級。</p> <p>過往都是巧婦難為無米之炊,好的開發者與工具鏈的維護者受限於以前 EVM 不夠好且限制很多,做事情綁手綁腳的,無法大展身手,如今有了 EOF 的出現將為以太坊的智慧合約開發帶來更多的可能性。</p> <h2 id="大綱"><a href="#大綱" class="header-anchor">#</a> 大綱</h2> <p>請注意,由於 EOFv1 暫時被移出硬分岔之中,因此本系列只有部分文章完成,剩餘的部分將留滯到 EOFv1 正式上線後再進行更新。</p> <p>這次的系列將會分為以下幾個章節(暫定,將於系列完成後更新):</p> <ol><li>以太坊虛擬機簡介
36<ol><li>什麼是以太坊虛擬機 (Ethereum Virtual Machine, EVM)</li> <li>什麼是以太坊虛擬機組合語言 (Ethereum Virtual Machine Assembly Language, EVM Assembly Language)</li> <li>什麼是以太坊虛擬機位元組碼 (Ethereum Virtual Machine Bytecode, EVM Bytecode)</li></ol></li> <li>智慧合約簡介
37<ol><li>什麼是智慧合約 (Smart Contract)</li> <li>如何撰寫一份智慧合約,以 Solidity 為例</li> <li>如何將智慧合約編譯成以太坊虛擬機位元組碼</li> <li>如何將智慧合約部署到以太坊主網 (Mainnet)</li> <li>如何與智慧合約互動</li></ol></li> <li>什麼是以太坊物件格式 (EVM Object Format, EOF)
38<ol><li>EIP-7692: EVM Object Format (EOF) v1 Meta</li> <li>EIP-3541: Reject new contract code starting with the 0xEF byte</li> <li>EIP-3540: EOFv1</li> <li>EIP-3670: EOF - Code Validation - Validate EOF bytecode for correctness at the time of deployment</li> <li>EIP-4200: EOF - Static relative jumps - RJUMP, RJUMPI and RJUMPV instructions with a signed immediate encoding the jump destination</li> <li>EIP-7480: EOF - Data section access instructions</li> <li>EIP-663: SWAPN, DUPN and EXCHANGE instructions</li> <li>EIP-7069: Revamped CALL instructions - Introduce EXTCALL, EXTDELEGATECALL and EXTSTATICCALL with simplified semantics</li> <li>EIP-4750: EOF - Functions - Individual sections for functions with <code>CALLF</code> and <code>RETF</code> instructions</li> <li>EIP-6206: EOF - JUMPF and non-returning functions - Introduces instruction for chaining function calls</li> <li>EIP-7620: EOF Contract Creation - Introduce <code>EOFCREATE</code> and <code>RETURNCONTRACT</code> instructions</li> <li>EIP-7698: EOF - Creation transaction - Deploy EOF contracts using creation transactions</li> <li>
38EIP-5450: EOF - Stack Validation - Deploy-time validation of stack usage for EOF functions</li></ol></li> <li>總結</li></ol></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/hydai/solidity.tw/edit/master/head-first-eof/README.md" target="_blank" rel="noopener noreferrer">Edit this page</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="last-updated"><span class="prefix">Last Updated:</span> <span class="time">2025/5/21 下午3:18:25</span></div></footer> <div class="page-nav"><p class="inner"><!----> <span class="next"><a href="/head-first-eof/10-EIP-3541.html">
39        EIP-3541 禁止以 0xEF 開頭的新智慧合約
40      </a>
41      →
42    </span></p></div> </main></div><div class="global-ui"><!----></div></div>
43    
43<script src="/assets/js/app.b4a0f8ef.js" defer></script>
43<script src="/assets/js/2.ce7b5ffa.js" defer></script>
43<script src="/assets/js/1.843ff0e7.js" defer></script>
43<script src="/assets/js/67.faa6f699.js" defer></script>
43
44  
44<script type="module" src="https://static.cloudflareinsights.com/beacon.min.js/v31edd6df95cf4e85bb4c19e7a9bdbcba1788362987495" integrity="sha512-iIg7k2xntmwu6/uSb5tpc/hySgZc4eoL31yB29W6tJFo2akwjPWcEqnCEdJvGexCL0KEQwVYv5BlowfhVz26hg==" data-cf-beacon='{"version":"2024.11.0","token":"0abeb226e6934105a8602391eb409cb6","r":1,"spa":2}' crossorigin="anonymous"></script>
44
45</body>
46</html>

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.