Skip to content

Commit

Permalink
Improved EIP7702 readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzel98 committed Feb 6, 2025
1 parent dc09379 commit d0023a5
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions documents/EIP7702DeleGator.md
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.

0 comments on commit d0023a5

Please sign in to comment.