openzeppelin-contracts icon indicating copy to clipboard operation
openzeppelin-contracts copied to clipboard

Extend `onlyAuthorized` to support extra functions in AccessManager

Open ernestognw opened this issue 2 years ago • 1 comments

This PR adds the ability to extend the AccessManager and use the onlyAuthorized modifer for those functions as well.

PR Checklist

  • [ ] Tests
  • [ ] Documentation
  • [ ] Changeset entry (run npx changeset add)

ernestognw avatar Apr 10 '24 20:04 ernestognw

🦋 Changeset detected

Latest commit: 5f81c0f3cc7489a2937ecbe0f6615b53002432b1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Apr 10 '24 20:04 changeset-bot[bot]

We were loosing coverage for this section:

// isTragetClosed apply to non-admin-restricted function
if (!adminRestricted && isTargetClosed(address(this))) {
    return (false, 0);
}

Turns out closing the manager is not allowed so it was unreachable. We decided to allow closing the manager so that the flag applies only to non-admin functions (i.e. functions added to the manager). This way the contract can close access to itself without getting it locked.

Should be ready

ernestognw avatar May 24 '24 20:05 ernestognw