Git Product home page Git Product logo

light-account's Introduction

Light Account

A simple ERC-4337 compatible smart contract account with a designated owner account. Account Kit is the easiest way to integrate Light Account.

Features

Like eth-infinitism's SimpleAccount, but with the following changes:

  1. Instead of the default storage slots, uses namespaced storage to avoid clashes when switching implementations.

  2. Ownership can be transferred via transferOwnership, similar to the behavior of an Ownable contract. This is a simple single-step operation, so care must be taken to ensure that the ownership is being transferred to the correct address.

  3. Supports ERC-1271 signature validation for both validating the signature on user operations and in exposing its own isValidSignature method. This only works when the owner of LightAccount also support ERC-1271.

    ERC-4337's bundler validation rules limit the types of contracts that can be used as owners to validate user operation signatures. For example, the contract's isValidSignature function may not use any forbidden opcodes such as TIMESTAMP or NUMBER, and the contract may not be an ERC-1967 proxy as it accesses a constant implementation slot not associated with the account, violating storage access rules. This also means that the owner of a LightAccount may not be another LightAccount if you want to send user operations through a bundler.

  4. Event SimpleAccountInitialized renamed to LightAccountInitialized.

  5. Uses custom errors.

Deployments

See the current deployments in Deployments.md.

Build

forge build

Test

forge test -vvv

Deploy

The deploy script supports any wallet options provided by Foundry, including local private keys, mneumonics, hardware wallets, and remote signers. Append the chosen signing method's option to the field marked [WALLET_OPTION] in the following script command, and set the sender address in the field [SENDER_ADDRESS].

forge script script/Deploy_LightAccountFactory.s.sol:Deploy_LightAccountFactory [WALLET_OPTION] --sender [SENDER_ADDRESS]--rpc-url [RPC_URL] -vvvv --broadcast --verify

Make sure the provided RPC_URL is set to an RPC for the chain you wish to deploy on.

Generate Inspections

bash utils/inspect.sh

Static Analysis

slither .

light-account's People

Contributors

howydev avatar jaypaik avatar adamegyed avatar dphilipson avatar fangting-alchemy avatar adam-alchemy 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.