MIMOProxyGuard
As previously mentioned, the management of MIMOProxy's permissions has been delegated to the MIMOProxyGuard
, which is deployed through the Openzeppelin Clones library in the MIMOProxyFactory
for each MIMOProxy
.
Having the permission management outside the MIMOProxy
reduces the risk of storage collision, and having a separate contract for it enables easy permission clearing. In the event of an ownership transfer of the MIMOProxy
, a new owner will likely want to clear existing permissions for security reasons (e.g., malicious action contracts may have been granted permissions before the transfer). However, due to the granularity of permissions, it would be difficult and expensive to remove them one by one. With the MIMOProxyGuard
, a user can simply clone a new MIMOProxyGuard
, which will not have any permissions set.
Write Methods
initialize(address proxyFactory, address proxy)
initialize(address proxyFactory, address proxy)
Initializer function to set state variables upon cloning.
Param Name | Type | Description |
---|---|---|
| address |
|
| address | Address of the |
setPermission(address envoy, address target, bytes4 selector, bool permission)
setPermission(address envoy, address target, bytes4 selector, bool permission)
Gives or takes a permission from an envoy to call the given target contract and function selector on behalf of the owner.
Requirements :
Caller must the owner of the set
MIMOProxy
or theMIMOProxy
Param Name | Type | Description |
---|---|---|
| address | The address of the envoy account |
| address | The address of the target contract |
| bytes4 | The 4 bytes function selector on the target contract |
| bool | The boolean permission to set |
View Methods
getPermission(address envoy, address target, bytes4 selector)
getPermission(address envoy, address target, bytes4 selector)
Returns the permission for specific envoy
, target
and selector
.
Call Params
Name | Type | Description |
---|---|---|
| address | The address of the envoy account |
| target | The address of the target contract |
| selector | The 4 bytes function selector on the target contract |
Return Values
Name | Type | Description |
---|---|---|
| bool |
|
getProxy()
getProxy()
Returns the address of the MIMOProxy associated with the MIMOProxyGuard
contract.
Last updated