From 327de4a130988ab202479373f8cc6ac9341bad61 Mon Sep 17 00:00:00 2001 From: Vectorized Date: Fri, 31 Jan 2025 12:04:23 +0000 Subject: [PATCH] Regen docs --- docs/accounts/erc7821.md | 33 +++++++++++++++++++++++++++++---- docs/utils/eip712.md | 23 +++++++++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/docs/accounts/erc7821.md b/docs/accounts/erc7821.md index 56bd791e5d..441c255ae9 100644 --- a/docs/accounts/erc7821.md +++ b/docs/accounts/erc7821.md @@ -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) @@ -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)`. @@ -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) diff --git a/docs/utils/eip712.md b/docs/utils/eip712.md index aa1cf01282..8076d95b76 100644 --- a/docs/utils/eip712.md +++ b/docs/utils/eip712.md @@ -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() @@ -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()