-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Implement IPRBProxyStorage interface #84
Implement IPRBProxyStorage interface #84
Conversation
feat: inherit "PRBProxyStorage" in "PRBProxy" feat: inherit "IPRBProxyStorage" in "IPRBProxyStorage" refactor: move constant functions to "PRBProxyStorage" docs: update natspec comments
I appreciate the effort, @andreivladbrg, but unfortunately, I cannot merge this proposal. The abstract contract |
In that case the mappings can be set as |
refactor: remove getter functions test: use the mappings instead of getters chore: remove unused import
As we discussed on the phone earlier, using public mappings is a fantastic idea!
Update: no deployment cost change, unfortunately. See v4.0.0-beta.3. |
/// @dev Maps plugin methods to plugin implementation. | ||
mapping(bytes4 method => IPRBProxyPlugin plugin) internal plugins; | ||
/// @inheritdoc IPRBProxyStorage | ||
mapping(address envoy => mapping(address target => bool permission)) public permissions; |
Check failure
Code scanning / Slither
Uninitialized state variables
/// @dev Maps envoys to target contracts to function selectors to boolean flags. | ||
mapping(address envoy => mapping(address target => bool permission)) internal permissions; | ||
/// @inheritdoc IPRBProxyStorage | ||
mapping(bytes4 method => IPRBProxyPlugin plugin) public plugins; |
Check failure
Code scanning / Slither
Uninitialized state variables
/// @notice The address of the owner account or contract. | ||
address public owner; | ||
/// @inheritdoc IPRBProxyStorage | ||
address public override owner; |
Check warning
Code scanning / Slither
State variables that could be declared constant
/// @notice The address of the owner account or contract. | ||
address public owner; | ||
/// @inheritdoc IPRBProxyStorage | ||
address public override owner; |
Check warning
Code scanning / Slither
State variables that could be declared immutable
/// @dev This prevents the proxy from becoming unusable if EVM opcode gas costs change in the future. | ||
uint256 public minGasReserve; | ||
/// @inheritdoc IPRBProxyStorage | ||
uint256 public override minGasReserve; |
Check warning
Code scanning / Slither
State variables that could be declared immutable
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.
LGTM, thanks a lot, Andrei!
The Slither reports are not relevant. Will merge now.
The purpose of this PR is to remove duplicated code in
PRBProxy
contract.Changes made:
IPRBProxyStorage
interfaceIPRBProxyStorage
inIPRBProxy
PRBProxyStorage
inPRBProxy
PRBProxy
toPRBProxyStorage
PRBProxy