You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -17,7 +18,7 @@ This proposal defines a factory capable of deploying generic services linked to
17
18
18
19
## Motivation
19
20
20
-
Existing standards like [ERC-6551](./eip-6551.md) successfully bind smart accounts to NFTs, allowing registries to deploy accounts owned by specific token IDs. However, these standards have two key limitations:
21
+
Existing projects, like TokenBound Account, successfully bind smart accounts to NFTs, allowing registries to deploy accounts owned by specific token IDs. However, these standards have two key limitations:
21
22
22
23
1. They often require deployed contracts to implement specific interfaces for handling assets and executing transactions, effectively mandating that the deployed contract must function as an account.
23
24
2. They are restricted to NFTs, while many other contract types (particularly [ERC-4337](./eip-4337.md) accounts) could benefit from similar linking mechanisms to extend their functionalities.
@@ -30,7 +31,7 @@ This ERC proposes a more versatile factory specification that enables the deploy
30
31
31
32
-**Non-Invasive Enhancement**: Services can add functionality to existing smart accounts without modifying the underlying contract, maintaining compatibility with infrastructure like wallets and indexers.
32
33
33
-
-**Backward Compatibility**: Maintains compatibility with existing token-bound account standards (ERC-6551) while extending functionality to new use cases.
34
+
-**Backward Compatibility**: Maintains compatibility with existing token-bound account standards while extending functionality to new use cases.
34
35
35
36
-**Flexible Implementation**: The `mode` parameter enables different linkage types (with or without token IDs) while ensuring consistent deterministic addressing.
-**LINKED_ID Mode (0x000000000000000000000000)**: Used when linking a service to an NFT or any contract that requires a token/entity ID. This mode ensures compatibility with [ERC-6551](./eip-6551.md), allowing seamless integration with existing token-bound account systems.
120
+
-**LINKED_ID Mode (0x000000000000000000000000)**: Used when linking a service to an NFT or any contract that requires a token/entity ID. This mode ensures compatibility with existing token-bound account systems.
120
121
121
122
-**NO_LINKED_ID Mode (0x000000000000000000000001)**: Used when linking a service to a contract that doesn't require an ID parameter, such as an [ERC-4337](./eip-4337.md) account. In this case, the `linkedId` parameter is still present in the interface for consistency but SHOULD be set to zero if not used to store alternative data relevant to the service.
122
123
@@ -139,6 +140,8 @@ ERC-1167 Footer (15 bytes)
139
140
<linkedId (uint256)> (32 bytes)
140
141
```
141
142
143
+
**Total bytecode size: 183 bytes**
144
+
142
145
Linked services SHOULD implement the `IERC7656Service` interface:
143
146
144
147
```solidity
@@ -174,31 +177,29 @@ The `mode` parameter uses 12 bytes instead of a simple boolean flag because the
174
177
175
178
### Deterministic Addressing
176
179
177
-
[ERC-7656](./eip-7656.md) follows the deterministic addressing pattern established by [ERC-6551](./eip-6551.md), appending immutable data to the contract bytecode rather than storing it in contract storage. This ensures that:
180
+
[ERC-7656](./eip-7656.md) follows a deterministic addressing pattern, appending immutable data to the contract bytecode rather than storing it in contract storage. This ensures that:
178
181
179
182
1. Linked services have predictable addresses that can be computed off-chain
180
183
2. The factory remains stateless, reducing gas costs
181
184
3. Linked services can be deployed on-demand or even referenced before deployment
182
185
183
-
### Compatibility with [ERC-6551](./eip-6551.md)
184
-
185
-
The `LINKED_ID` mode (0x000000000000000000000000) maintains byte-for-byte compatibility with [ERC-6551](./eip-6551.md) token bound accounts. This intentional design ensures that applications built for [ERC-6551](./eip-6551.md) can work seamlessly with [ERC-7656](./eip-7656.md) services in this mode without requiring any modifications.
186
-
187
186
### Generic Linking Mechanism
188
187
189
188
Unlike standards that enforce specific interfaces or behaviors on linked contracts, [ERC-7656](./eip-7656.md) remains agnostic about the implementation details of linked services. This deliberate design choice allows developers maximum flexibility to create specialized services while maintaining a consistent deployment and ownership model.
190
189
191
190
192
191
## Backwards Compatibility
193
192
194
-
[ERC-7656](./eip-7656.md) maintains compatibility with [ERC-6551](./eip-6551.md) when used with the `LINKED_ID` mode (0x000000000000000000000000). This ensures that existing applications and infrastructure supporting token-bound accounts can continue operating without modification.
193
+
[ERC-7656](./eip-7656.md) maintains compatibility with token bound accounts when used with the `LINKED_ID` mode (0x000000000000000000000000). This ensures that existing applications and infrastructure supporting token-bound accounts can continue operating without modification.
195
194
196
195
For contracts using the `NO_LINKED_ID` mode (0x000000000000000000000001), specialized interfaces may be required, but the core factory mechanism remains consistent.
197
196
198
197
199
198
## Reference Implementation
200
199
201
-
See [`ERC7656Factory.sol`](../assets/eip-7656/ERC7656Factory.sol) for an example implementation of `IERC7656Factory`. For convenience, the reference implementation will be deployed at `erc7656.eth` on primary mainnets and selected testnets.
200
+
See [`ERC7656Factory.sol`](../assets/erc-7656/ERC7656Factory.sol) for an example implementation of `IERC7656Factory`.
201
+
202
+
For convenience, the bytecode of the reference implementation has been deployed at `0x76565d90eeB1ce12D05d55D142510dBA634a128F` on Ethereum mainnet, and will be later deployed at the same address to all primary mainnets and selected testnets.
202
203
203
204
An example of implementation of `IERC7656Service`:
0 commit comments