ISafeHarborAdopter
Title: ISafeHarborAdopter
Authors: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80), Integrates the SEAL Whitehat Safe Harbor (https://github.com/security-alliance/safe-harbor)
External interface for the Safe Harbor adopter facet: lets a diamond adopt the SEAL Whitehat Safe Harbor agreement on-chain (the legal half of incident response, complementing the EmergencyStop technical half).
Adoption in the SEAL SafeHarborRegistry is keyed by msg.sender, so the diamond adopts itself
ā the same self-call pattern Lattice uses for diamondCut. Because the agreement's
asset-recovery addresses and bounty terms are security-critical, all state-changing functions
are gated on SAFE_HARBOR_ADMIN_ROLE. The registry + factory addresses are configurable per
chain (never hardcoded).
Functions
adoptSafeHarbor
Adopts a pre-deployed agreement for this diamond via the configured registry.
Gated on SAFE_HARBOR_ADMIN_ROLE. The diamond calls the registry itself, so it is recorded
as the adopter. Re-adopting overwrites the prior agreement (the update path).
function adoptSafeHarbor(address agreement) external;Parameters
| Name | Type | Description |
|---|---|---|
| agreement | address | The agreement contract to adopt. |
createAndAdopt
Creates an agreement (recovery addresses + bounty terms) via the configured factory and adopts it for this diamond, in one governed call.
Gated on SAFE_HARBOR_ADMIN_ROLE. This is where the security-critical recovery addresses
are set, so the whole action is role-pinned.
function createAndAdopt(AgreementDetails calldata details, address chainValidator, address owner, bytes32 salt)
external
returns (address agreement);Parameters
| Name | Type | Description |
|---|---|---|
| details | AgreementDetails | The agreement details (per-chain recovery address, accounts, bounty terms). |
| chainValidator | address | The SEAL ChainValidator contract for this chain. |
| owner | address | The owner of the new agreement (may later update its terms). |
| salt | bytes32 | A caller-provided salt for CREATE2 uniqueness. |
Returns
| Name | Type | Description |
|---|---|---|
| agreement | address | The newly created and adopted agreement address. |
setSafeHarborRegistry
Sets or rotates the Safe Harbor registry (per-chain configuration).
Gated on SAFE_HARBOR_ADMIN_ROLE. Reverts SafeHarborAdopterZeroRegistry for a zero address.
function setSafeHarborRegistry(address registry) external;Parameters
| Name | Type | Description |
|---|---|---|
| registry | address | The Safe Harbor registry to use. |
setAgreementFactory
Sets or rotates the agreement factory (per-chain configuration).
Gated on SAFE_HARBOR_ADMIN_ROLE. Reverts SafeHarborAdopterZeroFactory for a zero address.
function setAgreementFactory(address factory) external;Parameters
| Name | Type | Description |
|---|---|---|
| factory | address | The agreement factory to use. |
safeHarborRegistry
Returns the configured Safe Harbor registry.
function safeHarborRegistry() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
agreementFactory
Returns the configured agreement factory.
function agreementFactory() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
safeHarborAgreement
Returns the agreement currently adopted by this diamond (zero if none).
function safeHarborAgreement() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
Events
SafeHarborAdopted
Emitted when the diamond adopts (or re-adopts) a Safe Harbor agreement.
event SafeHarborAdopted(address indexed agreement);Parameters
| Name | Type | Description |
|---|---|---|
| agreement | address | The adopted agreement contract. |
SafeHarborRegistrySet
Emitted when the configured Safe Harbor registry is set or rotated.
event SafeHarborRegistrySet(address indexed registry);Parameters
| Name | Type | Description |
|---|---|---|
| registry | address |
AgreementFactorySet
Emitted when the configured agreement factory is set or rotated.
event AgreementFactorySet(address indexed factory);Parameters
| Name | Type | Description |
|---|---|---|
| factory | address |
Errors
SafeHarborAdopterZeroRegistry
Thrown when a zero address is supplied as the Safe Harbor registry.
error SafeHarborAdopterZeroRegistry();SafeHarborAdopterZeroFactory
Thrown when createAndAdopt is called with no agreement factory configured, or a zero factory is supplied to setAgreementFactory.
error SafeHarborAdopterZeroFactory();SafeHarborAdopterZeroAgreement
Thrown when a zero agreement address is supplied to adoptSafeHarbor.
error SafeHarborAdopterZeroAgreement();