Skip to content

Conversation

@egillh210
Copy link
Owner

@egillh210 egillh210 commented Sep 18, 2025

In this version I've added a updateConfig method that looks like this:

function updateConfig(uint256 newThreshold, address[] calldata ownersToAdd, address[] calldata ownersToRemove)

A UI that has a section to manage your signers is likely to have some component where users can do the following operations:

  1. Add a new key
  2. Remove an existing key
  3. Change the threshold

It makes sense to just provide the UI dev with an API that can take all of these things in one go, and not have to worry about mid-batch reverts due to ordering of operations as you do with the batched transaction of the more primitive methods (addOwner, removeOwner, setThreshold). That said, this contract still has those methods too, if we ever want to use them.

** Technical stuff **

  • This version uses the EnumerableSet4337 instead of SentinelList4337.
  • The enumerable set is a better fit for what this contract needs which is just (unordered) insertions, deletions, and lookups.
  • Deletions are more painful in the SentinelList compared to the set (having to pass a reference to prev to delete an entry)
  • All the signing methods remain exactly the same as in the original
  • Copied the tests from the OwnableValidator.t.sol files, and all tests are passing.

(also, I think this implementation has much better structure/readability than the original one)

@egillh210 egillh210 force-pushed the new-ownable-validator branch from 0ef38ab to ccfbcf5 Compare September 18, 2025 06:20
@egillh210 egillh210 force-pushed the new-ownable-validator branch from ccfbcf5 to 546ba68 Compare September 18, 2025 06:31
@egillh210 egillh210 changed the title feat: OwnableValidator with better API and without the linked list OwnableValidator with better API and without the linked list Sep 18, 2025
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