<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 苏格拉路易驴</title>
    <description>The latest articles on DEV Community by 苏格拉路易驴 (@_c70a35c573ef632148).</description>
    <link>https://dev.to/_c70a35c573ef632148</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4234410%2Fc0de142f-510e-4b47-90c2-d16e1f7317ea.png</url>
      <title>DEV Community: 苏格拉路易驴</title>
      <link>https://dev.to/_c70a35c573ef632148</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/_c70a35c573ef632148"/>
    <language>en</language>
    <item>
      <title>From bytecode to a token transfer: an EVM opcode primer</title>
      <dc:creator>苏格拉路易驴</dc:creator>
      <pubDate>Mon, 09 Nov 2026 05:06:23 +0000</pubDate>
      <link>https://dev.to/_c70a35c573ef632148/from-bytecode-to-a-token-transfer-an-evm-opcode-primer-3ec9</link>
      <guid>https://dev.to/_c70a35c573ef632148/from-bytecode-to-a-token-transfer-an-evm-opcode-primer-3ec9</guid>
      <description>&lt;p&gt;When a wallet says “send tokens,” the EVM executes a contract one instruction at a time. Understanding that gap makes transaction traces much easier to read.&lt;/p&gt;

&lt;p&gt;This is a short written companion to my opcode explainer. Start with three questions: what data enters the contract, where does execution go, and what state changes?&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Read a tiny stack program
&lt;/h2&gt;

&lt;p&gt;An opcode specifies an operation. Some instructions also consume immediate data from the bytecode. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PUSH1 0x02   // stack: [2]
PUSH1 0x03   // stack: [2, 3] (top on the right)
ADD          // stack: [5]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The corresponding bytes are &lt;code&gt;60 02 60 03 01&lt;/code&gt;. Each &lt;code&gt;PUSH1&lt;/code&gt; consumes the next byte as data; those data bytes are not separate instructions. This example is illustrative, rather than a complete deployed contract.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Follow the input into a contract
&lt;/h2&gt;

&lt;p&gt;For a standard ABI function call, calldata begins with a four-byte selector, followed by encoded arguments. The selector comes from the first four bytes of the Keccak-256 hash of the canonical function signature.&lt;/p&gt;

&lt;p&gt;The readable function name is not sent as a string for the EVM to look up. Contract bytecode handles dispatch. Instructions such as &lt;code&gt;CALLDATALOAD&lt;/code&gt;, comparisons and conditional jumps can help implement that dispatch, but the actual sequence varies with compiler settings, optimisation and contract structure. A proxy may forward execution to another implementation.&lt;/p&gt;

&lt;p&gt;That is why an ERC-20 transfer is not one universal token-transfer opcode. The token contract implements the balance checks and updates.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Separate working data from persistent state
&lt;/h2&gt;

&lt;p&gt;Keep three places distinct when reading a trace:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stack:&lt;/strong&gt; operands used by instructions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory:&lt;/strong&gt; temporary working space for the current call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage:&lt;/strong&gt; persistent contract state, accessed by instructions such as &lt;code&gt;SLOAD&lt;/code&gt; and &lt;code&gt;SSTORE&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a transfer, ask where the sender and recipient enter, where balances are read, which condition can revert, and which storage writes commit the result. The answer depends on the token implementation; do not assume every token has identical storage or behaviour.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Read gas in context
&lt;/h2&gt;

&lt;p&gt;Gas measures execution work. The gas price is the price paid per gas unit. Counting instructions alone does not give a reliable transaction cost: some costs depend on state access, memory expansion or other execution details. Use the relevant fork's rules when analysing a trace.&lt;/p&gt;

&lt;h2&gt;
  
  
  A current example: proposed SLOTDURATION
&lt;/h2&gt;

&lt;p&gt;As of November 9, 2026, Hadrien Croubois's &lt;a href="https://github.com/ethereum/EIPs/pull/12619" rel="noopener noreferrer"&gt;EIP-8484 proposal&lt;/a&gt; is an open draft. It proposes an opcode exposing the current slot duration in milliseconds, helping contracts avoid hardcoded duration assumptions. It does not itself shorten slots and is not a live mainnet instruction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Video and references
&lt;/h2&gt;

&lt;p&gt;The English video also compares the EVM with Bitcoin Script:&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/4hWJWMTyhLE" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ethereum.org/en/developers/docs/evm/opcodes/" rel="noopener noreferrer"&gt;Ethereum opcode reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.soliditylang.org/en/latest/abi-spec.html" rel="noopener noreferrer"&gt;Solidity ABI specification&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ethereum-magicians.org/t/eip-8484-slotduration-opcode/30276" rel="noopener noreferrer"&gt;SLOTDURATION proposal discussion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This written companion was drafted by an AI assistant using my video topics and the linked references.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ethereum</category>
      <category>blockchain</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
