Skip to content
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

Split ERC-7821 executor into its own contract #61

Merged
merged 10 commits into from
Jan 13, 2025
Merged

Conversation

ernestognw
Copy link
Member

Motivation

ERC-7821 might be used for EOAs with EIP-7702 to achieve batched execution without any ERC-4337 capability

@ernestognw ernestognw marked this pull request as ready for review January 7, 2025 00:35
@ernestognw ernestognw requested a review from a team as a code owner January 7, 2025 00:35
contracts/account/README.adoc Outdated Show resolved Hide resolved
contracts/account/Account.sol Outdated Show resolved Hide resolved
Comment on lines 43 to 46
function _erc7821AuthorizedExecutor(
bytes32 /* mode */,
bytes calldata /* executionData */
) internal view virtual returns (bool) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to to remove address caller from the parameter, and using msg.sender implicitelly. I have the feeling its nicer if this internal function can be called to check the permission of someone else.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to make this function composable with onlyOwner, onlyRole or restricted modifiers in the same way authorizeUpgrade is in UUPSUpgradeable. I start to think that the AccessManaged contract must expose a variant of the restricted modifier that allow passing in a custom address. Also note those modifiers generally revert and not return a boolean

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting that if we want this function to be composable with AccessManaged.restricted, then it can't have view visibility :(

}

// slither-disable-next-line write-after-write
function _emptyCalldataBytes() private pure returns (bytes calldata result) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need an helper for that at some point. (but not in this PR)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha yeah I thought the same

@ernestognw
Copy link
Member Author

ernestognw commented Jan 9, 2025

Agree with the changes @Amxx, I'm ok merging this if you approve but please check this

EDIT: Note we may want individual tests for ERC7821

Amxx
Amxx previously approved these changes Jan 13, 2025
@Amxx Amxx merged commit 120127b into master Jan 13, 2025
12 checks passed
@Amxx Amxx deleted the split-erc7821-executor branch January 13, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants