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.
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 AccessManager contracts #4121
Add AccessManager contracts #4121
Changes from all commits
1327b8f
b54b922
5a0fd33
ee5de96
6284768
bce3641
223e6af
eafb571
24af159
833f219
0f27739
2ac5aa1
f26c4d3
63f9393
6fecd25
589b5b1
619cc73
1b681a5
48b31c0
b078157
274c04d
082b05c
52f27c8
1285c49
5c7472a
3cc1e73
ae3482d
535ea13
68bb5fa
fa58ec5
6d76058
3447438
1d10639
d875a7b
d517d27
6d33cda
9ed1aef
6adc0d8
0624794
17ec3b6
f9210c5
a54cd10
8af9ca4
2a05bcc
5f22f2d
6a9fbed
0580198
e01e362
cb026bc
76d35da
4069781
80ffd2a
3094d0c
b3a8b1b
8a68322
eeab8cf
ca61e38
8824c31
67e33b6
5f270c7
6f7ac96
7ec5311
82402d2
27807e6
80bc88b
cf4df22
bab4d34
642e279
51aff23
6e3da66
6b56c8f
b7e3b3f
8200986
18e53e2
f94a881
cd8babd
597edc0
ee560d0
33f5ace
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I know that is restrictive, but making this immutable would save a non insignificant amount of gas.
Should we have two versions ?
In the case of proxy/clones created by a factory, would it make sens that all implementation use the same authority? I think yes.
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.
You know I hate multiple versions... 😄
The main reason why I left this as a mutable variable is because I think it can be used to freeze the permissions in a contract by moving it off of an AccessManager onto an immutable Authority. We could also implement freezing in the AccessManager itself, by having frozen contract groups in which permissions can't be altered, and whose contracts can't be moved out of that group. I felt that having mutability of the authority at the managed contract was the simpler option, but it's true that it makes it more expensive.
I'm open to this discussion though.
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 makes sense, but I also think it violates the goal of consolidation. In this way, now a managed contract may have the right to update itself without the Manager's approval.
While that still makes sense to me in some cases, I am not sure if a significant share of
is AccessManaged
contracts will want that capability when the main value proposition is having everything on the manager.My opinion here would be to make it immutable since any freezing capability can be handled by the Manager by making it
is AccessManaged
as well, and using theCLOSED
group. Maybe a bit complex, but I think users may naturally try it.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.
I don't think this is true. Only the current manager should be able to "eject" a managed contract from itself.
Note that adding a contract in the Closed or Open group doesn't freeze the permissions, because the manager retains the ability to move it outside of the group.
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.
Why not? Any
is AccessManaged
contract will have access to that storage slot even if the variable is private.Now I see that a counterargument is that accessing that storage slot has to be deliberated.
We can keep this private, but I have some bad feelings about letting the user "eject" the contract itself even if done deliberately.
I see what you meant, but a previous idea I remember we discussed is suggesting overrides like:
Not sure exactly how this can play out, but I think there might be a setup we may like to explore (eg. not reopening by default unless explicitly stated).
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.
IMO it's fine if the target contract deliberately inserts a custom-gated
_setAuthority
function call. I wouldn't expect it normally, but I can imagine some sort of emergency mechanism.