-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ERC: Minimal Batch Executor Interface #726
base: master
Are you sure you want to change the base?
Add ERC: Minimal Batch Executor Interface #726
Conversation
ERCS/erc-9999.md
Outdated
|
||
/// @dev Executes the `calls` and returns the results. | ||
/// Reverts and bubbles up error if any call fails. | ||
function execute(Call[] calldata calls, bytes calldata authData) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider using ERC7579 execute function here.
function execute(bytes32 mode, bytes calldata executionCalldata) external;
would be a shame if wallets need to integrate another pattern.
the authData
could be just appended bytes in calldata
to perform the signature check, and ERC-4337 based implementations of this ERC could utilize the same function signature with access control onlyEntryPoint
while handling the signature validation in validateUserOp
this would also allow for implementations to utilize try-batched executions or delegatecalls as this is covered by the 7579 execution modes
I admit, appending the authData
to the calldata is not the prettiest, but would yield great compatibility
minimalBatchExecutorVersion
could also be ERC-7579's supportsExecutionMode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This standard will only support regular calls, in an atomic fashion. Delegatecalls won't be supported.
If users want to make multiple try transactions, they can just sign multiple transactions with parallel nonces.
I think it will not be too hard for frontends that have already supported 7579 to support this ERC. They will still need to craft the array of executions.
Side question: Do we actually need ERC-165 for ERC-7579? I would strongly prefer to never use ERC-165.
Converted to use 7579 style. |
…rized/ERCs into minimal-batch-executor-erc
Lemme fix the 7579 issue first. If it is not feasible to be fixed, i'll go back to the original. |
…rized/ERCs into minimal-batch-executor-erc
Reverting back to original interface. |
Ok, let's merge. This should be good enough. |
ERCS/erc-7821.md
Outdated
results = new bytes[](calls.length); | ||
for (uint256 i; i < calls.length; ++i) { | ||
Call calldata c = calls[i]; | ||
results[i] = _execute(c.target, c.value, c.data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: consider adding a special address (e.g., address(0)
) where the contract would execute the transaction to self. This is a neat optimization when you must batch multiple calls on the account contract itself.
This is implemented in Safe's MultiSend contract: https://github.com/safe-global/safe-smart-account/blob/7f79aaf05c33df71d9cb687f0bc8a73fa39d25d5/contracts/libraries/MultiSend.sol#L50C17-L50C57
Co-authored-by: Andrew B Coathup <[email protected]>
…rized/ERCs into minimal-batch-executor-erc
No description provided.