Skip to content

Commit

Permalink
refactor: reorder storage vars
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulRBerg committed Mar 8, 2023
1 parent 0eca0f3 commit d865147
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
5 changes: 3 additions & 2 deletions src/PRBProxyStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ abstract contract PRBProxyStorage is IPRBProxyStorage {
uint256 public override minGasReserve;

/// @inheritdoc IPRBProxyStorage
mapping(address envoy => mapping(address target => bool permission)) public permissions;
mapping(bytes4 method => IPRBProxyPlugin plugin) public plugins;

/// @inheritdoc IPRBProxyStorage
mapping(bytes4 method => IPRBProxyPlugin plugin) public plugins;
mapping(address envoy => mapping(address target => bool permission)) public permissions;

}
16 changes: 6 additions & 10 deletions src/interfaces/IPRBProxyStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,19 @@ import { IPRBProxyPlugin } from "./IPRBProxyPlugin.sol";
/// @title IPRBProxyStorage
/// @dev Storage contract so that it can be inherited in target contracts.
interface IPRBProxyStorage {
/*//////////////////////////////////////////////////////////////////////////
PUBLIC CONSTANT FUNCTIONS
//////////////////////////////////////////////////////////////////////////*/
/// @notice The address of the owner account or contract.
function owner() external view returns (address);

/// @notice How much gas to reserve for running the remainder of the "execute" function after the DELEGATECALL.
/// @dev This prevents the proxy from becoming unusable if EVM opcode gas costs change in the future.
function minGasReserve() external view returns (uint256);

/// @notice The address of the owner account or contract.
function owner() external view returns (address);

/// @notice Returns a boolean flag that indicates whether the envoy has permission to call the provided target
/// contract.
function permissions(address envoy, address target) external view returns (bool permission);

/// @notice Returns the address of the plugin installed for the the provided method.
/// @dev Returns the zero address if no plugin is installed.
/// @param method The signature of the method to make the query for.
function plugins(bytes4 method) external view returns (IPRBProxyPlugin plugin);

/// @notice Returns a boolean flag that indicates whether the envoy has permission to call the provided target
/// contract.
function permissions(address envoy, address target) external view returns (bool permission);
}

0 comments on commit d865147

Please sign in to comment.