Skip to content

Commit

Permalink
Update registry interface (#40)
Browse files Browse the repository at this point in the history
* [#39] Update registry interface

* [#39] Update registry interface

* [#39] Fix typos
  • Loading branch information
akshay-ap authored Sep 27, 2023
1 parent fd2da5a commit 19728b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
10 changes: 10 additions & 0 deletions modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ Modules extend the functionality of Accounts in different ways. Initial modules

[General Types](../manager/README.md#general-types)

## Module Types

Each module is assigned a value that represents the type of module it is. The value is a power of 2, which permits bitwise operations and efficient storage of values. The table below lists the module types and their corresponding values. A contract can be used as multiple module types.

| Module type | Value |
|------------------|-------|
| Plugin | 1 |
| Function Handler | 2 |
| Hooks | 4 |

## Plugins

Plugins allow to add any arbitrary logic to an account such as recovery mechanisms, session keys, and automations.
Expand Down
11 changes: 7 additions & 4 deletions registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ To facilitate these operations, the `Registry` MUST implement the following inte

```solidity
interface SafeProtocolRegistry {
/// @param integration Address of the integration that should be checked
/// @return listedAt MUST return the block number when the integration was listed in the registry (or 0 if not listed)
/// @return flaggedAt MUST return the block number when the integration was flagged as faulty (or 0 if not flagged)
function check(address integration) external view returns (uint256 listedAt, uint256 flaggedAt);
/**
* @param module Address of the module that should be checked
* @param data bytes32 providing more information about the module. The type of this parameter is bytes32 to provide the flexibility to the developers to interpret the value in the registry. For example, it can be moduleType and registry would then check if given address can be used as that type of module.
* @return listedAt MUST return the block number when the module was listed in the registry (or 0 if not listed)
* @return flaggedAt MUST return the block number when the module was listed in the flagged as faulty (or 0 if not flagged)
*/
function check(address module, bytes32 data) external view returns (uint64 listedAt, uint64 flaggedAt);
}
```

Expand Down

0 comments on commit 19728b3

Please sign in to comment.