-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
# EIP-7702 | ||
# EIP-7702 Smart Contracts | ||
|
||
EIP-7702 Overview | ||
## Overview | ||
|
||
This document provides an overview of the implemented EIP-7702-compatible contracts. These contracts adopt a distinct upgrade mechanism compared to the previous UUPS proxy-based architecture (as seen in DeleGatorCore), aligning instead with the EIP-7702 standard. | ||
This document provides an overview of the implemented EIP-7702-compatible contracts. These contracts use a different upgrade mechanism than the previous UUPS proxy-based architecture (as implemented in DeleGatorCore) and instead follow the EIP-7702 standard. | ||
|
||
Under EIP-7702, an Externally Owned Account (EOA) can submit an authorization to map the contract code of an existing contract to that EOA. Unlike UUPS proxy-based contracts, this approach does not allow for contract initialization and does not rely on UUPS-related code. | ||
Under EIP-7702, an Externally Owned Account (EOA) can submit an authorization to map the contract code of an existing contract to that EOA. Unlike UUPS proxy-based contracts, this approach neither supports contract initialization nor relies on UUPS-related code. | ||
|
||
## Contracts | ||
|
||
1. EIP7702DeleGatorCore.sol | ||
### 1. EIP7702DeleGatorCore.sol | ||
|
||
EIP7702DeleGatorCore serves as the foundational contract for EIP-7702-compatible delegator functionality. It acts as the primary interface for interactions under EIP-7702 and implements the EIP-7821 interface, which provides a method to execute calls in different modes (e.g., single or batch). These methods can be invoked either through the entry point or directly via the EOA address. Future implementations may enable additional functionalities, such as signature validation, as outlined in EIP-7821. | ||
**EIP7702DeleGatorCore** serves as the foundational contract for EIP-7702-compatible delegator functionality with ERC-7710. It acts as the primary interface for interactions under EIP-7702 and implements the EIP-7821 interface, which provides a method to execute calls in different modes (e.g., single or batch). These methods can be invoked either through the privileged ERC-4337 EntryPoint or directly via the EOA address. | ||
|
||
This contract also integrates OpenZeppelin’s EIP712 functionality. The name and version used in the EIP712 constructor are limited to a maximum of 31 bytes. Exceeding this limit causes those variables to be stored in the contract state without namespace storage, leading to conflicts. Limiting name and version size ensures that EIP7702DeleGatorCore remains stateless by avoiding any additional storage. | ||
Future implementations may introduce additional features, such as signature validation, as outlined in EIP-7821. | ||
|
||
2. EIP7702StatelessDeleGator.sol | ||
This contract also integrates OpenZeppelin’s EIP712 functionality. The name and version used in the EIP712 constructor are limited to a maximum of 31 bytes. Exceeding this limit causes those variables to be stored in the contract state without namespace storage, leading to conflicts. Restricting the name and version size helps ensure that **EIP7702DeleGatorCore** remains stateless by avoiding additional storage. | ||
|
||
EIP7702StatelessDeleGator does not maintain signer data within the contract state. Instead, control is granted to the EOA associated with the same address, in accordance with EIP-7702. The contract can be used through the entry point, and signatures are verified via the isValidSignature() function. This stateless design offers a lightweight and secure approach to delegator functionality under the EIP-7702 standard. | ||
### 2. EIP7702StatelessDeleGator.sol | ||
|
||
**EIP7702StatelessDeleGator** does not maintain signer data within the contract state. Instead, control is granted to the EOA that shares the same address, in accordance with EIP-7702. The contract can be invoked either through the privileged ERC-4337 EntryPoint or directly via the EOA address. The signature is verified via the `isValidSignature()` function. | ||
|
||
This stateless design offers a lightweight and secure approach to delegator functionality under the EIP-7702 standard. |