Giter VIP home page Giter VIP logo

minimalaccount's Introduction

MinimalAccount

The most gas optimized ERC-4337 account - written in Huff

Note

These contracts are unaudited and are not recommended for use in production.

The main usage of these contracts is to benchmark other ERC-4337 accounts against the lowest possible gas cost for an account.

Gas calculations (as of Sep 19, 2023)

Creation Native transfer ERC20 transfer Total
MinimalAccount 221508 93430 82169 397107
SimpleAccount 410061 97690 86754 594505
Biconomy 296892 100780 89577 487249
Etherspot 305769 100091 89172 495032
Kernel v2.0 366662 106800 95877 569339
Kernel v2.1 291413 103240 92289 486942
Kernel v2.1-lite 256965 97331 86121 440417

Gas difference between MinimalAccount and cheapest account in each category:

Creation Native transfer ERC20 transfer Total
MA cheaper by 35457 3901 3952 43310

Calculations are based on ZeroDev's AA Benchmark

Using this repo

  1. Clone this repo
git clone https://github.com/kopy-kat/MinimalAccount.git
cd MinimalAccount
  1. Install dependencies

Once you've cloned and entered into your repository, you need to install the necessary dependencies. In order to do so, simply run:

forge install
  1. Build & Test

To build and test your contracts, you can run:

forge build
forge test

For more information on how to use Foundry, check out the Foundry Github Repository and the foundry-huff library repository.

Todo

  • Dynamically splice owner account into bytecode
  • Remove unnecessary jumps
  • Upgrade to Solidity 0.8.20 and replace push1 0x00 with push0
  • Implement executeBatch

License

The Unlicense

Acknowledgements

Disclaimer

These smart contracts are being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the user interface or the smart contracts. They have not been audited and as such there can be no assurance they will work as intended, and users may experience delays, failures, errors, omissions, loss of transmitted information or loss of funds. The creators are not liable for any of the foregoing. Users should proceed with caution and use at their own risk.

minimalaccount's People

Contributors

kopy-kat avatar leekt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.