For the complete documentation index, see llms.txt. This page is also available as Markdown.

Contracts

Below is a clear overview of each major CryptoLegacy smart contract: its purpose, inheritance, key methods, events, and external interactions.

Table of Contents

BeneficiaryRegistry

Purpose

BeneficiaryRegistry maintains role-indexed registries that map hashed participant identifiers to CryptoLegacy contract addresses.

Inheritance

  • IBeneficiaryRegistry

  • BuildManagerOwnable

Key Methods

All Functions

Events

Errors

Access / Roles

  • setCryptoLegacyBeneficiary: registered CryptoLegacy caller with approved build manager (_checkBuildManagerValid)

  • setCryptoLegacyGuardian: registered CryptoLegacy caller with approved build manager (_checkBuildManagerValid)

  • setCryptoLegacyOwner: registered CryptoLegacy caller with approved build manager (_checkBuildManagerValid)

  • setCryptoLegacyRecoveryAddresses: registered CryptoLegacy caller with approved build manager (_checkBuildManagerValid)

Interacts With

  • ArbSys

None.

BuildManagerOwnable

Purpose

BuildManagerOwnable governs the allowlist of build-manager accounts used to authorize maintenance actions on CryptoLegacy contracts.

Inheritance

  • IBuildManagerOwnable

  • Ownable

Key Methods

All Functions

Events

Errors

Access / Roles

  • setBuildManager: onlyOwner

Interacts With

  • ICryptoLegacy

  • ICryptoLegacyBuildManager

None.

Create3Factory

Purpose

Create3Factory provides deterministic contract deployment using CREATE3 salts with predictable target addresses.

Inheritance

  • Ownable

Key Methods

  • build(...) - Deploys a contract deterministically via CREATE3 using a salt and raw bytecode.

  • computeAddress(...) - Predicts the deterministic CREATE3 address for a given salt without deploying.

All Functions

  • constructor(...) - Initializes the factory and assigns ownership to the provided owner.

  • build(...) - Deploys a contract deterministically via CREATE3 using a salt and raw bytecode.

  • computeAddress(...) - Predicts the deterministic CREATE3 address for a given salt without deploying.

Events

Errors

None.

Access / Roles

  • build: onlyOwner

Interacts With

  • LibCreate3

None.

CryptoLegacy

Purpose

CryptoLegacy is the primary protocol contract that composes protocol plugins and exposes the diamond-based extension surface.

Inheritance

  • CryptoLegacyDiamondBase

  • CryptoLegacyOwnable

Key Methods

All Functions

Events

Errors

Access / Roles

  • replacePlugin: onlyOwner

  • addPluginList: onlyOwner

  • removePluginList: onlyOwner

Interacts With

  • ICryptoLegacy

  • ICryptoLegacyBuildManager

  • ICryptoLegacyPlugin

  • LibCryptoLegacy

  • LibCryptoLegacyPlugins

  • LibDiamond

None.

CryptoLegacyBuildManager

Purpose

CryptoLegacyBuildManager orchestrates protocol-instance deployment, fee collection, and registry wiring for new protocol instances.

Inheritance

  • ICryptoLegacyBuildManager

  • IERC721Receiver

  • Ownable

Key Methods

All Functions

Events

Errors

Access / Roles

  • setRegistries: onlyOwner

  • setFactory: onlyOwner

  • setSupplyLimit: onlyOwner

  • setExternalLens: onlyOwner

  • withdrawFee: onlyOwner

  • transferStuckNft: onlyOwner

Interacts With

  • IBeneficiaryRegistry

  • ICryptoLegacy

  • ICryptoLegacyFactory

  • IFeeRegistry

  • ILockChainGate

  • ILifetimeNft

  • IPluginsRegistry

  • CryptoLegacyBasePlugin

None.

CryptoLegacyDiamondBase

Purpose

CryptoLegacyDiamondBase provides shared diamond base behavior, including selector checks and static-call validation helpers.

Inheritance

  • ICryptoLegacyDiamondBase

  • DiamondLoupeFacet

Key Methods

  • staticCallChecker(...) - Self-call probe used by the fallback to detect whether the current context is a static call.

All Functions

  • staticCallChecker() - Self-call probe used by the fallback to detect whether the current context is a static call.

  • fallback() - Diamond fallback that routes unknown selectors to the correct facet via delegatecall, caching the facet address on non-static calls.

Events

Errors

Access / Roles

  • staticCallChecker: self-call only (msg.sender == address(this))

Interacts With

  • ICryptoLegacy

  • LibCryptoLegacy

  • LibCryptoLegacyPlugins

  • LibDiamond

None.

CryptoLegacyExternalLens

Purpose

CryptoLegacyExternalLens aggregates read-only status and portfolio views across CryptoLegacy-related components.

Inheritance

None.

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

  • IBeneficiaryRegistry

  • ICryptoLegacy

  • ICryptoLegacyLens

  • ITrustedGuardiansPlugin

  • CryptoLegacyBasePlugin

  • LensPlugin

None.

CryptoLegacyFactory

Purpose

CryptoLegacyFactory creates new CryptoLegacy instances and controls which operators can trigger deployments.

Inheritance

  • ICryptoLegacyFactory

  • Ownable

Key Methods

All Functions

Events

Errors

Access / Roles

  • setBuildOperator: onlyOwner

Interacts With

  • LibCryptoLegacyDeploy

None.

CryptoLegacyOwnable

Purpose

CryptoLegacyOwnable implements ownership-transfer and pause controls shared by protocol contracts.

Inheritance

  • ICryptoLegacyOwnable

Key Methods

All Functions

Events

Errors

Access / Roles

  • setPause: onlyOwner

  • acceptOwnership: pendingOwner only

Interacts With

  • ICryptoLegacy

  • LibCryptoLegacy

  • LibDiamond

None.

FeeRegistry

Purpose

FeeRegistry stores referral code metadata, fee percentages, and beneficiary split configuration for payment flows.

Inheritance

  • LockChainGate

  • IFeeRegistry

Key Methods

All Functions

Events

Errors

Access / Roles

  • initialize: initializer

  • setCodeOperator: onlyOwner

  • setSupportedRefCodeInChains: onlyOwner

  • setFeeBeneficiaries: onlyOwner

  • setDefaultPct: onlyOwner

  • setRefererSpecificPct: onlyOwner

  • setContractCaseFee: onlyOwner

  • takeFee: nonReentrant

  • withdrawAccumulatedFee: nonReentrant

  • withdrawReferralAccumulatedFee: nonReentrant

  • createCustomCode: nonReentrant

  • createCode: nonReentrant

  • updateCrossChainsRef: nonReentrant

  • crossCreateCustomCode: nonReentrant

  • crossUpdateCustomCode: nonReentrant

  • changeCodeReferrer: nonReentrant

  • changeRecipientReferrer: nonReentrant

Interacts With

  • ILifetimeNft

None.

LegacyMessenger

Purpose

LegacyMessenger records recipient-linked legacy messages and emits block-indexed message events for off-chain tracking.

Inheritance

  • ILegacyMessenger

  • BuildManagerOwnable

Key Methods

All Functions

Events

Errors

Access / Roles

  • sendMessagesTo: registered CryptoLegacy caller with approved build manager (_checkBuildManagerValid)

Interacts With

  • ArbSys

None.

LifetimeNft

Purpose

LifetimeNft implements the protocol NFT with controlled minting and configurable metadata base URI.

Inheritance

  • ILifetimeNft

  • ERC721Enumerable

  • Ownable

Key Methods

All Functions

Events

Errors

Access / Roles

  • setBaseUri: onlyOwner

  • setMinterOperator: onlyOwner

Interacts With

None.

None.

LockChainGate

Purpose

LockChainGate manages lifetime-NFT lock/unlock flows and cross-chain routing parameters for bridge operations.

Inheritance

  • Ownable

  • ReentrancyGuardUpgradeable

  • ILockChainGate

Key Methods

All Functions

Events

Errors

Access / Roles

  • _initializeLockChainGate: initializer

  • setLockOperator: onlyOwner

  • setDebridgeGate: onlyOwner

  • setDebridgeNativeFee: onlyOwner

  • setDestinationChainContract: onlyOwner

  • setSourceChainContract: onlyOwner

  • setSourceAndDestinationChainContract: onlyOwner

  • setLockPeriod: onlyOwner

  • setReferralCode: onlyOwner

  • setCustomChainId: onlyOwner

  • lockLifetimeNft: nonReentrant

  • crossLockLifetimeNft: nonReentrant

  • lockLifetimeNftToChains: nonReentrant

  • unlockLifetimeNft: nonReentrant

  • unlockLifetimeNftFromChain: nonReentrant

  • crossUnlockLifetimeNft: nonReentrant

  • crossUpdateNftOwner: nonReentrant

  • approveLifetimeNftTo: nonReentrant

  • transferLifetimeNftTo: nonReentrant

  • updateNftOwnerOnChainList: nonReentrant

Interacts With

  • Flags

  • ICallProxy

  • IDeBridgeGate

  • ILifetimeNft

None.

MultiPermit

Purpose

MultiPermit batches token permit and approval calls to reduce transaction overhead for treasury flows.

Inheritance

None.

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

PluginsRegistry

Purpose

PluginsRegistry tracks approved plugins and versioned plugin metadata used by protocol composition logic.

Inheritance

  • IPluginsRegistry

  • Ownable

Key Methods

All Functions

Events

Errors

None.

Access / Roles

  • addPlugin: onlyOwner

  • addPluginDescription: onlyOwner

  • removePlugin: onlyOwner

Interacts With

  • ArbSys

  • ICryptoLegacyPlugin

None.

ProxyBuilder

Purpose

ProxyBuilder deploys proxy instances and binds them to the configured proxy-admin authority.

Inheritance

  • Ownable

Key Methods

All Functions

Events

Errors

Access / Roles

  • setProxyAdmin: onlyOwner

  • build: onlyOwner

Interacts With

  • LibCreate3

None.

ProxyBuilderAdmin

Purpose

ProxyBuilderAdmin centralizes administrative controls for deployed beneficiary proxies in the protocol deployment stack.

Inheritance

  • ProxyAdmin

Key Methods

None.

All Functions

  • constructor(...) - Initializes the ProxyBuilderAdmin and sets the initial owner.

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

SignatureRoleTimelock

Purpose

SignatureRoleTimelock enforces role-based timelocks and scheduled execution for restricted function calls.

Inheritance

  • ISignatureRoleTimelock

  • AccessControl

  • ReentrancyGuard

Key Methods

All Functions

Events

Errors

Access / Roles

  • setMaxExecutionPeriod: onlyCurrentAddress

  • setRoleAccounts: onlyCurrentAddress

  • addSignatureRoleList: onlyCurrentAddress

  • removeSignatureRoleList: onlyCurrentAddress

  • scheduleCallList: nonReentrant

  • executeCallList: nonReentrant

  • cancelCallList: nonReentrant, onlyRole

Interacts With

None.

None.

WethUnwrapIWETH (Interface)

Purpose

WethUnwrapIWETH defines the minimal WETH transfer and withdrawal calls required by the WethUnwrap helper contract.

Inheritance

None.

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

WethUnwrap

Purpose

WethUnwrap is a helper contract that pulls WETH from the caller, unwraps it into native ETH, and forwards the ETH back to the caller through a callback payload. It exists to support plugin flows that need native ETH for downstream protocol actions while keeping the unwrap logic isolated.

Inheritance

None.

Key Methods

  • unwrap_weth(...) - Pulls WETH from the caller, unwraps it to ETH, and immediately forwards the ETH back with callback calldata.

All Functions

  • constructor(...) - Stores the canonical WETH contract address used for unwrap operations.

  • unwrap_weth(...) - Pulls WETH from the caller, unwraps it to ETH, and immediately forwards the ETH back with callback calldata.

  • receive(...) - Accepts native ETH released by the WETH contract during an unwrap.

Events

None.

Errors

Access / Roles

None.

Interacts With

  • WethUnwrapIWETH

None.

ArbSys (Interface)

Purpose

ArbSys defines the Arbitrum system interface used for chain-specific context queries.

Inheritance

None.

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

Flags (Library)

Purpose

Flags centralizes bit-flag read/write helpers used by storage-efficient modules.

Inheritance

None.

Key Methods

  • getFlag(...) - Tests whether a specific bit is enabled inside a packed flags word.

  • setFlag(...) - Returns a new flags word with a specific bit set or cleared.

All Functions

  • getFlag(...) - Tests whether a specific bit is enabled inside a packed flags word.

  • setFlag(...) - Returns a new flags word with a specific bit set or cleared.

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

IAaveV3Pool (Interface)

Purpose

IAaveV3Pool defines the subset of Aave V3 pool calls used by the beneficiary-supply plugin for supply, withdrawal, and reserve-data access.

Inheritance

None.

Key Methods

  • supply(...) - Supplies an asset into the Aave V3 pool on behalf of a target account.

  • withdraw(...) - Withdraws a reserve asset from Aave V3 to a recipient address.

All Functions

  • supply(...) - Supplies an asset into the Aave V3 pool on behalf of a target account.

  • withdraw(...) - Withdraws a reserve asset from Aave V3 to a recipient address.

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

IAaveV3PoolDataProvider (Interface)

Purpose

IAaveV3PoolDataProvider exposes reserve-token metadata used by the Aave beneficiary-supply plugin to discover the aToken corresponding to an underlying asset.

Inheritance

None.

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

IBeneficiaryRegistry (Interface)

Purpose

IBeneficiaryRegistry specifies the external registry API for beneficiary/owner/guardian/recovery indexing.

Inheritance

None.

Key Methods

All Functions

Events

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

IBuildManagerOwnable (Interface)

Purpose

IBuildManagerOwnable defines owner-controlled build-manager allowlist operations.

Inheritance

None.

Key Methods

None.

All Functions

None.

Events

Errors

Access / Roles

None.

Interacts With

None.

None.

ICallProxy (Interface)

Purpose

ICallProxy defines the cross-chain call relay interface and sender-submission metadata accessors.

Inheritance

None.

Key Methods

All Functions

  • submissionChainIdFrom() - Returns the source chain ID for the current cross-chain submission.

  • submissionNativeSender() - Returns the original sender (encoded as bytes) of the cross-chain submission.

  • call(...) - Executes a cross-chain call with optional native asset transfer.

  • callERC20(...) - Executes a cross-chain call that also transfers ERC20 tokens.

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

ICryptoLegacy (Interface)

Purpose

ICryptoLegacy defines the primary protocol storage and operational interface consumed by plugins and managers.

Inheritance

None.

Key Methods

  • buildManager(...) - Returns the build manager contract associated with the CryptoLegacy instance.

  • owner(...) - Returns the current diamond owner address.

All Functions

  • buildManager() - Returns the build manager contract associated with the CryptoLegacy instance.

  • owner() - Returns the current diamond owner address.

Events

Errors

Access / Roles

None.

Interacts With

None.

None.

ICryptoLegacyBuildManager (Interface)

Purpose

ICryptoLegacyBuildManager defines the deployment, fee-payment, and registry setup interface for protocol-instance creation.

Inheritance

None.

Key Methods

All Functions

Events

Errors

Access / Roles

None.

Interacts With

None.

None.

ICryptoLegacyDiamondBase (Interface)

Purpose

ICryptoLegacyDiamondBase defines base diamond helper calls shared by core protocol contracts.

Inheritance

None.

Key Methods

None.

All Functions

None.

Events

Errors

Access / Roles

None.

Interacts With

None.

None.

ICryptoLegacyFactory (Interface)

Purpose

ICryptoLegacyFactory defines protocol-instance deployment and build-operator management functions.

Inheritance

None.

Key Methods

All Functions

Events

Errors

Access / Roles

None.

Interacts With

None.

None.

ICryptoLegacyLens (Interface)

Purpose

ICryptoLegacyLens defines read-only lens calls for protocol status, messages, and beneficiary data.

Inheritance

None.

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

ICryptoLegacyOwnable (Interface)

Purpose

ICryptoLegacyOwnable defines ownership and pause control calls for CryptoLegacy-compatible modules.

Inheritance

None.

Key Methods

None.

All Functions

None.

Events

Errors

Access / Roles

None.

Interacts With

None.

None.

ICryptoLegacyPlugin (Interface)

Purpose

ICryptoLegacyPlugin defines the plugin ABI for selectors, setup hooks, and plugin metadata.

Inheritance

None.

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

ICryptoLegacyUpdaterPlugin (Interface)

Purpose

ICryptoLegacyUpdaterPlugin defines updater-plugin behavior for role and state migration operations.

Inheritance

None.

Key Methods

None.

All Functions

None.

Events

Errors

Access / Roles

None.

Interacts With

None.

None.

IDeBridgeGate (Interface)

Purpose

IDeBridgeGate defines bridge-gateway calls for message delivery and token movement across chains.

Inheritance

None.

Key Methods

  • isSubmissionUsed(...) - Reports whether a deBridge submission has already been claimed.

  • getNativeInfo(...) - Returns the origin chain metadata for a wrapped asset.

  • callProxy(...) - Exposes the call proxy contract used to execute bridged payloads on the destination chain.

  • globalFixedNativeFee(...) - Returns the global base native fee charged for bridging operations.

  • globalTransferFeeBps(...) - Returns the global percentage fee (in basis points) applied to bridged transfers.

  • sendMessage(...) - Submits a cross-chain message to a destination contract without transferring assets.

  • sendMessage(...) - Submits a cross-chain message with explicit flags and referral code.

  • send(...) - Bridges assets from the native chain to a destination chain.

All Functions

Events

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

IDiamondCut (Interface)

Purpose

IDiamondCut defines facet-cut structures and upgrade entrypoints for the diamond proxy standard.

Inheritance

None.

Key Methods

  • diamondCut(...) - External entry point for applying diamond facet cuts with optional initialization.

All Functions

  • diamondCut(...) - External entry point for applying diamond facet cuts with optional initialization.

Events

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

IDiamondLoupe (Interface)

Purpose

IDiamondLoupe defines introspection views for facets, selectors, and interface support.

Inheritance

None.

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

IFeeRegistry (Interface)

Purpose

IFeeRegistry defines referral and fee lookup APIs used by builders and plugins.

Inheritance

None.

Key Methods

All Functions

Events

Errors

Access / Roles

None.

Interacts With

None.

None.

ILockChainGate (Interface)

Purpose

ILockChainGate defines lock-gate operations for locking, unlocking, and bridge-synchronized NFT state.

Inheritance

None.

Key Methods

All Functions

Events

Errors

Access / Roles

None.

Interacts With

None.

None.

ILegacyMessenger (Interface)

Purpose

ILegacyMessenger defines message-sending and retrieval calls for legacy communication records.

Inheritance

None.

Key Methods

None.

All Functions

None.

Events

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

ILido (Interface)

Purpose

ILido defines the subset of Lido staking and share-transfer calls required by integrations.

Inheritance

None.

Key Methods

  • submit(...) - Stakes ETH into Lido and mints stETH, crediting the caller.

  • transferShares(...) - Transfers a specified amount of Lido shares to another address.

  • transferSharesFrom(...) - Transfers Lido shares from one address to another using allowance semantics.

  • sharesOf(...) - Returns the number of Lido shares owned by an account.

All Functions

  • submit(...) - Stakes ETH into Lido and mints stETH, crediting the caller.

  • transferShares(...) - Transfers a specified amount of Lido shares to another address.

  • transferSharesFrom(...) - Transfers Lido shares from one address to another using allowance semantics.

  • sharesOf(...) - Returns the number of Lido shares owned by an account.

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

ILidoWithdrawalQueue (Interface)

Purpose

ILidoWithdrawalQueue defines the withdrawal-request and claim calls used by the Lido staking beneficiary plugin. It standardizes request and claim entry points so Lido-side exits can be orchestrated through a stable interface.

Inheritance

None.

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

ILifetimeNft (Interface)

Purpose

ILifetimeNft defines NFT minting and metadata administration calls required by protocol modules.

Inheritance

  • IERC721Enumerable

Key Methods

All Functions

Events

None.

Errors

Access / Roles

None.

Interacts With

None.

None.

IPermit2 (Interface)

Purpose

IPermit2 defines the token-allowance approval call used by the Uniswap V4 beneficiary-swap plugin before handing control to the Universal Router.

Inheritance

None.

Key Methods

  • approve(...) - Grants a spender an ERC20 transfer allowance through Permit2.

All Functions

  • approve(...) - Grants a spender an ERC20 transfer allowance through Permit2.

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

IPluginsRegistry (Interface)

Purpose

IPluginsRegistry defines plugin registration and plugin-metadata query functions.

Inheritance

None.

Key Methods

All Functions

Events

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

ISafeMinimalMultisig (Interface)

Purpose

ISafeMinimalMultisig defines proposal lifecycle and signature-voting structures for multisig flows.

Inheritance

None.

Key Methods

None.

All Functions

None.

Events

Errors

Access / Roles

None.

Interacts With

None.

None.

ISignatureRoleTimelock (Interface)

Purpose

ISignatureRoleTimelock defines role assignment, signature mapping, and scheduled-call state for timelocked execution.

Inheritance

None.

Key Methods

None.

All Functions

None.

Events

Errors

Access / Roles

None.

Interacts With

None.

None.

IStataToken (Interface)

Purpose

IStataToken defines the wrapped-aToken interface used by the Aave beneficiary plugin for minting and redeeming Stata positions.

Inheritance

None.

Key Methods

  • deposit(...) - Deposits reserve assets into a StataToken vault and mints shares.

  • redeem(...) - Redeems StataToken shares for the underlying reserve asset.

  • depositATokens(...) - Deposits aTokens into the StataToken vault and mints shares.

  • redeemATokens(...) - Redeems StataToken shares directly into aTokens.

All Functions

  • deposit(...) - Deposits reserve assets into a StataToken vault and mints shares.

  • redeem(...) - Redeems StataToken shares for the underlying reserve asset.

  • depositATokens(...) - Deposits aTokens into the StataToken vault and mints shares.

  • redeemATokens(...) - Redeems StataToken shares directly into aTokens.

  • asset(...) - Returns the underlying reserve asset tracked by the StataToken vault.

  • balanceOf(...) - Returns the StataToken share balance held by an account.

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

IStataTokenFactory (Interface)

Purpose

IStataTokenFactory defines the lookup and deployment interface for Stata token wrappers that the Aave beneficiary plugin uses when converting between aTokens and wrapped positions.

Inheritance

None.

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

ITrustedGuardiansPlugin (Interface)

Purpose

ITrustedGuardiansPlugin defines guardian-plugin state checks used by integrations and plugins.

Inheritance

None.

Key Methods

All Functions

Events

Errors

Access / Roles

None.

Interacts With

None.

None.

IUniversalRouter (Interface)

Purpose

IUniversalRouter defines the command-batch execution surface used by the Uniswap V4 beneficiary plugin to route exact-input swaps.

Inheritance

None.

Key Methods

  • execute(...) - Executes a Universal Router command bundle before the deadline expires.

All Functions

  • execute(...) - Executes a Universal Router command bundle before the deadline expires.

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

IWETH (Interface)

Purpose

IWETH defines the wrapped-ETH mint, burn, approval, and balance calls used by helper contracts and plugins that bridge between native ETH and ERC-20 WETH.

Inheritance

None.

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

IWstETH (Interface)

Purpose

IWstETH defines wrapped-stETH conversion calls used by the Lido beneficiary plugin when moving between stETH and wstETH positions.

Inheritance

None.

Key Methods

  • wrap(...) - Wraps stETH into non-rebasing wstETH shares.

  • unwrap(...) - Unwraps wstETH into rebasing stETH.

All Functions

  • wrap(...) - Wraps stETH into non-rebasing wstETH shares.

  • unwrap(...) - Unwraps wstETH into rebasing stETH.

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

None.

None.

DiamondLoupeFacet

Purpose

DiamondLoupeFacet implements EIP-2535 loupe views for facet discovery and selector introspection.

Inheritance

  • IDiamondLoupe

  • IERC165

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

  • ICryptoLegacyPlugin

  • LibCryptoLegacyPlugins

  • LibDiamond

None.

LibCLUtils (Library)

Purpose

LibCLUtils provides shared ERC-20 approval helpers used by migration and plugin flows. It centralizes the low-level approval call so callers can handle failures consistently.

Inheritance

None.

Key Methods

  • approveToken(...) - Performs a low-level ERC-20 approval call and normalizes non-standard return behavior.

All Functions

  • approveToken(...) - Performs a low-level ERC-20 approval call and normalizes non-standard return behavior.

Events

None.

Errors

Access / Roles

None.

Interacts With

None.

None.

LibClaimMigrationCore (Library)

Purpose

LibClaimMigrationCore provides the fixed-point math and shared distribution-sync helpers used by both one-step and two-step beneficiary claim migrations.

Inheritance

None.

Key Methods

All Functions

Events

None.

Errors

Access / Roles

None.

Interacts With

  • ICryptoLegacy

None.

LibOneStepClaimMigration (Library)

Purpose

LibOneStepClaimMigration provides the immediate claim-migration path that updates beneficiary accounting in a single execution flow.

Inheritance

None.

Key Methods

  • migrate(...) - Migrates beneficiary claim accounting for an atomic token conversion.

  • _migrateClaims(...) - Applies the migration formula to every beneficiary in the current CryptoLegacy set.

All Functions

  • migrate(...) - Migrates beneficiary claim accounting for an atomic token conversion.

  • _migrateClaims(...) - Applies the migration formula to every beneficiary in the current CryptoLegacy set.

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

  • ICryptoLegacy

  • LibClaimMigrationCore

None.

LibTwoStepClaimMigration (Library)

Purpose

LibTwoStepClaimMigration provides the delayed claim-migration flow that stages pending state, finalizes migrations later, or abandons them when necessary.

Inheritance

None.

Key Methods

  • start(...) - Starts a delayed claim migration when the source token leaves before the destination token arrives.

  • complete(...) - Completes a delayed migration after the destination token arrives.

  • abandon(...) - Abandons an active pending migration and restores cached claim state.

All Functions

  • isActive(...) - Returns whether a pending two-step migration is currently active.

  • getPendingTokens(...) - Returns the token pair involved in the active pending migration.

  • start(...) - Starts a delayed claim migration when the source token leaves before the destination token arrives.

  • complete(...) - Completes a delayed migration after the destination token arrives.

  • abandon(...) - Abandons an active pending migration and restores cached claim state.

  • _applyPendingMigration(...) - Applies the cached pending-migration snapshot to all beneficiaries.

Events

None.

Errors

Access / Roles

None.

Interacts With

  • ICryptoLegacy

  • LibClaimMigrationCore

None.

LibCreate3 (Library)

Purpose

LibCreate3 provides low-level CREATE3 deployment primitives and deterministic address derivation helpers.

Inheritance

None.

Key Methods

  • codeSize(...) - Returns the bytecode size at a target address.

  • create3(...) - Deploys bytecode deterministically with CREATE3 forwarding zero ether.

  • create3(...) - Deterministically deploys contracts using the CREATE3 pattern, optionally forwarding ETH.

  • addressOf(...) - Computes the deterministic address yielded by CREATE3 for a given salt.

All Functions

  • codeSize(...) - Returns the bytecode size at a target address.

  • create3(...) - Deploys bytecode deterministically with CREATE3 forwarding zero ether.

  • create3(...) - Deterministically deploys contracts using the CREATE3 pattern, optionally forwarding ETH.

  • addressOf(...) - Computes the deterministic address yielded by CREATE3 for a given salt.

Events

None.

Errors

Access / Roles

None.

Interacts With

None.

None.

LibCryptoLegacy (Library)

Purpose

LibCryptoLegacy provides shared storage accessors and validation checks for core protocol logic.

Inheritance

None.

Key Methods

All Functions

Events

Errors

Access / Roles

None.

Interacts With

  • ArbSys

  • IBeneficiaryRegistry

  • ICryptoLegacy

  • ICryptoLegacyBuildManager

  • ILockChainGate

  • LibDiamond

None.

LibCryptoLegacyDeploy (Library)

Purpose

LibCryptoLegacyDeploy encapsulates deployment helpers and deterministic-salt derivation for protocol-instance creation paths.

Inheritance

None.

Key Methods

All Functions

Events

Errors

Access / Roles

None.

Interacts With

  • LibCreate3

None.

LibCryptoLegacyPlugins (Library)

Purpose

LibCryptoLegacyPlugins provides plugin validation, selector registration, and plugin lifecycle helpers.

Inheritance

None.

Key Methods

All Functions

Events

Errors

Access / Roles

None.

Interacts With

  • ICryptoLegacy

  • ICryptoLegacyPlugin

  • LibDiamond

None.

LibDiamond (Library)

Purpose

LibDiamond centralizes EIP-2535 storage layout and facet-cut execution helpers.

Inheritance

None.

Key Methods

All Functions

Events

Errors

Access / Roles

None.

Interacts With

  • IDiamondCut

None.

LibSafeMinimalBeneficiaryMultisig (Library)

Purpose

LibSafeMinimalBeneficiaryMultisig provides beneficiary-oriented multisig validation and proposal-state helpers.

Inheritance

None.

Key Methods

All Functions

Events

Errors

Access / Roles

None.

Interacts With

  • ICryptoLegacy

  • ISafeMinimalMultisig

  • LibCryptoLegacy

  • LibSafeMinimalMultisig

None.

LibSafeMinimalMultisig (Library)

Purpose

LibSafeMinimalMultisig provides generic proposal, signature, and quorum helpers for minimal multisig flows.

Inheritance

None.

Key Methods

All Functions

Events

Errors

Access / Roles

None.

Interacts With

  • ISafeMinimalMultisig

  • LibCryptoLegacy

None.

LibTrustedGuardiansPlugin (Library)

Purpose

LibTrustedGuardiansPlugin provides storage and vote-state helpers for guardian-based plugin logic.

Inheritance

None.

Key Methods

All Functions

Events

Errors

None.

Access / Roles

None.

Interacts With

  • ICryptoLegacy

  • ITrustedGuardiansPlugin

  • LibCryptoLegacy

  • LibDiamond

None.

BeneficiaryAaveV3SupplyPlugin

Purpose

BeneficiaryAaveV3SupplyPlugin routes beneficiary-approved Aave V3 supply, withdrawal, and Stata-token conversion flows through the plugin multisig.

Inheritance

  • ICryptoLegacyPlugin

  • ReentrancyGuardUpgradeable

Key Methods

All Functions

Events

Errors

Access / Roles

  • baaves* state-changing execution methods require onlyDistributionReady; proposal lifecycle also enforces beneficiary multisig confirmation rules.

Interacts With

  • IAaveV3Pool

  • IAaveV3PoolDataProvider

  • IStataToken

  • IStataTokenFactory

  • ISafeMinimalMultisig

  • LibCryptoLegacy

  • LibSafeMinimalBeneficiaryMultisig

None.

BeneficiaryLidoStakingPlugin

Purpose

BeneficiaryLidoStakingPlugin gates beneficiary-approved Lido staking, wrapping, withdrawal-request, and migration flows behind the plugin multisig.

Inheritance

  • ICryptoLegacyPlugin

  • ReentrancyGuardUpgradeable

Key Methods

All Functions

Events

Errors

Access / Roles

  • bls* state-changing execution methods require onlyDistributionReady; proposal lifecycle also enforces beneficiary multisig confirmation rules.

Interacts With

  • ILido

  • IWstETH

  • ILidoWithdrawalQueue

  • WethUnwrap

  • ISafeMinimalMultisig

  • LibCryptoLegacy

  • LibSafeMinimalBeneficiaryMultisig

  • LibTwoStepClaimMigration

None.

BeneficiaryPluginAddRights

Purpose

BeneficiaryPluginAddRights lets the beneficiary multisig approve and execute additional plugin-list installs for the CryptoLegacy diamond after distribution begins.

Inheritance

  • ICryptoLegacyPlugin

  • ReentrancyGuardUpgradeable

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

  • barSetMultisigConfig: owner only, or address(this) when distribution is ready

  • barPropose: nonReentrant, onlyDistributionReady

  • barConfirm: nonReentrant, onlyDistributionReady

  • barCancel: nonReentrant, onlyDistributionReady

  • barAddPluginList: onlyDistributionReady

  • barWithdrawHeldEth: nonReentrant

Interacts With

  • ICryptoLegacy

  • ISafeMinimalMultisig

  • LibCryptoLegacy

  • LibCryptoLegacyPlugins

  • LibSafeMinimalBeneficiaryMultisig

None.

BeneficiaryUniswapV4SwapPlugin

Purpose

BeneficiaryUniswapV4SwapPlugin executes beneficiary-approved Uniswap V4 exact-input swaps through the plugin multisig and the Universal Router dispatcher.

Inheritance

  • ICryptoLegacyPlugin

  • ReentrancyGuardUpgradeable

Key Methods

All Functions

Events

Errors

Access / Roles

  • bunis* state-changing execution methods require onlyDistributionReady; proposal lifecycle also enforces beneficiary multisig confirmation rules.

Interacts With

  • IPermit2

  • IUniversalRouter

  • ISafeMinimalMultisig

  • LibCryptoLegacy

  • LibSafeMinimalBeneficiaryMultisig

None.

CryptoLegacyBasePlugin

Purpose

CryptoLegacyBasePlugin implements core legacy distribution and claim workflows reused across protocol instances.

Inheritance

  • ICryptoLegacy

  • CryptoLegacyOwnable

  • ReentrancyGuardUpgradeable

Key Methods

All Functions

Events

Errors

Access / Roles

  • initializeByBuildManager: initializer; buildManager only caller

  • transferOwnership: onlyOwner

  • payInitialFee: nonReentrant

  • setBeneficiaries: onlyOwner

  • update: nonReentrant, onlyOwner

  • setGasLimitMultiplier: nonReentrant, onlyOwner

  • transferTreasuryTokensToLegacy: nonReentrant

  • beneficiaryClaim: nonReentrant

  • sendMessagesToBeneficiary: onlyOwner

Interacts With

  • ArbSys

  • IBeneficiaryRegistry

  • LibCryptoLegacy

  • LibDiamond

None.

LegacyRecoveryPlugin

Purpose

LegacyRecoveryPlugin implements recovery-governance flows for regaining control through proposal-based execution.

Inheritance

  • ICryptoLegacyPlugin

  • ReentrancyGuardUpgradeable

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

  • lrSetMultisigConfig: onlyOwner

  • lrTransferTreasuryTokensToLegacy: nonReentrant

  • lrWithdrawTokensFromLegacy: nonReentrant

  • lrResetGuardianVoting: nonReentrant

  • lrWithdrawHeldEth: nonReentrant

Interacts With

  • IBeneficiaryRegistry

  • ICryptoLegacy

  • ISafeMinimalMultisig

  • LibCryptoLegacy

  • LibSafeMinimalMultisig

  • LibTrustedGuardiansPlugin

None.

LensPlugin

Purpose

LensPlugin exposes read-only protocol views to aggregate operational and beneficiary-related state.

Inheritance

  • ICryptoLegacyPlugin

  • ICryptoLegacyLens

Key Methods

All Functions

Events

None.

Errors

None.

Access / Roles

None.

Interacts With

  • ICryptoLegacy

  • LibCryptoLegacy

  • LibDiamond

None.

NftLegacyPlugin

Purpose

NftLegacyPlugin implements NFT-oriented legacy management and related beneficiary operations.

Inheritance

  • ICryptoLegacyPlugin

  • ReentrancyGuardUpgradeable

Key Methods

All Functions

Events

Errors

Access / Roles

  • setNftBeneficiary: onlyOwner

  • transferNftTokensToLegacy: nonReentrant

  • beneficiaryClaimNft: nonReentrant

Interacts With

  • ICryptoLegacy

  • LibCryptoLegacy

None.

ReceiveEthPlugin

Purpose

ReceiveEthPlugin enables a CryptoLegacy instance to accept plain ETH transfers and wrap the accumulated ETH into WETH when a beneficiary triggers the wrapping flow.

Inheritance

  • ICryptoLegacyPlugin

Key Methods

  • getSigs(...) - Returns the selectors exposed by the receive-ETH plugin.

  • getSetupSigs(...) - Returns setup-time selectors required for the receive-ETH plugin.

  • wrapEthToWeth(...) - Wraps all ETH currently held by the CryptoLegacy diamond into WETH.

All Functions

Events

Errors

Access / Roles

  • wrapEthToWeth: beneficiary caller after the distribution-ready checks enforced by LibCryptoLegacy

  • receive: open plain-ETH entry point

Interacts With

  • ICryptoLegacy

  • IWETH

  • LibCryptoLegacy

None.

TrustedGuardiansPlugin

Purpose

TrustedGuardiansPlugin implements guardian-voting logic for distribution and safety-critical transitions.

Inheritance

  • ICryptoLegacyPlugin

  • ITrustedGuardiansPlugin

  • ReentrancyGuardUpgradeable

Key Methods

All Functions

Events

Errors

Access / Roles

  • initializeGuardians: nonReentrant, onlyOwner

  • setGuardians: nonReentrant, onlyOwner

  • setGuardiansConfig: nonReentrant, onlyOwner

  • guardiansVoteForDistribution: nonReentrant

  • guardiansTransferTreasuryTokensToLegacy: nonReentrant

  • resetGuardianVoting: nonReentrant, onlyOwner

Interacts With

  • IBeneficiaryRegistry

  • ICryptoLegacy

  • LibCryptoLegacy

  • LibSafeMinimalMultisig

  • LibTrustedGuardiansPlugin

None.

UpdateRolePlugin

Purpose

UpdateRolePlugin implements controlled updates of beneficiary, guardian, and related role assignments.

Inheritance

  • ICryptoLegacyPlugin

  • ReentrancyGuardUpgradeable

Key Methods

All Functions

  • getSigs() - Lists external selectors provided by the updater role facet.

  • getSetupSigs() - Reports setup selectors required during facet installation.

  • getPluginName() - Returns the human-readable name of the updater facet.

  • getPluginVer() - Reveals the semantic version for the updater role facet.

  • getPluginStorage() - Returns the plugin-specific storage slot used for updater data.

  • owner() - Returns the current diamond owner address.

  • getUpdaterList() - Returns the full set of updater addresses.

  • isUpdater(...) - Checks whether a given address currently has update permissions.

  • setUpdater(...) - Adds or removes authorised updaters.

  • updateByUpdater(...) - Lets authorised updaters execute the update flow while paying required fees before distribution begins.

Events

Errors

Access / Roles

  • setUpdater: nonReentrant, onlyOwner

  • updateByUpdater: nonReentrant, onlyUpdater

Interacts With

  • ICryptoLegacy

  • ICryptoLegacyUpdaterPlugin

  • LibCryptoLegacy

  • LibDiamond

None.

Last updated