MureConfig
Inherits: EIP712Upgradeable, OwnableUpgradeable, UUPSUpgradeable, ERC165Upgradeable, Config
Author: Mure
Upgradeable configuration contract governing Mure protocol settings, signers, and app delegates.
Implements Ownable for access control, UUPSUpgradeable for efficient upgrades, ERC165Upgradeable for
interface support, and Config interface for compatibility checks.
Manages whitelisted signers for secure operations, like verifying any EIP-712 signature used within the
Mure protocol is signed by one of the whitelisted signers. Supports toggling the whitelisting of signers.
Manages app delegates for flexible app functionality. Ensures that delegate contracts being set for an
application conform to the Delegatable
interface, maintaining consistency and compatibility.
State Variables
MureConfigStorageLocation
Struct hash for storage location
keccak256(abi.encode(uint256(keccak256("mure.MureConfig")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant MureConfigStorageLocation = 0x449166636934a062783bf0dfc33be04087c7302a55ece21ecb76ecfd3ffd2100;
Functions
initialize
function initialize(string calldata name, string calldata version, address owner, address[] calldata signers)
external
initializer;
toggleWhitelistedSigner
Toggles the whitelisting of the specified address.
function toggleWhitelistedSigner(address signer_) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
signer_ | address | The address whose whitelisting is to be toggled. |
setAppDelegate
Sets the app delegate.
Set to address(0) to disable delegate
function setAppDelegate(address app, address delegate) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
app | address | address of the app |
delegate | address | address of the delegate |
setMureFeeContract
Sets the fee contract address.
function setMureFeeContract(address feeContractAddress) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
feeContractAddress | address | address of the fee contract |
getAppDelegate
Retrieves the app delegate.
function getAppDelegate(address app) external view returns (address);
Parameters
Name | Type | Description |
---|---|---|
app | address | address of the app |
getFeeContractAddress
Retrieves the fee contract address.
function getFeeContractAddress() external view returns (address);
getPoolFee
function getPoolFee(address poolApp, string calldata poolName, uint256 amount) external returns (uint256, address);
verifyMureSignature
Validates if the provided signature has been created by one of the whitelisted signers.
function verifyMureSignature(bytes32 structHash, bytes memory signature) external view;
Parameters
Name | Type | Description |
---|---|---|
structHash | bytes32 | The hashed message that was signed. |
signature | bytes | The signature to be validated. |
isWhitelistedSigner
Checks whether the specified address is whitelisted.
function isWhitelistedSigner(address address_) public view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
address_ | address | The address to check. |
_toggleWhitelistedSigner
Toggles the whitelisting of the specified address.
function _toggleWhitelistedSigner(address signer_) private;
Parameters
Name | Type | Description |
---|---|---|
signer_ | address | The address whose whitelisting is to be toggled. |
_getStorage
Retrieves the storage for the MureConfig contract.
function _getStorage() private pure returns (MureConfigStorage storage $);
_supportsDelegateInterface
Checks if delegate supports delegate interface.
function _supportsDelegateInterface(address delegate) private view returns (bool);
supportsInterface
See IERC165-supportsInterface.
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165Upgradeable, IERC165)
returns (bool);
_supportsFeeConfigInterface
Checks if fee config supports the fee config interface.
function _supportsFeeConfigInterface(address feeConfig) private view returns (bool);
_authorizeUpgrade
required by the OZ UUPS module
function _authorizeUpgrade(address) internal override onlyOwner;
Events
AppDelegated
event AppDelegated(address indexed app, address indexed delegate);
FeeContractSet
event FeeContractSet(address indexed mureFeeContract);
Structs
MureConfigStorage
Note: storage-location: erc7201:mure.MureConfig
struct MureConfigStorage {
mapping(address => uint8) signers;
mapping(address => address) delegate;
address mureFeeContract;
}