]> git.ardis.lu - minimal-create2/commitdiff
Add comments to note stack state
authorArdis Lu <ardisglu@gmail.com>
Sun, 12 Jul 2026 06:30:27 +0000 (23:30 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sun, 12 Jul 2026 06:30:27 +0000 (23:30 -0700)
As per geas comment convention

create2-deployment.eas
create2.eas
minimal-contract-deployment.eas

index e90b16a501cd87dc929e763d0c8fb58935ffc9bf..3fc9d4c43dc6bba27c380e5d31a26120f46a3ae6 100644 (file)
@@ -1,12 +1,12 @@
 ;; Store create2.evm compiled bytecode into memory
-PUSH 0x365f5f375f516020360360205ff5
-PUSH0
-MSTORE
+PUSH 0x365f5f375f516020360360205ff5 ; [value]
+PUSH0                               ; [offset, value]
+MSTORE                              ; []
 
 ;; Return create2.evm compiled bytecode
-PUSH 14
-PUSH 18
-RETURN
+PUSH 14 ; [size]
+PUSH 18 ; [offset, size]
+RETURN  ; []
 
-;; This contract, compiled:
-;; 6d365f5f375f516020360360205ff55f52600e6012f3
+;;; This contract, compiled:
+;;; 6d365f5f375f516020360360205ff55f52600e6012f3
index a551a43b13559d94ba86d67da42784db4f57df03..5e8e6fd0896713160be346a7d94596d3f3794166 100644 (file)
@@ -1,22 +1,22 @@
 ;; Copy calldata to memory offset 0
-CALLDATASIZE
-PUSH0
-PUSH0
-CALLDATACOPY
+CALLDATASIZE ; [size]
+PUSH0        ; [offset, size]
+PUSH0        ; [destOffset, offset, size]
+CALLDATACOPY ; []
 
 ;; First 32 bytes of calldata is the salt
-PUSH0
-MLOAD
+PUSH0 ; [offset]
+MLOAD ; [salt]
 
 ;; Remaining calldata is the creation bytecode
-PUSH 32
-CALLDATASIZE
-SUB
+PUSH 32      ; [b, salt]
+CALLDATASIZE ; [a, b, salt]
+SUB          ; [size, salt]
 
 ;; Call CREATE2
-PUSH 32
-PUSH0
-CREATE2
+PUSH 32 ; [offset, size, salt]
+PUSH0   ; [value, offset, size, salt]
+CREATE2 ; []
 
-;; This contract, compiled:
-;; 365f5f375f516020360360205ff5
+;;; This contract, compiled:
+;;; 365f5f375f516020360360205ff5
index f01dc0589a759ac3ef6aad027b6b4f612bf3e8fc..f61e895d8c1e485b3b28e53cd02f03b3143ab87c 100644 (file)
@@ -1,13 +1,13 @@
 ;; This is the minimal bytecode that can be used to deploy a new smart contract
-CODESIZE
-PUSH0
-DUP2
-DUP2
-MSTORE8
-RETURN
+CODESIZE ; [size]
+PUSH0    ; [offset, size]
+DUP2     ; [size, offset, size]
+DUP2     ; [offset, size, offset, size]
+MSTORE8  ; [offset, size]
+RETURN   ; []
 
-;; This smart contract, compiled:
-;; 385f818153f3
+;;; This smart contract, compiled:
+;;; 385f818153f3
 
-;; When sent to EVM, this smart contract will deploy a new smart contract with bytecode:
-;; 060000000000
+;;; When sent to EVM, this smart contract will deploy a new smart contract with bytecode:
+;;; 060000000000
This page took 0.07193 seconds and 4 git commands to generate.