Skip to content

Commit

Permalink
Regen docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized committed Jan 31, 2025
1 parent e75c353 commit 327de4a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 4 deletions.
33 changes: 29 additions & 4 deletions docs/accounts/erc7821.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ error UnsupportedExecutionMode()

The execution mode is not supported.

### BatchOfBatchesDecodingError()

```solidity
error BatchOfBatchesDecodingError()
```

Cannot decode `executionData` as a batch of batches `abi.encode(bytes[])`.

## Execution Operations

### execute(bytes32,bytes)
Expand All @@ -55,13 +63,20 @@ function execute(bytes32 mode, bytes calldata executionData)

Executes the calls in `executionData`.
Reverts and bubbles up error if any call fails.
`executionData` encoding:
`executionData` encoding (single batch):
- If `opData` is empty, `executionData` is simply `abi.encode(calls)`.
- Else, `executionData` is `abi.encode(calls, opData)`.
See: https://eips.ethereum.org/EIPS/eip-7579
`executionData` encoding (batch of batches):
- `executionData` is `abi.encode(bytes[])`, where each element in `bytes[]`
is an `executionData` for a single batch.
Supported modes:
- `bytes32(0x01000000000000000000...)`: does not support optional `opData`.
- `bytes32(0x01000000000078210001...)`: supports optional `opData`.
- `0x01000000000000000000...`: Single batch. Does not support optional `opData`.
- `0x01000000000078210001...`: Single batch. Supports optional `opData`.
- `0x01000000000078210002...`: Batch of batches.
For the "batch of batches" mode, each batch will be recursively passed into
`execute` internally with mode `0x01000000000078210001...`.
Useful for passing in batches signed by different signers.
Authorization checks:
- If `opData` is empty, the implementation SHOULD require that
`msg.sender == address(this)`.
Expand Down Expand Up @@ -96,7 +111,17 @@ function _executionModeId(bytes32 mode)
returns (uint256 id)
```

0: invalid mode, 1: no `opData` support, 2: with `opData` support.
0: invalid mode, 1: no `opData` support, 2: with `opData` support, 3: batch of batches.

### _executeBatchOfBatches(bytes32,bytes)

```solidity
function _executeBatchOfBatches(bytes32 mode, bytes calldata executionData)
internal
virtual
```

For execution of a batch of batches.

### _execute(bytes32,bytes,Call[],bytes)

Expand Down
23 changes: 23 additions & 0 deletions docs/utils/eip712.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ bytes32 internal constant _DOMAIN_TYPEHASH =

`keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")`.

### _DOMAIN_TYPEHASH_SANS_CHAIN_ID

```solidity
bytes32 internal constant _DOMAIN_TYPEHASH_SANS_CHAIN_ID =
0x91ab3d17e3a50a9d89e63fd30b92be7f5336b03b287bb946787a83a9d62a2766
```

`keccak256("EIP712Domain(string name,string version,address verifyingContract)")`.
This is only used in `_hashTypedDataSansChainId`.

## Hashing Operations

### _domainSeparator()
Expand Down Expand Up @@ -63,6 +73,19 @@ bytes32 digest = _hashTypedData(keccak256(abi.encode(
address signer = ECDSA.recover(digest, signature);
```

### _hashTypedDataSansChainId(bytes32)

```solidity
function _hashTypedDataSansChainId(bytes32 structHash)
internal
view
virtual
returns (bytes32 digest)
```

Variant that excludes the chain ID.
Optimized for smaller bytecode size over runtime gas, as it is intended to be used sparingly.

## EIP-5267 Operations

### eip712Domain()
Expand Down

0 comments on commit 327de4a

Please sign in to comment.