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

Create PermissionSplitter #300

Merged
merged 10 commits into from
Jan 19, 2024
Merged

Create PermissionSplitter #300

merged 10 commits into from
Jan 19, 2024

Conversation

nicholaspai
Copy link
Member

@nicholaspai nicholaspai commented Jun 14, 2023

This contract is a proxy that owns another contract and can split permissions by role based on what method is being called. All methods are always callable by the owner of the proxy.

@mrice32 mrice32 marked this pull request as ready for review June 20, 2023 23:05
Signed-off-by: Matt Rice <[email protected]>
Signed-off-by: Matt Rice <[email protected]>
Signed-off-by: Matt Rice <[email protected]>
@mrice32 mrice32 changed the title WIP: Create PermissionSplitter Create PermissionSplitter Jun 20, 2023
Copy link
Contributor

@james-a-morris james-a-morris left a comment

Choose a reason for hiding this comment

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

Left a few comments related to documentation and a small nit. LGTM

Comment on lines +24 to +25
// Public function!
// Note: these have two underscores in front to prevent any collisions with the target contract.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to be following the natspec for this?

It may be beneficial to include these doc comments (/** .. */ or ///) for better IDE support / readability

Comment on lines +31 to +32
// Public function!
// Note: these have two underscores in front to prevent any collisions with the target contract.
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to above


function _isAllowedToCall(address caller, bytes calldata callData) internal view virtual returns (bool) {
bytes4 selector;
if (callData.length < 4) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: would we want to store this in a constant? The 4 seems like a magic number

@nicholaspai nicholaspai merged commit d17fa59 into master Jan 19, 2024
@nicholaspai nicholaspai deleted the permissions-splitter branch January 19, 2024 17:36
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.

3 participants