From 4b4a377e72a222a5b28a247890917865fb9e808c Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Wed, 3 Jun 2026 23:05:47 -0700 Subject: [PATCH] Gas golf 3 gas by removing `DUP6` --- README.md | 4 ++-- deployer.eas | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1b866e3..39eee29 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See example JavaScript below. Copy this code into the DevTools console in any we ```javascript const addr = (await ethereum.request({ method: 'eth_requestAccounts' }))[0]; // Current address -const deployer = '0x696130ff5f526002601ef35f52600a601634f05f5f5f5f5f855af1'; // See deployer.eas +const deployer = '0x696130ff5f526002601ef35f525f5f5f5f5f600a601634f05af1'; // See deployer.eas const burn = '100000000000000000'; // Amount of ETH to burn (in wei) // Irreversibly destroys all ETH sent @@ -46,7 +46,7 @@ const { provider } = wallets[0]; // Replace 0 with the index of the wallet you w // The remainder is the same as above except using `provider` instead of `ethereum` const addr = (await provider.request({ method: 'eth_requestAccounts' }))[0]; // Current address -const deployer = '0x696130ff5f526002601ef35f52600a601634f05f5f5f5f5f855af1'; // See deployer.eas +const deployer = '0x696130ff5f526002601ef35f525f5f5f5f5f600a601634f05af1'; // See deployer.eas const burn = '100000000000000000'; // Amount of ETH to burn (in wei) // Irreversibly destroys all ETH sent diff --git a/deployer.eas b/deployer.eas index f9b08c7..288b26d 100644 --- a/deployer.eas +++ b/deployer.eas @@ -7,19 +7,21 @@ PUSH10 0x6130ff5f526002601ef3 ; value PUSH0 ; offset MSTORE -PUSH1 10 ; size -PUSH1 22 ; offset -CALLVALUE ; value -CREATE - +;; Preload stack for CALL PUSH0 ; retSize PUSH0 ; retOffset PUSH0 ; argsSize PUSH0 ; argsOffset PUSH0 ; value -DUP6 ; address + + ;; address for CALL + PUSH1 10 ; size + PUSH1 22 ; offset + CALLVALUE ; value + CREATE + GAS ; gas CALL ;;; This smart contract, assembled: -;;; 0x696130ff5f526002601ef35f52600a601634f05f5f5f5f5f855af1 +;;; 0x696130ff5f526002601ef35f525f5f5f5f5f600a601634f05af1 -- 2.47.3