https://github.com/0xPolygon/account-abstraction-invoker
Modular account abstraction with EIP-3074.
https://github.com/0xPolygon/account-abstraction-invoker
Last synced: 8 months ago
JSON representation
Modular account abstraction with EIP-3074.
- Host: GitHub
- URL: https://github.com/0xPolygon/account-abstraction-invoker
- Owner: 0xPolygon
- License: mit
- Created: 2022-11-07T13:35:24.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-18T07:58:17.000Z (about 3 years ago)
- Last Synced: 2025-08-17T04:33:10.120Z (10 months ago)
- Language: TypeScript
- Homepage:
- Size: 7.8 MB
- Stars: 46
- Watchers: 5
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Account Abstraction Invoker
Example account abstraction (EIP-3074) invoker contract. For demonstration purposes only.
## About
Account Abstraction Invoker uses [`AUTH`](https://eips.ethereum.org/EIPS/eip-3074#auth-0xf6) and [`AUTHCALL`](https://eips.ethereum.org/EIPS/eip-3074#authcall-0xf7) opcodes introduced in [EIP-3074 ](https://eips.ethereum.org/EIPS/eip-3074) to delegate control of the externally owned account (EOA) to itself (smart contract). This adds more functionality to EOAs, such as batching capabilities, allowing for gas sponsoring, expirations, scripting, and beyond.
Use cases are showcased in the [tests](test/AccountAbstractionInvoker.ts). The invoker works with ✨ _all_ ✨ contracts:

[Commit](https://eips.ethereum.org/EIPS/eip-3074#understanding-commit) is EIP-712 hash of the this [structure](scripts/signing/README.md). This means the invoker inherits the security of EIP-712, in addition to following the [Secure Invoker](https://eips.ethereum.org/EIPS/eip-3074#secure-invokers) recommendations and implementing additional security measures.
## Requirements
- Network with EIP-3074
## Instructions
### Quickstart
```bash
git clone https://github.com/0xPolygon/account-abstraction-invoker
cd account-abstraction-invoker
yarn
```
### Setup
```bash
cp .env.example .env
```
- Set RPC URL in `.env`
Hardhat accounts `0` and `1` are included in `.env` for your convinience. Do not send real funds to those accounts.
- Change chain ID in `hardhat.config.ts`
### Test
Hardhat does not support EIP-3074 at the moment. All testing is done on a live network.
```bash
yarn hardhat test
```
To redeploy contracts, set environment variable `REDEPLOY=true`. Otherwise, last deployed contracts will be used.
## Acknowledgements
- This example was based on Maarten Zuidhoorn's [EIP-3074 (Batch) Transaction Invoker](https://github.com/Mrtenz/transaction-invoker)
- Reentrancy Guard by [OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-contracts)