Skip to content

Commit 27b0f12

Browse files
committed
update doc
1 parent 587005c commit 27b0f12

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,34 @@ It is deployed on the following chains:
2020
| Optimism | [0xdd1b6240f097cbbb9c1e7dd8dc473f92f0608816](https://optimistic.etherscan.io/address/0xdd1b6240f097cbbb9c1e7dd8dc473f92f0608816#code) |
2121
| Optimism Sepolia | [0xdd1b6240f097cbbb9c1e7dd8dc473f92f0608816](https://sepolia-optimism.etherscan.io/address/0xdd1b6240f097cbbb9c1e7dd8dc473f92f0608816#code) |
2222

23+
## EIP 7702
24+
25+
### Overview
26+
27+
EIP7702 allows EOA addresses to be treated as contract addresses. This is introduced as a new EVM transaction type which adds
28+
a new field called "authorization list".
29+
30+
Each authorization in the list makes a temporary delegation to a contract address for some EOA. This authorization must be signed by that EOA.
31+
It is temporary in that the EOA can be delegated to this contract only in transactions containing a proper authorization for it.
32+
33+
Note that the transaction itself does not need to be signed by the EOA's being delegated. So a "fee-payer" address can craft a transaction
34+
containing these authorizations for other EOA's and thus sponsor actions for them.
35+
36+
### EIP 7702 contract
37+
38+
For the authorized EOA, this contract is executed as if EOA is the contract. Meaning the contract can move funds, call other contracts for the EOA.
39+
Thus it's important that the EOA additionally signs the actions done by the contract (stored in the `data` of the transaction). This protects the EOA
40+
from the "fee-payer" address inserting arbitrary actions.
41+
42+
The input to `BasicSmartAccount` is a list of `(to address, value uint256, data bytes)` tuples, all of which are signed by the EOA. The
43+
input is simply verified and executed.
44+
45+
In summary:
46+
47+
- Any EOA can delegate to `BasicSmartAccount` contract by signing an authorization.
48+
- By delegating to `BasicSmartAccount` in a transaction, an EOA is trusting `BasicSmartAccount` to correctly execute any signed `(address, value, data)` tuples included in that same transaction.
49+
- The transaction containing the authorization list and `(address, value, data)` data itself can be signed by a separate address. This address pays the fees.
50+
2351
## Foundry
2452

2553
**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**
@@ -69,6 +97,9 @@ anvil
6997

7098
### Deploy
7199

100+
Deployment is done using deterministic `CREATE2` instruction. Meaning any address can deploy this contract to a chain (for the given `EVM_SALT`),
101+
and it will have the expected contract address. Note that if any part of the contract changes, then the contract address will also be different.
102+
72103
```shell
73104
# keccak256("BasicSmartAccount")
74105
export EVM_SALT=bdfee0231e0903cde9ca6fd75d08a500062dc3d87718f712bc6958ed697617c3

0 commit comments

Comments
 (0)