EoAs are now smart contracts. That's all account abstraction is.
But what does that mean?
Right now, every single transaction in web3 stems from a single private key.
account abstraction means that not only the execution of a transaction can be arbitrarily complex computation logic as specified by the EVM, but also the authorization logic.
- A minimal EVM "Smart Wallet" using alt-mempool AA
- We even send a transactoin to the
EntryPoint.sol
- We even send a transactoin to the
- Sending your userop to the alt-mempool
- You can learn how to do this via the alchemy docs
- git
- You'll know you did it right if you can run
git --versionand you see a response likegit version x.x.x
- You'll know you did it right if you can run
- foundry
- You'll know you did it right if you can run
forge --versionand you see a response likeforge 0.2.0 (816e00b 2023-03-16T00:05:26.396218Z)
- You'll know you did it right if you can run
- foundry-zksync
- You'll know you did it right if you can run
forge-zksync --helpand you seezksyncsomewhere in the output
- You'll know you did it right if you can run
git clone https://github.com/GHexxerBrdv/EIP-4337-AA.git
cd EIP-4337-AA
forge buildfoundryup
forge testThis project of Account Abstraction will perform operatios on Token smart contract in src folder. If you have your own token deployed on anychain then just replace address of the target in /script/HelperConfig.s.sol like following.
return NetworkConfig({
.....
@> target: 0x6b233dd6d07177824634f839BB692373A76404eB,
.....
});make sure you have made .env file and save your wallet privatekey and rpc-url for test network.
source .envDeploy token contract. Here Polygon amoy is used for all the deployment.
forge script script/Token.s.sol --rpc-url $POLY --broadcastafter deploying token on test chain grab the deployment address and update the target address in /script/HelperConfig.s.sol shown above.
Now, Let's deploy our smart contract account.run the following command
forge script script/EIP4337AA.s.sol --rpc-url $POLY --private-key $PRIV --broadcastNow interact with deployed smart contract account by using /script/signedPackedUSerOperations.s.sol.
- Fund the smart account.
forge script script/signedPackedUSerOperations.s.sol:fundAA --rpc-url $POLY --private-key $PRIV --broadcast- interact with smart account.
forge script script/signedPackedUSerOperations.s.sol:signedPackedUSerOperations --rpc-url $POLY --private-key $PRIV --broadcast