Skip to content

Conversation

ernestognw
Copy link
Member

@ernestognw ernestognw commented May 17, 2025

Overall, this PR simplifies by removing forced design choices like having the account authorized to cancel by default. I initially thought overriding would be the best pattern, but I'm playing with this on Wizard and writing the docs (#157), and these changes would make it fit cleaner.


Core Design Change

  • Validation pattern: Changed from using overrideable boolean functions to abstract validation functions.

ERC7579Executor.sol

  • Changed _validateExecution to return only calldata (removed boolean flag)
  • Removed ERC7579InvalidExecution error

ERC7579DelayedExecutor.sol

  • Changed _validateCancel and _validateSchedule to void functions that should revert on failure. Left virtual.
  • Made validation functions abstract (implementations must be provided by derived contracts)
  • Removed ERC7579ExecutorUnauthorizedCancellation and ERC7579ExecutorUnauthorizedSchedule errors
  • Simplified validation flow in public-facing functions

@@ -15,7 +15,7 @@ const { shouldBehaveLikeERC7579Module } = require('./ERC7579Module.behavior');

async function fixture() {
// Deploy ERC-7579 validator module
const mock = await ethers.deployContract('$ERC7579MultisigExecutorMock', ['MultisigExecutor', '1']);
const mock = await ethers.deployContract('$ERC7579ExecutorMock');
Copy link
Member Author

Choose a reason for hiding this comment

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

Your smell was correct @gonzaotc 😄

@ernestognw ernestognw marked this pull request as ready for review May 17, 2025 18:51
@ernestognw ernestognw requested a review from a team as a code owner May 17, 2025 18:51
@ernestognw ernestognw merged commit b733491 into master May 17, 2025
11 checks passed
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.

1 participant