Simplify permission model for smart accounts #422
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
When using the
AccountPermissions
permission model for smart wallets on testnet (via the SDK and dashboard), we used it in a naturally simpler way than what the contract allows. This PR simplifies the permission model to match the natural way in which it was actually used on testnets.Currently,
AccountPermissions
provides role based permissions. You can create abytes32 role
and associate a set of permissions with that role. This same role can then be assigned to any number of addresses.In practice, we ended up assigning unique roles for each address that was granted permissions to use the smart account. No one role was used for many addresses at all. In this PR, we simplify
AccountPermissions
to only support setting unique permissions for each address being granted permissions to use the smart account. This simplifies the contract's data structures and overall API.