Skip to content
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

Update registry interface #40

Merged
merged 3 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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