Skip to content

Allows fee payment in Wrapped native token or native asset and gives full flexibility and potentially parallel execution. Users can use arbitrary nonces

Notifications You must be signed in to change notification settings

vishwa7dcap786/account-abstraction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This repository contains the tools and resources for working with ERC-4337 Account Abstraction smart contracts. This includes the code for the singleton Executor contract.

This singleton Executor contract also supports paying gas fee in ERC20 - Wrapped ether. This needs to be deployed only with the address of wrapped native token. This doesn't support other erc20 tokens.

And this Executor contract supports Users to use any nonce in any order and enables full flexibility and potentially parallel execution. Users can use arbitrary nonces, no need to be sequential. User can use getLeastUnusedNonce() to get the lowest unused nonce.

Overview

Account abstraction allows users to interact with Ethereum using smart contract wallets instead of EOAs, without compromising decentralization, providing benefits like:

  • Social recovery
  • Batched transactions
  • Sponsored transactions (gas abstraction)
  • Signature abstraction
  • Advanced authorization logic

Repository Structure

Core Components

  • EntryPoint Contract (src/Executor.sol): The central contract that processes UserOperations
  • SmartAccount (src/SmartAccount.sol): Base implementation for smart contract accounts
  • BasePaymaster (src/BasePaymaster.sol): Helper class for creating a paymaster
  • NonceManager (src/NonceManager.sol): Handles nonce management for accounts
  • Helpers (src/Helpers.sol): Common constants and helper functions

Developer setup

Installation

Clone the repository:

git clone https://github.com/vishwa7dcap786/account-abstraction.git
cd account-abstraction
curl -L https://foundry.paradigm.xyz | bash
forge init

Compilation:

forge compile

Testing:

forge test

Scripts:

run a local blockchain

anvil

new terminal

steps:

1.deploy().
2.update the contract address state variables with deployed contract address
3.transferAmount(0 0r 1) - mode 0 for native eth and mode 1 for wrapped eth.
4.execute()
forge script script/Counter.s.sol:CounterScript --rpc-url http://127.0.0.1:8545 --broadcast --via-ir -vvvv

About

Allows fee payment in Wrapped native token or native asset and gives full flexibility and potentially parallel execution. Users can use arbitrary nonces

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published