Skip to content
Open
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 src/adapters/interfaces/IAxelarAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity >=0.5.0;

import {IAdapter} from "../../core/messaging/interfaces/IAdapter.sol";
import {IMessageHandler} from "../../core/messaging/interfaces/IMessageHandler.sol";

import {IAdapterWiring} from "../../admin/interfaces/IAdapterWiring.sol";

Expand Down Expand Up @@ -94,6 +95,15 @@ interface IAxelarAdapter is IAdapter, IAdapterWiring, IAxelarExecutable {
// View methods
//----------------------------------------------------------------------------------------------

/// @notice The MultiAdapter that receives decoded inbound messages from this adapter
function entrypoint() external view returns (IMessageHandler);

/// @notice Axelar's General Message Passing gateway used for cross-chain message dispatch and validation
function axelarGateway() external view returns (IAxelarGateway);

/// @notice Axelar's gas service used to estimate and pay for cross-chain execution costs
function axelarGasService() external view returns (IAxelarGasService);

/// @notice Returns the source configuration for a given axelar chain id
/// @param axelarId The Axelar ID of the remote chain
/// @return centrifugeId The remote chain id
Expand Down
7 changes: 7 additions & 0 deletions src/adapters/interfaces/IChainlinkAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity >=0.5.0;
import {IERC165} from "../../misc/interfaces/IERC7575.sol";

import {IAdapter} from "../../core/messaging/interfaces/IAdapter.sol";
import {IMessageHandler} from "../../core/messaging/interfaces/IMessageHandler.sol";

import {IAdapterWiring} from "../../admin/interfaces/IAdapterWiring.sol";

Expand Down Expand Up @@ -118,6 +119,12 @@ interface IChainlinkAdapter is IAdapter, IAdapterWiring, IAny2EVMMessageReceiver
// View methods
//----------------------------------------------------------------------------------------------

/// @notice Chainlink's CCIP router used for cross-chain message dispatch and fee estimation
function ccipRouter() external view returns (IRouterClient);

/// @notice The MultiAdapter that receives decoded inbound messages from this adapter
function entrypoint() external view returns (IMessageHandler);

/// @notice Returns the source configuration for a given Chainlink chain id
/// @param chainSelector The Chainlink chain selector
/// @return centrifugeId The remote chain id
Expand Down
7 changes: 7 additions & 0 deletions src/adapters/interfaces/ILayerZeroAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity >=0.5.0;

import {IAdapter} from "../../core/messaging/interfaces/IAdapter.sol";
import {IMessageHandler} from "../../core/messaging/interfaces/IMessageHandler.sol";

import {IAdapterWiring} from "../../admin/interfaces/IAdapterWiring.sol";

Expand Down Expand Up @@ -109,6 +110,12 @@ interface ILayerZeroAdapter is IAdapter, IAdapterWiring, ILayerZeroReceiver {
// View methods
//----------------------------------------------------------------------------------------------

/// @notice The MultiAdapter that receives decoded inbound messages from this adapter
function entrypoint() external view returns (IMessageHandler);

/// @notice LayerZero V2 endpoint used for cross-chain message dispatch and fee quoting
function endpoint() external view returns (ILayerZeroEndpointV2);

/// @notice Returns the source configuration for a given layerzero endpoint id
/// @param layerZeroEid The remote LayerZero Endpoint ID
/// @return centrifugeId The remote chain id
Expand Down
10 changes: 10 additions & 0 deletions src/adapters/interfaces/IWormholeAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity >=0.5.0;

import {IAdapter} from "../../core/messaging/interfaces/IAdapter.sol";
import {IMessageHandler} from "../../core/messaging/interfaces/IMessageHandler.sol";

import {IAdapterWiring} from "../../admin/interfaces/IAdapterWiring.sol";

Expand Down Expand Up @@ -156,6 +157,15 @@ interface IWormholeAdapter is IAdapter, IAdapterWiring, IWormholeReceiver {
// View methods
//----------------------------------------------------------------------------------------------

/// @notice Wormhole-specific chain identifier for this network, distinct from the EVM chain ID
function localWormholeId() external view returns (uint16);

/// @notice The MultiAdapter that receives decoded inbound messages from this adapter
function entrypoint() external view returns (IMessageHandler);

/// @notice Wormhole's automatic relayer used for cross-chain message dispatch and fee quoting
function relayer() external view returns (IWormholeRelayer);

/// @notice Returns the source configuration for a given wormhole chain id
/// @param wormholeId The remote wormhole id
/// @return centrifugeId The remote chain id
Expand Down
8 changes: 8 additions & 0 deletions src/admin/interfaces/IOpsGuardian.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
pragma solidity >=0.5.0;

import {ISafe} from "./ISafe.sol";
import {ICreatePool} from "./ICreatePool.sol";

import {PoolId} from "../../core/types/PoolId.sol";
import {AssetId} from "../../core/types/AssetId.sol";
import {IAdapter} from "../../core/messaging/interfaces/IAdapter.sol";
import {IMultiAdapter} from "../../core/messaging/interfaces/IMultiAdapter.sol";

interface IOpsGuardian {
error NotTheAuthorizedSafe();
Expand Down Expand Up @@ -46,4 +48,10 @@ interface IOpsGuardian {
/// @notice Return the linked operational safe
/// @return The operational safe contract
function opsSafe() external view returns (ISafe);

/// @notice Hub contract called to register new pools
function hub() external view returns (ICreatePool);

/// @notice MultiAdapter used for first-time adapter initialization and wiring on new networks
function multiAdapter() external view returns (IMultiAdapter);
}
22 changes: 22 additions & 0 deletions src/admin/interfaces/IProtocolGuardian.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

import {IRoot} from "./IRoot.sol";
import {ISafe} from "./ISafe.sol";

import {IGateway} from "../../core/messaging/interfaces/IGateway.sol";
import {IScheduleAuthMessageSender} from "../../core/messaging/interfaces/IGatewaySenders.sol";

interface IProtocolGuardian {
error NotTheAuthorizedSafe();
error FileUnrecognizedParam();
Expand Down Expand Up @@ -61,4 +67,20 @@ interface IProtocolGuardian {
/// @param what Accepts a bytes32 representation of 'safe', 'gateway', or 'sender'
/// @param data New value for the parameter
function file(bytes32 what, address data) external;

//----------------------------------------------------------------------------------------------
// View methods
//----------------------------------------------------------------------------------------------

/// @notice Root authority that manages ward permissions and timelocked upgrades
function root() external view returns (IRoot);

/// @notice Multisig that authorizes protocol-level guardian operations
function safe() external view returns (ISafe);

/// @notice Gateway used for cross-chain upgrade scheduling and outgoing message blocking
function gateway() external view returns (IGateway);

/// @notice Dispatches cross-chain messages for remote upgrade scheduling and cancellation
function sender() external view returns (IScheduleAuthMessageSender);
}
23 changes: 23 additions & 0 deletions src/core/hub/interfaces/IAccounting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,27 @@ interface IAccounting {
/// @param account The account to check
/// @return True if the account exists, false otherwise
function exists(PoolId poolId, AccountId account) external view returns (bool);

/// @notice Returns the current debited amount in the active transaction
/// @dev Transient storage: Only non-zero during an active unlock/lock session
/// @return The current debited amount
function debited() external view returns (uint128);

/// @notice Returns the current credited amount in the active transaction
/// @dev Transient storage: Only non-zero during an active unlock/lock session
/// @return The current credited amount
function credited() external view returns (uint128);

/// @notice Returns the account data for a given pool and account
/// @param poolId The pool the account belongs to
/// @param account The account identifier
/// @return totalDebit The total debit amount
/// @return totalCredit The total credit amount
/// @return isDebitNormal Whether the account is debit-normal
/// @return lastUpdated The timestamp of the last update
/// @return metadata The account metadata
function accounts(PoolId poolId, AccountId account)
external
view
returns (uint128 totalDebit, uint128 totalCredit, bool isDebitNormal, uint64 lastUpdated, bytes memory metadata);
}
17 changes: 17 additions & 0 deletions src/core/hub/interfaces/IHoldings.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity >=0.5.0;

import {IValuation} from "./IValuation.sol";
import {IHubRegistry} from "./IHubRegistry.sol";
import {ISnapshotHook} from "./ISnapshotHook.sol";

import {D18} from "../../../misc/types/D18.sol";
Expand Down Expand Up @@ -287,4 +288,20 @@ interface IHoldings {
/// @param assetId The asset identifier
/// @return Whether the holding is initialized
function isInitialized(PoolId poolId, ShareClassId scId, AssetId assetId) external view returns (bool);

/// @notice Registry of pools, assets, and manager permissions on the hub chain
function hubRegistry() external view returns (IHubRegistry);

/// @notice Returns the holding data for a given pool, share class and asset
/// @param poolId The pool identifier
/// @param scId The share class identifier
/// @param assetId The asset identifier
/// @return assetAmount The amount of assets held
/// @return assetAmountValue The value of assets held in pool currency
/// @return valuation The valuation contract used for pricing
/// @return isLiability Whether the holding represents a liability
function holding(PoolId poolId, ShareClassId scId, AssetId assetId)
external
view
returns (uint128 assetAmount, uint128 assetAmountValue, IValuation valuation, bool isLiability);
}
8 changes: 8 additions & 0 deletions src/core/hub/interfaces/IHub.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

import {IFeeHook} from "./IFeeHook.sol";
import {IValuation} from "./IValuation.sol";
import {IHubRegistry} from "./IHubRegistry.sol";
import {ISnapshotHook} from "./ISnapshotHook.sol";
Expand All @@ -13,6 +14,7 @@ import {D18} from "../../../misc/types/D18.sol";

import {IAdapter} from "../../messaging/interfaces/IAdapter.sol";
import {VaultUpdateKind} from "../../messaging/libraries/MessageLib.sol";
import {IMultiAdapter} from "../../messaging/interfaces/IMultiAdapter.sol";
import {IHubMessageSender} from "../../messaging/interfaces/IGatewaySenders.sol";

import {PoolId} from "../../types/PoolId.sol";
Expand Down Expand Up @@ -129,6 +131,12 @@ interface IHub is IBatchedMulticall {
/// @return The share class manager contract instance
function shareClassManager() external view returns (IShareClassManager);

/// @notice Hook that calculates and applies protocol fees on NAV updates
function feeHook() external view returns (IFeeHook);

/// @notice Handles multi-protocol message verification and routing for cross-chain communication
function multiAdapter() external view returns (IMultiAdapter);

/// @notice Updates a contract parameter
/// @param what Name of the parameter to update (accepts 'hubRegistry', 'accounting', 'holdings', 'gateway', 'sender')
/// @param data Address of the new contract
Expand Down
26 changes: 26 additions & 0 deletions src/core/hub/interfaces/IHubHandler.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

import {IHub} from "./IHub.sol";
import {IHoldings} from "./IHoldings.sol";
import {IHubRegistry} from "./IHubRegistry.sol";
import {IShareClassManager} from "./IShareClassManager.sol";

import {IHubMessageSender} from "../../messaging/interfaces/IGatewaySenders.sol";

import {PoolId} from "../../types/PoolId.sol";
import {ShareClassId} from "../../types/ShareClassId.sol";

Expand Down Expand Up @@ -37,4 +44,23 @@ interface IHubHandler {
/// @param what Name of the parameter to update (accepts 'hubRegistry', 'holdings', 'sender')
/// @param data Address of the new contract
function file(bytes32 what, address data) external;

//----------------------------------------------------------------------------------------------
// View methods
//----------------------------------------------------------------------------------------------

/// @notice Central coordination contract for pool management and cross-chain operations
function hub() external view returns (IHub);

/// @notice Tracks asset positions and valuations across all pools and share classes
function holdings() external view returns (IHoldings);

/// @notice Registry of pools, assets, and manager permissions on the hub chain
function hubRegistry() external view returns (IHubRegistry);

/// @notice Dispatches cross-chain messages from the hub to spoke chains
function sender() external view returns (IHubMessageSender);

/// @notice Manages share class creation, pricing, and issuance/revocation tracking
function shareClassManager() external view returns (IShareClassManager);
}
14 changes: 14 additions & 0 deletions src/core/hub/interfaces/IShareClassManager.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

import {IHubRegistry} from "./IHubRegistry.sol";

import {D18} from "../../../misc/types/D18.sol";

import {PoolId} from "../../types/PoolId.sol";
Expand Down Expand Up @@ -166,4 +168,16 @@ interface IShareClassManager {
external
view
returns (string memory name, string memory symbol, bytes32 salt);

/// @notice Registry of pools, assets, and manager permissions on the hub chain
function hubRegistry() external view returns (IHubRegistry);

/// @notice Whether a CREATE3 deployment salt has already been consumed
/// @param salt The salt to check
function salts(bytes32 salt) external view returns (bool);

/// @notice Whether a share class ID has been registered for a pool
/// @param poolId Identifier of the pool
/// @param scId Identifier of the share class
function shareClassIds(PoolId poolId, ShareClassId scId) external view returns (bool);
}
3 changes: 3 additions & 0 deletions src/core/messaging/interfaces/IGasService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ uint128 constant MAX_MESSAGE_COST = 3_200_000;
interface IGasService is IMessageProperties {
error InvalidMessageType();

/// @notice Packed uint8 array of per-chain block gas limits (in millions), indexed by centrifugeId (first 32 chains)
function txLimitsPerCentrifugeId() external view returns (uint256);

function scheduleUpgrade() external view returns (uint128);
function cancelUpgrade() external view returns (uint128);
function recoverTokens() external view returns (uint128);
Expand Down
43 changes: 43 additions & 0 deletions src/core/messaging/interfaces/IGateway.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

import {IAdapter} from "./IAdapter.sol";
import {IMessageHandler} from "./IMessageHandler.sol";
import {IProtocolPauser} from "./IProtocolPauser.sol";
import {IMessageProperties} from "./IMessageProperties.sol";

import {IRecoverable} from "../../../misc/interfaces/IRecoverable.sol";

Expand Down Expand Up @@ -193,6 +196,46 @@ interface IGateway is IMessageHandler, IRecoverable {
// View methods
//----------------------------------------------------------------------------------------------

/// @notice Protocol's internal chain identifier for this network, distinct from the EVM chain ID
function localCentrifugeId() external view returns (uint16);

/// @notice MultiAdapter used for outbound message dispatch and inbound quorum verification
function adapter() external view returns (IAdapter);

/// @notice Handler that routes confirmed inbound cross-chain messages to their target contracts
function processor() external view returns (IMessageHandler);

/// @notice Provides gas cost estimates and message type metadata for cross-chain messages
function messageProperties() external view returns (IMessageProperties);

/// @notice ProtocolGuardian that can pause/unpause all cross-chain messaging
function pauser() external view returns (IProtocolPauser);

/// @notice Returns whether an address is a manager for a given pool
/// @param poolId The pool identifier
/// @param who The address to check
/// @return Whether the address is a manager
function manager(PoolId poolId, address who) external view returns (bool);

/// @notice Returns whether outgoing messages are blocked for a pool on a specific chain
/// @param centrifugeId The destination chain identifier
/// @param poolId The pool identifier
/// @return Whether outgoing is blocked
function isOutgoingBlocked(uint16 centrifugeId, PoolId poolId) external view returns (bool);

/// @notice Returns the underpaid batch info for a given chain and batch hash
/// @param centrifugeId The destination chain identifier
/// @param batchHash The hash of the underpaid batch
/// @return gasLimit The gas limit for the batch
/// @return counter The number of underpaid instances
function underpaid(uint16 centrifugeId, bytes32 batchHash) external view returns (uint128 gasLimit, uint64 counter);

/// @notice Returns the number of failed message instances for a given chain and message hash
/// @param centrifugeId The source chain identifier
/// @param messageHash The hash of the failed message
/// @return The count of failed instances
function failedMessages(uint16 centrifugeId, bytes32 messageHash) external view returns (uint256);

/// @notice Returns the current gateway batching level
/// @return Whether the gateway is currently batching
function isBatching() external view returns (bool);
Expand Down
Loading
Loading