-
Notifications
You must be signed in to change notification settings - Fork 11.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend
onlyAuthorized
to support extra functions in AccessManager (#…
…5014) Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
- Loading branch information
1 parent
b64c902
commit 52e0e3e
Showing
7 changed files
with
175 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': minor | ||
--- | ||
|
||
`AccessManager`: Allow the `onlyAuthorized` modifier to restrict functions added to the manager. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import {AccessManager} from "../access/manager/AccessManager.sol"; | ||
import {StorageSlot} from "../utils/StorageSlot.sol"; | ||
|
||
contract AccessManagerMock is AccessManager { | ||
event CalledRestricted(address caller); | ||
event CalledUnrestricted(address caller); | ||
|
||
constructor(address initialAdmin) AccessManager(initialAdmin) {} | ||
|
||
function fnRestricted() public onlyAuthorized { | ||
emit CalledRestricted(msg.sender); | ||
} | ||
|
||
function fnUnrestricted() public { | ||
emit CalledUnrestricted(msg.sender); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters