Verified contractPartialMIT
AaveV4Ethereum_OnboardCirBTCToV3CoreAndV4Core_20261019
Address0x46884bbde94ccb281028c6f34fee2011126a5cb3
- Balance
0 ETH
- Transactions
0
- Compiler
solc 0.8.28
- Same code
Only this contract
Details
- Compiler
- solc 0.8.28+commit.7893614a
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- shanghai
- License
- MIT
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,342,589
- Creation transaction
- 0x3a515e4d68…8ec760bbb1
44 files
- src/20261019_Multi_OnboardCirBTCToV3CoreAndV4Core/AaveV4Ethereum_OnboardCirBTCToV3CoreAndV4Core_20261019.solmain4.3 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/access/interfaces/IAccessManagerEnumerable.sol10.97 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/config-engine/AaveV4Payload.sol16.33 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/config-engine/interfaces/IAaveV4ConfigEngine.sol18.91 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/Address.sol6.37 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/Errors.sol864 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/IAccessManaged.sol1.07 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/IAccessManager.sol15.67 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/IERC20.sol2.66 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/IERC20Metadata.sol659 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/IERC20Permit.sol3.7 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/IERC2612.sol221 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/IERC4626.sol11.8 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/LowLevelCall.sol5.18 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/hub/interfaces/IAssetInterestRateStrategy.sol4.68 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/hub/interfaces/IBasicInterestRateStrategy.sol1.35 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/hub/interfaces/IHub.sol19.89 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/hub/interfaces/IHubBase.sol17.13 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/hub/interfaces/IHubConfigurator.sol9.25 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/interfaces/IExtSload.sol694 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/interfaces/IIntentConsumer.sol475 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/interfaces/IMulticall.sol544 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/interfaces/INoncesKeyed.sol1 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/interfaces/IRescuable.sol979 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/position-manager/interfaces/IConfigPositionManager.sol12.34 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/position-manager/interfaces/IGiverPositionManager.sol3.16 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/position-manager/interfaces/INativeTokenGateway.sol3.94 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/position-manager/interfaces/IPositionManagerBase.sol3.69 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/position-manager/interfaces/IPositionManagerIntentBase.sol462 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/position-manager/interfaces/ISignatureGateway.sol10.03 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/position-manager/interfaces/ITakerPositionManager.sol10.04 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/spoke/interfaces/IAaveOracle.sol2.75 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/spoke/interfaces/IPriceOracle.sol899 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/spoke/interfaces/ISpoke.sol38.72 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/spoke/interfaces/ISpokeConfigurator.sol9.03 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/spoke/interfaces/ITokenizationSpoke.sol7.91 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/spoke/interfaces/ITreasurySpoke.sol2.84 KB
- lib/aave-helpers/lib/aave-address-book/src/AaveV4.sol1.55 KB
- lib/aave-helpers/lib/aave-address-book/src/AaveV4Ethereum.sol54.34 KB
- lib/aave-helpers/lib/aave-address-book/src/ChainlinkEthereum.sol47.69 KB
- lib/aave-helpers/lib/aave-address-book/src/MiscEthereum.sol10.82 KB
- lib/aave-helpers/lib/aave-address-book/src/common/IAaveEcosystemReserveController.sol2.6 KB
- lib/aave-helpers/lib/aave-address-book/src/common/IStreamable.sol1.75 KB
- lib/aave-helpers/src/v4-config-engine/AaveV4PayloadEthereum.sol392 B
src/20261019_Multi_OnboardCirBTCToV3CoreAndV4Core/AaveV4Ethereum_OnboardCirBTCToV3CoreAndV4Core_20261019.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {AaveV4Ethereum, AaveV4EthereumHubs, AaveV4EthereumIRStrategies, AaveV4EthereumSpokes} from 'aave-address-book/AaveV4Ethereum.sol';
import {ChainlinkEthereum} from 'aave-address-book/ChainlinkEthereum.sol';
import {MiscEthereum} from 'aave-address-book/MiscEthereum.sol';
import {AaveV4PayloadEthereum} from 'aave-helpers/src/v4-config-engine/AaveV4PayloadEthereum.sol';
import {IAaveV4ConfigEngine as IConfigEngine} from 'aave-address-book/AaveV4.sol';
import {IHub} from 'aave-v4/hub/interfaces/IHub.sol';
import {ISpoke} from 'aave-v4/spoke/interfaces/ISpoke.sol';
import {IAssetInterestRateStrategy} from 'aave-v4/hub/interfaces/IAssetInterestRateStrategy.sol';
/**
* @title Onboard cirBTC on Aave V3 Core and Aave V4 Core
* @author Aave Labs
* - Snapshot: https://snapshot.org/#/s:aavedao.eth/proposal/0xe7ce2a6c2c3f8ea303351a12ea0e991815b3944bd44af4fd2890cadc2ff19881
* - Discussion: https://governance.aave.com/t/arfc-onboard-cirbtc-on-aave-v3-core-and-aave-v4-core/25128
*/
contract AaveV4Ethereum_OnboardCirBTCToV3CoreAndV4Core_20261019 is AaveV4PayloadEthereum {
// https://etherscan.io/address/0x72DFB2E44f59C5AD2bAFE84314E5b99a7cd5075E
address public constant cirBTC = 0x72DFB2E44f59C5AD2bAFE84314E5b99a7cd5075E;
// https://etherscan.io/address/0xb41E773f507F7a7EA890b1afB7d2b660c30C8B0A
address public constant MAIN_SPOKE_cirBTC_PRICE_FEED = ChainlinkEthereum.AAVE_SVR_BTC__USD;
function hubAssetListings() public pure override returns (IConfigEngine.AssetListing[] memory) {
IConfigEngine.AssetListing[] memory items = new IConfigEngine.AssetListing[](1);
items[0] = IConfigEngine.AssetListing({
hubConfigurator: AaveV4Ethereum.HUB_CONFIGURATOR,
hub: address(AaveV4EthereumHubs.CORE_HUB),
underlying: cirBTC,
feeReceiver: address(AaveV4Ethereum.TREASURY_SPOKE),
liquidityFee: 20_00,
irStrategy: address(AaveV4EthereumIRStrategies.CORE_WBTC_IR_STRATEGY),
irData: IAssetInterestRateStrategy.InterestRateData({
optimalUsageRatio: uint16(80_00),
baseDrawnRate: uint32(25),
rateGrowthBeforeOptimal: uint32(4_00),
rateGrowthAfterOptimal: uint32(60_00)
}),
tokenization: IConfigEngine.TokenizationSpokeConfig({
addCap: 25,
proxyAdminOwner: MiscEthereum.V4_SECURITY_COUNCIL,
name: 'Wrapped Aave Core cirBTC',
symbol: 'waCorecirBTC'
})
});
return items;
}
function spokeReserveListings()
public
pure
override
returns (IConfigEngine.ReserveListing[] memory)
{
IConfigEngine.ReserveListing[] memory items = new IConfigEngine.ReserveListing[](1);
items[0] = IConfigEngine.ReserveListing({
spokeConfigurator: AaveV4Ethereum.SPOKE_CONFIGURATOR,
spoke: address(AaveV4EthereumSpokes.MAIN_SPOKE),
hub: address(AaveV4EthereumHubs.CORE_HUB),
underlying: cirBTC,
priceSource: MAIN_SPOKE_cirBTC_PRICE_FEED,
config: ISpoke.ReserveConfig({
collateralRisk: uint24(0),
paused: false,
frozen: false,
borrowable: true,
receiveSharesEnabled: true
}),
dynamicConfig: ISpoke.DynamicReserveConfig({
collateralFactor: uint16(78_00),
maxLiquidationBonus: uint32(105_55),
liquidationFee: uint16(10_00)
})
});
return items;
}
function hubSpokeToAssetsAdditions()
public
pure
override
returns (IConfigEngine.SpokeToAssetsAddition[] memory)
{
IConfigEngine.SpokeToAssetsAddition[] memory items = new IConfigEngine.SpokeToAssetsAddition[](
1
);
{
IConfigEngine.SpokeAssetConfig[] memory subAssets = new IConfigEngine.SpokeAssetConfig[](1);
subAssets[0] = IConfigEngine.SpokeAssetConfig({
underlying: cirBTC,
config: IHub.SpokeConfig({
addCap: 250,
drawCap: 25,
riskPremiumThreshold: 0,
active: true,
halted: false
})
});
items[0] = IConfigEngine.SpokeToAssetsAddition({
hubConfigurator: AaveV4Ethereum.HUB_CONFIGURATOR,
hub: address(AaveV4EthereumHubs.CORE_HUB),
spoke: address(AaveV4EthereumSpokes.MAIN_SPOKE),
assets: subAssets
});
}
return items;
}
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/access/interfaces/IAccessManagerEnumerable.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IAccessManager} from 'src/dependencies/openzeppelin/IAccessManager.sol';
/// @title IAccessManagerEnumerable
/// @author Aave Labs
/// @notice Interface for AccessManagerEnumerable extension.
interface IAccessManagerEnumerable is IAccessManager {
/// @notice Thrown when the role has not been labeled.
error AccessManagerUnlabeledRole(uint64 roleId);
/// @notice Thrown when the label is not assigned to any role.
error AccessManagerUnregisteredLabel(string label);
/// @notice Thrown when the role has already been labeled.
error AccessManagerRoleAlreadyLabeled(uint64 roleId);
/// @notice Thrown when the label is already assigned to a different role.
error AccessManagerLabelAlreadyUsed(string label, uint64 roleId);
/// @notice Returns the identifier of the role at a specified index.
/// @dev `PUBLIC_ROLE` and `ADMIN_ROLE` are not accessible via any index.
/// @dev Roles with no assigned members are also accessible.
/// @param index The index in the role list.
/// @return The identifier of the role.
function getRole(uint256 index) external view returns (uint64);
/// @notice Returns the total number of existing roles.
/// @dev `PUBLIC_ROLE` and `ADMIN_ROLE` are not included in the role count.
/// @dev Roles with no assigned members are also taken into account.
/// @return The number of roles.
function getRoleCount() external view returns (uint256);
/// @notice Returns the list of role identifiers between the specified indexes.
/// @dev `PUBLIC_ROLE` and `ADMIN_ROLE` are not accessible via any index.
/// @dev Roles with no assigned members are also accessible.
/// @param start The starting index for the role list.
/// @param end The ending index for the role list.
/// @return The list of role identifiers.
function getRoles(uint256 start, uint256 end) external view returns (uint64[] memory);
/// @notice Returns whether the specified role exists.
/// @dev `PUBLIC_ROLE` and `ADMIN_ROLE` are not taken into account.
/// @param roleId The identifier of the role.
function isRole(uint64 roleId) external view returns (bool);
/// @notice Returns the identifier of the admin role at a specified index.
/// @dev `ADMIN_ROLE` is not accessible via any index.
/// @dev Admin roles with no assigned members or managed roles are also accessible.
/// @param index The index in the admin role list.
/// @return The identifier of the admin role.
function getAdminRole(uint256 index) external view returns (uint64);
/// @notice Returns the total number of existing admin roles.
/// @dev `ADMIN_ROLE` is not included in the admin role count.
/// @dev Admin roles with no assigned members or managed roles are also taken into account.
/// @return The number of admin roles.
function getAdminRoleCount() external view returns (uint256);
/// @notice Returns the list of admin role identifiers between the specified indexes.
/// @dev `ADMIN_ROLE` is not accessible via any index.
/// @dev Admin roles with no assigned members or managed roles are also accessible.
/// @param start The starting index for the admin role list.
/// @param end The ending index for the admin role list.
/// @return The list of admin role identifiers.
function getAdminRoles(uint256 start, uint256 end) external view returns (uint64[] memory);
/// @notice Returns whether the specified admin role exists.
/// @dev `ADMIN_ROLE` is not taken into account.
/// @param adminRoleId The identifier of the admin role.
function isAdminRole(uint64 adminRoleId) external view returns (bool);
/// @notice Returns the address of the role member at a specified index.
/// @param roleId The identifier of the role.
/// @param index The index in the role member list.
/// @return The address of the role member.
function getRoleMember(uint64 roleId, uint256 index) external view returns (address);
/// @notice Returns the number of members for a specified role.
/// @param roleId The identifier of the role.
/// @return The number of members for the role.
function getRoleMemberCount(uint64 roleId) external view returns (uint256);
/// @notice Returns the list of members for a specified role between the specified indexes.
/// @param roleId The identifier of the role.
/// @param start The starting index for the member list.
/// @param end The ending index for the member list.
/// @return The list of members for the role.
function getRoleMembers(
uint64 roleId,
uint256 start,
uint256 end
) external view returns (address[] memory);
/// @notice Returns the identifier of the role managed by the given admin role at a specified index.
/// @dev Roles managed by the `ADMIN_ROLE` are not accessible.
/// @param adminRoleId The identifier of the admin role.
/// @param index The index in the list of roles managed by the admin role.
/// @return The identifier of the role.
function getRoleOfAdminRole(uint64 adminRoleId, uint256 index) external view returns (uint64);
/// @notice Returns the number of roles managed by a specified admin role.
/// @dev Roles managed by the `ADMIN_ROLE` are not accessible.
/// @param adminRoleId The identifier of the admin role.
/// @return The number of roles managed by the admin role.
function getRoleOfAdminRoleCount(uint64 adminRoleId) external view returns (uint256);
/// @notice Returns the list of role identifiers managed by the given admin role between the specified indexes.
/// @dev Roles managed by the `ADMIN_ROLE` are not accessible.
/// @param adminRoleId The identifier of the admin role.
/// @param start The starting index in the list of roles managed by the admin role.
/// @param end The ending index in the list of roles managed by the admin role.
/// @return The list of role identifiers managed by the given admin role.
function getRolesOfAdminRole(
uint64 adminRoleId,
uint256 start,
uint256 end
) external view returns (uint64[] memory);
/// @notice Returns the address of the target contract for a specified role and index.
/// @dev Target contracts assigned to `ADMIN_ROLE` are not accessible.
/// @param roleId The identifier of the role.
/// @param index The index in the role target list.
/// @return The address of the target contract.
function getRoleTarget(uint64 roleId, uint256 index) external view returns (address);
/// @notice Returns the number of target contracts for a specified role.
/// @dev Target contracts assigned to `ADMIN_ROLE` are not accessible.
/// @param roleId The identifier of the role.
/// @return The number of target contracts for the role.
function getRoleTargetCount(uint64 roleId) external view returns (uint256);
/// @notice Returns the list of target contracts for a specified role between the specified indexes.
/// @dev Target contracts assigned to `ADMIN_ROLE` are not accessible.
/// @param roleId The identifier of the role.
/// @param start The starting index for the role target list.
/// @param end The ending index for the role target list.
/// @return The list of target contracts for the role.
function getRoleTargets(
uint64 roleId,
uint256 start,
uint256 end
) external view returns (address[] memory);
/// @notice Returns the function selector assigned to a given role at the specified index.
/// @dev Target selectors assigned to `ADMIN_ROLE` are not accessible.
/// @param roleId The identifier of the role.
/// @param target The address of the target contract.
/// @param index The index in the role member list.
/// @return The selector at the index.
function getRoleTargetSelector(
uint64 roleId,
address target,
uint256 index
) external view returns (bytes4);
/// @notice Returns the number of function selectors assigned to the given role.
/// @dev Target selectors assigned to `ADMIN_ROLE` are not accessible.
/// @param roleId The identifier of the role.
/// @param target The address of the target contract.
/// @return The number of selectors assigned to the role.
function getRoleTargetSelectorCount(
uint64 roleId,
address target
) external view returns (uint256);
/// @notice Returns the list of function selectors assigned to the given role between the specified indexes.
/// @dev Target selectors assigned to `ADMIN_ROLE` are not accessible.
/// @param roleId The identifier of the role.
/// @param target The address of the target contract.
/// @param start The starting index for the selector list.
/// @param end The ending index for the selector list.
/// @return The list of selectors assigned to the role.
function getRoleTargetSelectors(
uint64 roleId,
address target,
uint256 start,
uint256 end
) external view returns (bytes4[] memory);
/// @notice Returns the role identifier for the specified function selector.
/// @param target The address of the target contract.
/// @param selector The function selector.
/// @return The identifier of the role.
function getRoleOfTargetSelector(address target, bytes4 selector) external view returns (uint64);
/// @notice Returns the label at a specified index.
/// @param index The index in the labeled role list.
/// @return The label at the index.
function getRoleLabel(uint256 index) external view returns (string memory);
/// @notice Returns the total number of assigned role labels.
function getRoleLabelCount() external view returns (uint256);
/// @notice Returns the list of role labels between the specified indexes.
/// @param start The starting index for the labeled role list.
/// @param end The ending index for the labeled role list.
/// @return The list of role labels.
function getRoleLabels(uint256 start, uint256 end) external view returns (string[] memory);
/// @notice Returns whether the specified label is assigned to any tracked role.
/// @param label The label string.
function isLabelAssigned(string calldata label) external view returns (bool);
/// @notice Returns whether the given role has been labeled.
/// @param roleId The identifier of the role.
function isRoleLabeled(uint64 roleId) external view returns (bool);
/// @notice Returns the label of a specified role.
/// @dev `PUBLIC_ROLE` and `ADMIN_ROLE` cannot be labeled.
/// @dev Reverts with `AccessManagerUnlabeledRole` if the role has no assigned label.
/// @param roleId The identifier of the role.
/// @return The label of the role.
function getLabelOfRole(uint64 roleId) external view returns (string memory);
/// @notice Returns the role identifier for the specified label.
/// @dev Reverts with `AccessManagerUnregisteredLabel` if the label is not assigned to any role.
/// @param label The label string.
/// @return The identifier of the role.
function getRoleOfLabel(string calldata label) external view returns (uint64);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/config-engine/AaveV4Payload.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {Address} from 'src/dependencies/openzeppelin/Address.sol';
import {IAaveV4ConfigEngine} from 'src/config-engine/interfaces/IAaveV4ConfigEngine.sol';
/// @title AaveV4Payload
/// @author Aave Labs
/// @notice Abstract base payload contract for Aave V4 governance proposals.
abstract contract AaveV4Payload {
using Address for address;
/// @notice The config engine used to execute payload actions via delegatecall.
IAaveV4ConfigEngine public immutable CONFIG_ENGINE;
/// @dev Thrown when the config engine address is zero.
error InvalidConfigEngine();
/// @param configEngine_ The IAaveV4ConfigEngine implementation to delegatecall into.
constructor(IAaveV4ConfigEngine configEngine_) {
require(address(configEngine_) != address(0), InvalidConfigEngine());
CONFIG_ENGINE = configEngine_;
}
/// @notice Main execution entry point called by governance. Runs all configured actions.
/// @dev Expected to be called by a governance executor. No on-chain access control is applied;
/// the caller is responsible for authorization. Idempotency is not guaranteed.
function execute() external {
_preExecute();
_executeAccessManagerActions();
_executeHubActions();
_executeSpokeActions();
_executePositionManagerActions();
_postExecute();
}
/// @notice Returns the Hub asset listings to execute. Override to provide listings.
/// @return An array of AssetListing structs (empty by default).
function hubAssetListings()
public
view
virtual
returns (IAaveV4ConfigEngine.AssetListing[] memory)
{
return new IAaveV4ConfigEngine.AssetListing[](0);
}
/// @notice Returns the Hub asset config updates to execute. Override to provide updates.
/// @return An array of AssetConfigUpdate structs (empty by default).
function hubAssetConfigUpdates()
public
view
virtual
returns (IAaveV4ConfigEngine.AssetConfigUpdate[] memory)
{
return new IAaveV4ConfigEngine.AssetConfigUpdate[](0);
}
/// @notice Returns the Hub Spoke-to-assets additions to execute. Override to provide additions.
/// @return An array of SpokeToAssetsAddition structs (empty by default).
function hubSpokeToAssetsAdditions()
public
view
virtual
returns (IAaveV4ConfigEngine.SpokeToAssetsAddition[] memory)
{
return new IAaveV4ConfigEngine.SpokeToAssetsAddition[](0);
}
/// @notice Returns the Hub Spoke config updates to execute. Override to provide updates.
/// @return An array of SpokeConfigUpdate structs (empty by default).
function hubSpokeConfigUpdates()
public
view
virtual
returns (IAaveV4ConfigEngine.SpokeConfigUpdate[] memory)
{
return new IAaveV4ConfigEngine.SpokeConfigUpdate[](0);
}
/// @notice Returns the Hub asset halts to execute. Override to provide halts.
/// @return An array of AssetHalt structs (empty by default).
function hubAssetHalts() public view virtual returns (IAaveV4ConfigEngine.AssetHalt[] memory) {
return new IAaveV4ConfigEngine.AssetHalt[](0);
}
/// @notice Returns the Hub asset deactivations to execute. Override to provide deactivations.
/// @return An array of AssetDeactivation structs (empty by default).
function hubAssetDeactivations()
public
view
virtual
returns (IAaveV4ConfigEngine.AssetDeactivation[] memory)
{
return new IAaveV4ConfigEngine.AssetDeactivation[](0);
}
/// @notice Returns the Hub asset caps resets to execute. Override to provide resets.
/// @return An array of AssetCapsReset structs (empty by default).
function hubAssetCapsResets()
public
view
virtual
returns (IAaveV4ConfigEngine.AssetCapsReset[] memory)
{
return new IAaveV4ConfigEngine.AssetCapsReset[](0);
}
/// @notice Returns the Hub Spoke deactivations to execute. Override to provide deactivations.
/// @return An array of SpokeDeactivation structs (empty by default).
function hubSpokeDeactivations()
public
view
virtual
returns (IAaveV4ConfigEngine.SpokeDeactivation[] memory)
{
return new IAaveV4ConfigEngine.SpokeDeactivation[](0);
}
/// @notice Returns the Hub Spoke caps resets to execute. Override to provide resets.
/// @return An array of SpokeCapsReset structs (empty by default).
function hubSpokeCapsResets()
public
view
virtual
returns (IAaveV4ConfigEngine.SpokeCapsReset[] memory)
{
return new IAaveV4ConfigEngine.SpokeCapsReset[](0);
}
/// @notice Returns the Spoke reserve listings to execute. Override to provide listings.
/// @return An array of ReserveListing structs (empty by default).
function spokeReserveListings()
public
view
virtual
returns (IAaveV4ConfigEngine.ReserveListing[] memory)
{
return new IAaveV4ConfigEngine.ReserveListing[](0);
}
/// @notice Returns the Spoke reserve config updates to execute. Override to provide updates.
/// @return An array of ReserveConfigUpdate structs (empty by default).
function spokeReserveConfigUpdates()
public
view
virtual
returns (IAaveV4ConfigEngine.ReserveConfigUpdate[] memory)
{
return new IAaveV4ConfigEngine.ReserveConfigUpdate[](0);
}
/// @notice Returns the Spoke liquidation config updates to execute. Override to provide updates.
/// @return An array of LiquidationConfigUpdate structs (empty by default).
function spokeLiquidationConfigUpdates()
public
view
virtual
returns (IAaveV4ConfigEngine.LiquidationConfigUpdate[] memory)
{
return new IAaveV4ConfigEngine.LiquidationConfigUpdate[](0);
}
/// @notice Returns the Spoke dynamic reserve config additions to execute. Override to provide additions.
/// @return An array of DynamicReserveConfigAddition structs (empty by default).
function spokeDynamicReserveConfigAdditions()
public
view
virtual
returns (IAaveV4ConfigEngine.DynamicReserveConfigAddition[] memory)
{
return new IAaveV4ConfigEngine.DynamicReserveConfigAddition[](0);
}
/// @notice Returns the Spoke dynamic reserve config updates to execute. Override to provide updates.
/// @return An array of DynamicReserveConfigUpdate structs (empty by default).
function spokeDynamicReserveConfigUpdates()
public
view
virtual
returns (IAaveV4ConfigEngine.DynamicReserveConfigUpdate[] memory)
{
return new IAaveV4ConfigEngine.DynamicReserveConfigUpdate[](0);
}
/// @notice Returns the Spoke position manager updates to execute. Override to provide updates.
/// @return An array of PositionManagerUpdate structs (empty by default).
function spokePositionManagerUpdates()
public
view
virtual
returns (IAaveV4ConfigEngine.PositionManagerUpdate[] memory)
{
return new IAaveV4ConfigEngine.PositionManagerUpdate[](0);
}
/// @notice Returns the access manager role memberships to execute. Override to provide memberships.
/// @return An array of RoleMembership structs (empty by default).
function accessManagerRoleMemberships()
public
view
virtual
returns (IAaveV4ConfigEngine.RoleMembership[] memory)
{
return new IAaveV4ConfigEngine.RoleMembership[](0);
}
/// @notice Returns the access manager role updates to execute. Override to provide updates.
/// @return An array of RoleUpdate structs (empty by default).
function accessManagerRoleUpdates()
public
view
virtual
returns (IAaveV4ConfigEngine.RoleUpdate[] memory)
{
return new IAaveV4ConfigEngine.RoleUpdate[](0);
}
/// @notice Returns the access manager target function role updates to execute. Override to provide updates.
/// @return An array of TargetFunctionRoleUpdate structs (empty by default).
function accessManagerTargetFunctionRoleUpdates()
public
view
virtual
returns (IAaveV4ConfigEngine.TargetFunctionRoleUpdate[] memory)
{
return new IAaveV4ConfigEngine.TargetFunctionRoleUpdate[](0);
}
/// @notice Returns the access manager target admin delay updates to execute. Override to provide updates.
/// @return An array of TargetAdminDelayUpdate structs (empty by default).
function accessManagerTargetAdminDelayUpdates()
public
view
virtual
returns (IAaveV4ConfigEngine.TargetAdminDelayUpdate[] memory)
{
return new IAaveV4ConfigEngine.TargetAdminDelayUpdate[](0);
}
/// @notice Returns the position manager Spoke registrations to execute. Override to provide registrations.
/// @return An array of SpokeRegistration structs (empty by default).
function positionManagerSpokeRegistrations()
public
view
virtual
returns (IAaveV4ConfigEngine.SpokeRegistration[] memory)
{
return new IAaveV4ConfigEngine.SpokeRegistration[](0);
}
/// @notice Returns the position manager role renouncements to execute. Override to provide renouncements.
/// @return An array of PositionManagerRoleRenouncement structs (empty by default).
function positionManagerRoleRenouncements()
public
view
virtual
returns (IAaveV4ConfigEngine.PositionManagerRoleRenouncement[] memory)
{
return new IAaveV4ConfigEngine.PositionManagerRoleRenouncement[](0);
}
/// @notice Executes all hub-related configuration actions via delegatecall to the engine.
function _executeHubActions() internal {
IAaveV4ConfigEngine.AssetListing[] memory listings = hubAssetListings();
if (listings.length > 0) {
_delegateCallEngine(abi.encodeCall(IAaveV4ConfigEngine.executeHubAssetListings, (listings)));
}
IAaveV4ConfigEngine.AssetConfigUpdate[] memory assetConfigUpdates = hubAssetConfigUpdates();
if (assetConfigUpdates.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeHubAssetConfigUpdates, (assetConfigUpdates))
);
}
IAaveV4ConfigEngine.SpokeToAssetsAddition[]
memory spokeToAssetsAdds = hubSpokeToAssetsAdditions();
if (spokeToAssetsAdds.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeHubSpokeToAssetsAdditions, (spokeToAssetsAdds))
);
}
IAaveV4ConfigEngine.SpokeConfigUpdate[] memory spokeConfigUpdates = hubSpokeConfigUpdates();
if (spokeConfigUpdates.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeHubSpokeConfigUpdates, (spokeConfigUpdates))
);
}
IAaveV4ConfigEngine.AssetHalt[] memory assetHalts = hubAssetHalts();
if (assetHalts.length > 0) {
_delegateCallEngine(abi.encodeCall(IAaveV4ConfigEngine.executeHubAssetHalts, (assetHalts)));
}
IAaveV4ConfigEngine.AssetDeactivation[] memory assetDeactivations = hubAssetDeactivations();
if (assetDeactivations.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeHubAssetDeactivations, (assetDeactivations))
);
}
IAaveV4ConfigEngine.AssetCapsReset[] memory assetCapsResets = hubAssetCapsResets();
if (assetCapsResets.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeHubAssetCapsResets, (assetCapsResets))
);
}
IAaveV4ConfigEngine.SpokeDeactivation[] memory spokeDeactivations = hubSpokeDeactivations();
if (spokeDeactivations.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeHubSpokeDeactivations, (spokeDeactivations))
);
}
IAaveV4ConfigEngine.SpokeCapsReset[] memory spokeCapsResets = hubSpokeCapsResets();
if (spokeCapsResets.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeHubSpokeCapsResets, (spokeCapsResets))
);
}
}
/// @notice Executes all Spoke-related configuration actions via delegatecall to the engine.
function _executeSpokeActions() internal {
IAaveV4ConfigEngine.ReserveListing[] memory reserveListings = spokeReserveListings();
if (reserveListings.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeSpokeReserveListings, (reserveListings))
);
}
IAaveV4ConfigEngine.ReserveConfigUpdate[]
memory reserveConfigUpdates = spokeReserveConfigUpdates();
if (reserveConfigUpdates.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeSpokeReserveConfigUpdates, (reserveConfigUpdates))
);
}
IAaveV4ConfigEngine.LiquidationConfigUpdate[]
memory liqConfigUpdates = spokeLiquidationConfigUpdates();
if (liqConfigUpdates.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeSpokeLiquidationConfigUpdates, (liqConfigUpdates))
);
}
IAaveV4ConfigEngine.DynamicReserveConfigAddition[]
memory dynAdds = spokeDynamicReserveConfigAdditions();
if (dynAdds.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeSpokeDynamicReserveConfigAdditions, (dynAdds))
);
}
IAaveV4ConfigEngine.DynamicReserveConfigUpdate[]
memory dynUpdates = spokeDynamicReserveConfigUpdates();
if (dynUpdates.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeSpokeDynamicReserveConfigUpdates, (dynUpdates))
);
}
IAaveV4ConfigEngine.PositionManagerUpdate[] memory pmUpdates = spokePositionManagerUpdates();
if (pmUpdates.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeSpokePositionManagerUpdates, (pmUpdates))
);
}
}
/// @notice Executes all Access Manager configuration actions via delegatecall to the engine.
function _executeAccessManagerActions() internal {
IAaveV4ConfigEngine.RoleMembership[] memory memberships = accessManagerRoleMemberships();
if (memberships.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeRoleMemberships, (memberships))
);
}
IAaveV4ConfigEngine.RoleUpdate[] memory roleUpdates = accessManagerRoleUpdates();
if (roleUpdates.length > 0) {
_delegateCallEngine(abi.encodeCall(IAaveV4ConfigEngine.executeRoleUpdates, (roleUpdates)));
}
IAaveV4ConfigEngine.TargetFunctionRoleUpdate[]
memory fnRoleUpdates = accessManagerTargetFunctionRoleUpdates();
if (fnRoleUpdates.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeTargetFunctionRoleUpdates, (fnRoleUpdates))
);
}
IAaveV4ConfigEngine.TargetAdminDelayUpdate[]
memory targetDelayUpdates = accessManagerTargetAdminDelayUpdates();
if (targetDelayUpdates.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executeTargetAdminDelayUpdates, (targetDelayUpdates))
);
}
}
/// @notice Executes all Position Manager configuration actions via delegatecall to the engine.
/// @dev PositionManager Role renouncements happen before Spoke registrations: renouncing requires the
/// Spoke to still be registered on the position manager itself.
function _executePositionManagerActions() internal {
IAaveV4ConfigEngine.PositionManagerRoleRenouncement[]
memory renouncements = positionManagerRoleRenouncements();
if (renouncements.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executePositionManagerRoleRenouncements, (renouncements))
);
}
IAaveV4ConfigEngine.SpokeRegistration[] memory spokeRegs = positionManagerSpokeRegistrations();
if (spokeRegs.length > 0) {
_delegateCallEngine(
abi.encodeCall(IAaveV4ConfigEngine.executePositionManagerSpokeRegistrations, (spokeRegs))
);
}
}
/// @notice Delegatecalls the config engine with the given calldata.
/// @param data The ABI-encoded function call to forward to CONFIG_ENGINE.
/// @dev Bubbles up any revert reason from the engine call. Assumes the engine functions return no data.
function _delegateCallEngine(bytes memory data) internal {
address(CONFIG_ENGINE).functionDelegateCall(data);
}
/// @notice Hook called before executing any actions. Override to add pre-execution logic.
function _preExecute() internal virtual {}
/// @notice Hook called after executing all actions. Override to add post-execution logic.
function _postExecute() internal virtual {}
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/config-engine/interfaces/IAaveV4ConfigEngine.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IHubConfigurator} from 'src/hub/interfaces/IHubConfigurator.sol';
import {ISpokeConfigurator} from 'src/spoke/interfaces/ISpokeConfigurator.sol';
import {IHub} from 'src/hub/interfaces/IHub.sol';
import {ISpoke} from 'src/spoke/interfaces/ISpoke.sol';
import {IAssetInterestRateStrategy} from 'src/hub/interfaces/IAssetInterestRateStrategy.sol';
/// @title IAaveV4ConfigEngine
/// @author Aave Labs
/// @notice Interface for the Aave V4 Config Engine, defining all structs and engine method signatures.
/// The engine is stateless and invoked via delegatecall from payload contracts.
/// All numeric fields in config structs use uint256 so that type(uint256).max can serve as
/// the universal KEEP_CURRENT sentinel. Boolean fields use uint256 (0=false, 1=true, KEEP_CURRENT=skip).
interface IAaveV4ConfigEngine {
/// @notice Parameters for tokenization of an asset on a Hub when listing the asset.
/// @dev Tokenization is skipped only when all fields are unset. Otherwise `name`, `symbol` and
/// `proxyAdminOwner` are all required; a partially set config reverts.
/// @dev addCap The add cap for the TokenizationSpoke.
/// @dev proxyAdminOwner The owner to set on the ProxyAdmin of the deployed TokenizationSpoke (address(0) when unset).
/// @dev name The name for the TokenizationSpoke ('' when unset).
/// @dev symbol The symbol for the TokenizationSpoke ('' when unset).
struct TokenizationSpokeConfig {
uint256 addCap;
address proxyAdminOwner;
string name;
string symbol;
}
/// @notice Parameters for listing a new asset on a Hub.
/// @dev hubConfigurator The HubConfigurator to use for this action.
/// @dev hub The address of the Hub.
/// @dev underlying The address of the underlying asset.
/// @dev feeReceiver The address of the fee receiver Spoke.
/// @dev liquidityFee The liquidity fee of the asset, in BPS.
/// @dev irStrategy The address of the interest rate strategy contract.
/// @dev irData The interest rate data to apply to the given asset.
/// @dev tokenization The tokenization configuration for the asset.
struct AssetListing {
IHubConfigurator hubConfigurator;
address hub;
address underlying;
address feeReceiver;
uint256 liquidityFee;
address irStrategy;
IAssetInterestRateStrategy.InterestRateData irData;
TokenizationSpokeConfig tokenization;
}
/// @notice Parameters for updating asset config (fee, interest rate, reinvestment) on a Hub.
/// @dev hubConfigurator The HubConfigurator to use for this action.
/// @dev hub The address of the Hub.
/// @dev underlying The address of the underlying asset.
/// @dev liquidityFee The new liquidity fee (KEEP_CURRENT to skip).
/// @dev feeReceiver The new fee receiver (KEEP_CURRENT_ADDRESS to skip).
/// @dev irStrategy The new interest rate strategy (KEEP_CURRENT_ADDRESS to skip strategy update).
/// @dev irData The interest rate data. If irStrategy != KEEP_CURRENT_ADDRESS, calls updateInterestRateStrategy.
/// Otherwise individual fields use KEEP_CURRENT_UINT16/KEEP_CURRENT_UINT32 sentinels;
/// non-sentinel fields trigger a read-modify-write via updateInterestRateData.
/// @dev reinvestmentController The new reinvestment controller (KEEP_CURRENT_ADDRESS to skip).
struct AssetConfigUpdate {
IHubConfigurator hubConfigurator;
address hub;
address underlying;
uint256 liquidityFee;
address feeReceiver;
address irStrategy;
IAssetInterestRateStrategy.InterestRateData irData;
address reinvestmentController;
}
/// @notice Pairs an underlying asset address with its Spoke configuration.
/// @dev underlying The address of the underlying asset.
/// @dev config The Spoke configuration for the asset.
struct SpokeAssetConfig {
address underlying;
IHub.SpokeConfig config;
}
/// @notice Parameters for registering a Spoke for multiple assets on a Hub.
/// @dev hubConfigurator The HubConfigurator to use for this action.
/// @dev hub The address of the Hub.
/// @dev spoke The address of the Spoke.
/// @dev assets The list of underlying assets with their Spoke configurations.
struct SpokeToAssetsAddition {
IHubConfigurator hubConfigurator;
address hub;
address spoke;
SpokeAssetConfig[] assets;
}
/// @notice Parameters for updating Spoke config (caps, risk premium threshold, status) on a Hub.
/// @dev hubConfigurator The HubConfigurator to use for this action.
/// @dev hub The address of the Hub.
/// @dev underlying The address of the underlying asset.
/// @dev spoke The address of the Spoke.
/// @dev addCap The new add cap (KEEP_CURRENT to skip).
/// @dev drawCap The new draw cap (KEEP_CURRENT to skip).
/// @dev riskPremiumThreshold The new risk premium threshold (KEEP_CURRENT to skip).
/// @dev active New active flag (0=false, 1=true, KEEP_CURRENT=skip).
/// @dev halted New halted flag (0=false, 1=true, KEEP_CURRENT=skip).
struct SpokeConfigUpdate {
IHubConfigurator hubConfigurator;
address hub;
address underlying;
address spoke;
uint256 addCap;
uint256 drawCap;
uint256 riskPremiumThreshold;
uint256 active;
uint256 halted;
}
/// @notice Parameters for halting an asset on a Hub.
/// @dev hubConfigurator The HubConfigurator to use for this action.
/// @dev hub The address of the Hub.
/// @dev underlying The address of the underlying asset.
struct AssetHalt {
IHubConfigurator hubConfigurator;
address hub;
address underlying;
}
/// @notice Parameters for deactivating an asset on a Hub.
/// @dev hubConfigurator The HubConfigurator to use for this action.
/// @dev hub The address of the Hub.
/// @dev underlying The address of the underlying asset.
struct AssetDeactivation {
IHubConfigurator hubConfigurator;
address hub;
address underlying;
}
/// @notice Parameters for resetting asset caps on a Hub to 0.
/// @dev hubConfigurator The HubConfigurator to use for this action.
/// @dev hub The address of the Hub.
/// @dev underlying The address of the underlying asset.
struct AssetCapsReset {
IHubConfigurator hubConfigurator;
address hub;
address underlying;
}
/// @notice Parameters for deactivating a Spoke on a Hub.
/// @dev hubConfigurator The HubConfigurator to use for this action.
/// @dev hub The address of the Hub.
/// @dev spoke The address of the Spoke.
struct SpokeDeactivation {
IHubConfigurator hubConfigurator;
address hub;
address spoke;
}
/// @notice Parameters for resetting Spoke caps on a Hub.
/// @dev hubConfigurator The HubConfigurator to use for this action.
/// @dev hub The address of the Hub.
/// @dev spoke The address of the Spoke.
struct SpokeCapsReset {
IHubConfigurator hubConfigurator;
address hub;
address spoke;
}
/// @notice Parameters for listing a new reserve on a Spoke.
/// @dev spokeConfigurator The SpokeConfigurator to use for this action.
/// @dev spoke The address of the Spoke.
/// @dev hub The address of the Hub.
/// @dev underlying The address of the underlying asset.
/// @dev priceSource The address of the price source.
/// @dev config The configuration of the reserve.
/// @dev dynamicConfig The dynamic configuration of the reserve.
struct ReserveListing {
ISpokeConfigurator spokeConfigurator;
address spoke;
address hub;
address underlying;
address priceSource;
ISpoke.ReserveConfig config;
ISpoke.DynamicReserveConfig dynamicConfig;
}
/// @notice Parameters for updating reserve config on a Spoke.
/// @dev spokeConfigurator The SpokeConfigurator to use for this action.
/// @dev spoke The address of the Spoke.
/// @dev hub The address of the Hub.
/// @dev underlying The address of the underlying asset.
/// @dev priceSource The new price source address (KEEP_CURRENT_ADDRESS to skip).
/// @dev collateralRisk New collateral risk (KEEP_CURRENT to skip).
/// @dev paused New paused flag (0=false, 1=true, KEEP_CURRENT=skip).
/// @dev frozen New frozen flag (0=false, 1=true, KEEP_CURRENT=skip).
/// @dev borrowable New borrowable flag (0=false, 1=true, KEEP_CURRENT=skip).
/// @dev receiveSharesEnabled New receiveSharesEnabled flag (0=false, 1=true, KEEP_CURRENT=skip).
struct ReserveConfigUpdate {
ISpokeConfigurator spokeConfigurator;
address spoke;
address hub;
address underlying;
address priceSource;
uint256 collateralRisk;
uint256 paused;
uint256 frozen;
uint256 borrowable;
uint256 receiveSharesEnabled;
}
/// @notice Parameters for updating liquidation config on a Spoke.
/// @dev spokeConfigurator The SpokeConfigurator to use for this action.
/// @dev spoke The address of the Spoke.
/// @dev targetHealthFactor The new target health factor (KEEP_CURRENT to skip).
/// @dev healthFactorForMaxBonus The new health factor for max bonus (KEEP_CURRENT to skip).
/// @dev liquidationBonusFactor The new liquidation bonus factor (KEEP_CURRENT to skip).
struct LiquidationConfigUpdate {
ISpokeConfigurator spokeConfigurator;
address spoke;
uint256 targetHealthFactor;
uint256 healthFactorForMaxBonus;
uint256 liquidationBonusFactor;
}
/// @notice Parameters for adding a dynamic reserve config on a Spoke.
/// @dev spokeConfigurator The SpokeConfigurator to use for this action.
/// @dev spoke The address of the Spoke.
/// @dev hub The address of the Hub.
/// @dev underlying The address of the underlying asset.
/// @dev dynamicConfig The new dynamic config.
struct DynamicReserveConfigAddition {
ISpokeConfigurator spokeConfigurator;
address spoke;
address hub;
address underlying;
ISpoke.DynamicReserveConfig dynamicConfig;
}
/// @notice Parameters for updating a dynamic reserve config on a Spoke.
/// @dev spokeConfigurator The SpokeConfigurator to use for this action.
/// @dev spoke The address of the Spoke.
/// @dev hub The address of the Hub.
/// @dev underlying The address of the underlying asset.
/// @dev dynamicConfigKey The key of the dynamic config to update.
/// @dev collateralFactor New collateral factor (KEEP_CURRENT to skip).
/// @dev maxLiquidationBonus New max liquidation bonus (KEEP_CURRENT to skip).
/// @dev liquidationFee New liquidation fee (KEEP_CURRENT to skip).
struct DynamicReserveConfigUpdate {
ISpokeConfigurator spokeConfigurator;
address spoke;
address hub;
address underlying;
uint256 dynamicConfigKey;
uint256 collateralFactor;
uint256 maxLiquidationBonus;
uint256 liquidationFee;
}
/// @notice Parameters for updating a position manager on a Spoke.
/// @dev spokeConfigurator The SpokeConfigurator to use for this action.
/// @dev spoke The address of the Spoke.
/// @dev positionManager The address of the position manager.
/// @dev active The new active flag.
struct PositionManagerUpdate {
ISpokeConfigurator spokeConfigurator;
address spoke;
address positionManager;
bool active;
}
/// @notice Parameters for registering/deregistering a Spoke on a position manager.
/// @dev positionManager The position manager address.
/// @dev spoke The address of the Spoke.
/// @dev registered Whether to register (true) or deregister (false) the Spoke.
struct SpokeRegistration {
address positionManager;
address spoke;
bool registered;
}
/// @notice Parameters for renouncing the position manager role for a user on a Spoke.
/// @dev positionManager The position manager address.
/// @dev spoke The address of the Spoke.
/// @dev user The address of the user to renounce the role for.
struct PositionManagerRoleRenouncement {
address positionManager;
address spoke;
address user;
}
/// @notice Parameters for granting or revoking a role via AccessManager.
/// @dev When granted=true → grantRole(roleId, account, executionDelay).
/// @dev When granted=false → revokeRole(roleId, account). executionDelay is ignored.
/// @dev authority The AccessManager address.
/// @dev roleId The role identifier.
/// @dev account The account to grant/revoke the role to/from.
/// @dev granted Whether to grant (true) or revoke (false) the role.
/// @dev executionDelay The execution delay for the account (only used when granted=true).
struct RoleMembership {
address authority;
uint64 roleId;
address account;
bool granted;
uint32 executionDelay;
}
/// @notice Parameters for updating role configuration via AccessManager.
/// @dev Uses type-specific sentinels to skip fields: KEEP_CURRENT_UINT64 for admin/guardian,
/// KEEP_CURRENT_UINT32 for grantDelay, empty string for label.
/// @dev authority The AccessManager address.
/// @dev roleId The role identifier.
/// @dev admin The new admin role identifier (KEEP_CURRENT_UINT64 to skip).
/// @dev guardian The new guardian role identifier (KEEP_CURRENT_UINT64 to skip).
/// @dev grantDelay The new grant delay (KEEP_CURRENT_UINT32 to skip).
/// @dev label The label string (empty string to skip).
/// @dev labelUpdate Must be true to relabel an already-labeled role (clears the existing label first).
struct RoleUpdate {
address authority;
uint64 roleId;
uint64 admin;
uint64 guardian;
uint32 grantDelay;
string label;
bool labelUpdate;
}
/// @notice Parameters for setting target function roles via AccessManager.
/// @dev authority The AccessManager address.
/// @dev target The target contract address.
/// @dev selectors The function selectors.
/// @dev roleId The role identifier.
struct TargetFunctionRoleUpdate {
address authority;
address target;
bytes4[] selectors;
uint64 roleId;
}
/// @notice Parameters for setting target admin delay via AccessManager.
/// @dev authority The AccessManager address.
/// @dev target The target contract address.
/// @dev newDelay The new admin delay.
struct TargetAdminDelayUpdate {
address authority;
address target;
uint32 newDelay;
}
/// @notice Lists new assets on Hubs via the HubConfigurator.
/// @param listings The asset listings to execute.
function executeHubAssetListings(AssetListing[] calldata listings) external;
/// @notice Updates asset config (fee, interest rate, reinvestment) on Hubs.
/// @param updates The asset config updates to execute.
function executeHubAssetConfigUpdates(AssetConfigUpdate[] calldata updates) external;
/// @notice Registers Spokes for multiple assets on Hubs.
/// @param additions The Spoke-to-assets additions to execute.
function executeHubSpokeToAssetsAdditions(SpokeToAssetsAddition[] calldata additions) external;
/// @notice Updates Spoke config (caps, risk premium threshold, status) on Hubs.
/// @param updates The Spoke config updates to execute.
function executeHubSpokeConfigUpdates(SpokeConfigUpdate[] calldata updates) external;
/// @notice Halts assets on Hubs.
/// @param halts The asset halts to execute.
function executeHubAssetHalts(AssetHalt[] calldata halts) external;
/// @notice Deactivates assets on Hubs.
/// @param deactivations The asset deactivations to execute.
function executeHubAssetDeactivations(AssetDeactivation[] calldata deactivations) external;
/// @notice Resets asset caps on Hubs.
/// @param resets The asset caps resets to execute.
function executeHubAssetCapsResets(AssetCapsReset[] calldata resets) external;
/// @notice Deactivates Spokes on Hubs.
/// @param deactivations The Spoke deactivations to execute.
function executeHubSpokeDeactivations(SpokeDeactivation[] calldata deactivations) external;
/// @notice Resets Spoke caps on Hubs.
/// @param resets The Spoke caps resets to execute.
function executeHubSpokeCapsResets(SpokeCapsReset[] calldata resets) external;
/// @notice Lists new reserves on Spokes.
/// @param listings The reserve listings to execute.
function executeSpokeReserveListings(ReserveListing[] calldata listings) external;
/// @notice Updates reserve config on Spokes.
/// @param updates The reserve config updates to execute.
function executeSpokeReserveConfigUpdates(ReserveConfigUpdate[] calldata updates) external;
/// @notice Updates liquidation config on Spokes.
/// @param updates The liquidation config updates to execute.
function executeSpokeLiquidationConfigUpdates(
LiquidationConfigUpdate[] calldata updates
) external;
/// @notice Adds dynamic reserve configs on Spokes.
/// @param additions The dynamic reserve config additions to execute.
function executeSpokeDynamicReserveConfigAdditions(
DynamicReserveConfigAddition[] calldata additions
) external;
/// @notice Updates dynamic reserve configs on Spokes.
/// @param updates The dynamic reserve config updates to execute.
function executeSpokeDynamicReserveConfigUpdates(
DynamicReserveConfigUpdate[] calldata updates
) external;
/// @notice Updates position managers on Spokes.
/// @param updates The position manager updates to execute.
function executeSpokePositionManagerUpdates(PositionManagerUpdate[] calldata updates) external;
/// @notice Registers/deregisters Spokes on position managers.
/// @param registrations The Spoke registrations to execute.
function executePositionManagerSpokeRegistrations(
SpokeRegistration[] calldata registrations
) external;
/// @notice Renounces position manager roles for users on Spokes.
/// @param renouncements The role renouncements to execute.
function executePositionManagerRoleRenouncements(
PositionManagerRoleRenouncement[] calldata renouncements
) external;
/// @notice Grants or revokes roles via AccessManager.
/// @param memberships The role memberships to execute.
function executeRoleMemberships(RoleMembership[] calldata memberships) external;
/// @notice Updates role configuration (admin, guardian, grant delay, label) via AccessManager.
/// @dev Set labelUpdate to true to relabel an already-labeled role (the existing label is cleared
/// first); labeling an already-labeled role with labelUpdate false reverts.
/// Clearing a label without setting a new one requires a direct `labelRole` call.
/// @param updates The role updates to execute.
function executeRoleUpdates(RoleUpdate[] calldata updates) external;
/// @notice Updates target function roles via AccessManager.
/// @param updates The target function role updates to execute.
function executeTargetFunctionRoleUpdates(TargetFunctionRoleUpdate[] calldata updates) external;
/// @notice Updates target admin delays via AccessManager.
/// @param updates The target admin delay updates to execute.
function executeTargetAdminDelayUpdates(TargetAdminDelayUpdate[] calldata updates) external;
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (utils/Address.sol)
pragma solidity ^0.8.20;
import {Errors} from './Errors.sol';
import {LowLevelCall} from './LowLevelCall.sol';
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert Errors.InsufficientBalance(address(this).balance, amount);
}
if (LowLevelCall.callNoReturn(recipient, amount, '')) {
// call successful, nothing to do
return;
} else if (LowLevelCall.returnDataSize() > 0) {
LowLevelCall.bubbleRevert();
} else {
revert Errors.FailedCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {Errors.FailedCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance(address(this).balance, value);
}
bool success = LowLevelCall.callNoReturn(target, value, data);
if (success && (LowLevelCall.returnDataSize() > 0 || target.code.length > 0)) {
return LowLevelCall.returnData();
} else if (success) {
revert AddressEmptyCode(target);
} else if (LowLevelCall.returnDataSize() > 0) {
LowLevelCall.bubbleRevert();
} else {
revert Errors.FailedCall();
}
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(
address target,
bytes memory data
) internal view returns (bytes memory) {
bool success = LowLevelCall.staticcallNoReturn(target, data);
if (success && (LowLevelCall.returnDataSize() > 0 || target.code.length > 0)) {
return LowLevelCall.returnData();
} else if (success) {
revert AddressEmptyCode(target);
} else if (LowLevelCall.returnDataSize() > 0) {
LowLevelCall.bubbleRevert();
} else {
revert Errors.FailedCall();
}
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
bool success = LowLevelCall.delegatecallNoReturn(target, data);
if (success && (LowLevelCall.returnDataSize() > 0 || target.code.length > 0)) {
return LowLevelCall.returnData();
} else if (success) {
revert AddressEmptyCode(target);
} else if (LowLevelCall.returnDataSize() > 0) {
LowLevelCall.bubbleRevert();
} else {
revert Errors.FailedCall();
}
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case
* of an unsuccessful call.
*
* NOTE: This function is DEPRECATED and may be removed in the next major release.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (success && (returndata.length > 0 || target.code.length > 0)) {
return returndata;
} else if (success) {
revert AddressEmptyCode(target);
} else if (returndata.length > 0) {
LowLevelCall.bubbleRevert(returndata);
} else {
revert Errors.FailedCall();
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {Errors.FailedCall} error.
*/
function verifyCallResult(
bool success,
bytes memory returndata
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else if (returndata.length > 0) {
LowLevelCall.bubbleRevert(returndata);
} else {
revert Errors.FailedCall();
}
}
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/Errors.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of common custom errors used in multiple contracts
*
* IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
* It is recommended to avoid relying on the error API for critical functionality.
*
* _Available since v5.1._
*/
library Errors {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error InsufficientBalance(uint256 balance, uint256 needed);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedCall();
/**
* @dev The deployment failed.
*/
error FailedDeployment();
/**
* @dev A necessary precompile is missing.
*/
error MissingPrecompile(address);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/IAccessManaged.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (access/manager/IAccessManaged.sol)
pragma solidity >=0.8.4;
interface IAccessManaged {
/**
* @dev Authority that manages this contract was updated.
*/
event AuthorityUpdated(address authority);
error AccessManagedUnauthorized(address caller);
error AccessManagedRequiredDelay(address caller, uint32 delay);
error AccessManagedInvalidAuthority(address authority);
/**
* @dev Returns the current authority.
*/
function authority() external view returns (address);
/**
* @dev Transfers control to a new authority. The caller must be the current authority.
*/
function setAuthority(address) external;
/**
* @dev Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is
* being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs
* attacker controlled calls.
*/
function isConsumingScheduledOp() external view returns (bytes4);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/IAccessManager.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (access/manager/IAccessManager.sol)
pragma solidity >=0.8.4;
interface IAccessManager {
/**
* @dev A delayed operation was scheduled.
*/
event OperationScheduled(
bytes32 indexed operationId,
uint32 indexed nonce,
uint48 schedule,
address caller,
address target,
bytes data
);
/**
* @dev A scheduled operation was executed.
*/
event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);
/**
* @dev A scheduled operation was canceled.
*/
event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);
/**
* @dev Informational labelling for a roleId.
*/
event RoleLabel(uint64 indexed roleId, string label);
/**
* @dev Emitted when `account` is granted `roleId`.
*
* NOTE: The meaning of the `since` argument depends on the `newMember` argument.
* If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,
* otherwise it indicates the execution delay for this account and roleId is updated.
*/
event RoleGranted(
uint64 indexed roleId,
address indexed account,
uint32 delay,
uint48 since,
bool newMember
);
/**
* @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.
*/
event RoleRevoked(uint64 indexed roleId, address indexed account);
/**
* @dev Role acting as admin over a given `roleId` is updated.
*/
event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);
/**
* @dev Role acting as guardian over a given `roleId` is updated.
*/
event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);
/**
* @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.
*/
event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);
/**
* @dev Target mode is updated (true = closed, false = open).
*/
event TargetClosed(address indexed target, bool closed);
/**
* @dev Role required to invoke `selector` on `target` is updated to `roleId`.
*/
event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);
/**
* @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.
*/
event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);
error AccessManagerAlreadyScheduled(bytes32 operationId);
error AccessManagerNotScheduled(bytes32 operationId);
error AccessManagerNotReady(bytes32 operationId);
error AccessManagerExpired(bytes32 operationId);
error AccessManagerLockedRole(uint64 roleId);
error AccessManagerBadConfirmation();
error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);
error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);
error AccessManagerUnauthorizedConsume(address target);
error AccessManagerUnauthorizedCancel(
address msgsender,
address caller,
address target,
bytes4 selector
);
error AccessManagerInvalidInitialAdmin(address initialAdmin);
/**
* @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with
* no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}
* & {execute} workflow.
*
* This function is usually called by the targeted contract to control immediate execution of restricted functions.
* Therefore we only return true if the call can be performed without any delay. If the call is subject to a
* previously set delay (not zero), then the function should return false and the caller should schedule the operation
* for future execution.
*
* If `allowed` is true, the delay can be disregarded and the operation can be immediately executed, otherwise
* the operation can be executed if and only if delay is greater than 0.
*
* NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that
* is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail
* to identify the indirect workflow, and will consider calls that require a delay to be forbidden.
*
* NOTE: This function does not report the permissions of the admin functions in the manager itself. These are defined by the
* {AccessManager} documentation.
*/
function canCall(
address caller,
address target,
bytes4 selector
) external view returns (bool allowed, uint32 delay);
/**
* @dev Expiration delay for scheduled proposals. Defaults to 1 week.
*
* IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,
* disabling any scheduling usage.
*/
function expiration() external view returns (uint32);
/**
* @dev Minimum setback for all delay updates, with the exception of execution delays. It
* can be increased without setback (and reset via {revokeRole} in the event of an
* accidental increase). Defaults to 5 days.
*/
function minSetback() external view returns (uint32);
/**
* @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.
*
* NOTE: When the manager itself is closed, admin functions are still accessible to avoid locking the contract.
*/
function isTargetClosed(address target) external view returns (bool);
/**
* @dev Get the role required to call a function.
*/
function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);
/**
* @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.
*/
function getTargetAdminDelay(address target) external view returns (uint32);
/**
* @dev Get the id of the role that acts as an admin for the given role.
*
* The admin permission is required to grant the role, revoke the role and update the execution delay to execute
* an operation that is restricted to this role.
*/
function getRoleAdmin(uint64 roleId) external view returns (uint64);
/**
* @dev Get the role that acts as a guardian for a given role.
*
* The guardian permission allows canceling operations that have been scheduled under the role.
*/
function getRoleGuardian(uint64 roleId) external view returns (uint64);
/**
* @dev Get the role current grant delay.
*
* Its value may change at any point without an event emitted following a call to {setGrantDelay}.
* Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.
*/
function getRoleGrantDelay(uint64 roleId) external view returns (uint32);
/**
* @dev Get the access details for a given account for a given role. These details include the timepoint at which
* membership becomes active, and the delay applied to all operations by this user that requires this permission
* level.
*
* Returns:
* [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.
* [1] Current execution delay for the account.
* [2] Pending execution delay for the account.
* [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.
*/
function getAccess(
uint64 roleId,
address account
) external view returns (uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect);
/**
* @dev Check if a given account currently has the permission level corresponding to a given role. Note that this
* permission might be associated with an execution delay. {getAccess} can provide more details.
*/
function hasRole(
uint64 roleId,
address account
) external view returns (bool isMember, uint32 executionDelay);
/**
* @dev Give a label to a role, for improved role discoverability by UIs.
*
* Requirements:
*
* - the caller must be a global admin
*
* Emits a {RoleLabel} event.
*/
function labelRole(uint64 roleId, string calldata label) external;
/**
* @dev Add `account` to `roleId`, or change its execution delay.
*
* This gives the account the authorization to call any function that is restricted to this role. An optional
* execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation
* that is restricted to members of this role. The user will only be able to execute the operation after the delay has
* passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).
*
* If the account has already been granted this role, the execution delay will be updated. This update is not
* immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is
* called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any
* operation executed in the 3 hours that follows this update was indeed scheduled before this update.
*
* Requirements:
*
* - the caller must be an admin for the role (see {getRoleAdmin})
* - granted role must not be the `PUBLIC_ROLE`
*
* Emits a {RoleGranted} event.
*/
function grantRole(uint64 roleId, address account, uint32 executionDelay) external;
/**
* @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has
* no effect.
*
* Requirements:
*
* - the caller must be an admin for the role (see {getRoleAdmin})
* - revoked role must not be the `PUBLIC_ROLE`
*
* Emits a {RoleRevoked} event if the account had the role.
*/
function revokeRole(uint64 roleId, address account) external;
/**
* @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in
* the role this call has no effect.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*
* Emits a {RoleRevoked} event if the account had the role.
*/
function renounceRole(uint64 roleId, address callerConfirmation) external;
/**
* @dev Change admin role for a given role.
*
* Requirements:
*
* - the caller must be a global admin
*
* Emits a {RoleAdminChanged} event
*/
function setRoleAdmin(uint64 roleId, uint64 admin) external;
/**
* @dev Change guardian role for a given role.
*
* Requirements:
*
* - the caller must be a global admin
*
* Emits a {RoleGuardianChanged} event
*/
function setRoleGuardian(uint64 roleId, uint64 guardian) external;
/**
* @dev Update the delay for granting a `roleId`.
*
* Requirements:
*
* - the caller must be a global admin
*
* Emits a {RoleGrantDelayChanged} event.
*/
function setGrantDelay(uint64 roleId, uint32 newDelay) external;
/**
* @dev Set the role required to call functions identified by the `selectors` in the `target` contract.
*
* Requirements:
*
* - the caller must be a global admin
*
* Emits a {TargetFunctionRoleUpdated} event per selector.
*/
function setTargetFunctionRole(
address target,
bytes4[] calldata selectors,
uint64 roleId
) external;
/**
* @dev Set the delay for changing the configuration of a given target contract.
*
* Requirements:
*
* - the caller must be a global admin
*
* Emits a {TargetAdminDelayUpdated} event.
*/
function setTargetAdminDelay(address target, uint32 newDelay) external;
/**
* @dev Set the closed flag for a contract.
*
* Closing the manager itself won't disable access to admin methods to avoid locking the contract.
*
* Requirements:
*
* - the caller must be a global admin
*
* Emits a {TargetClosed} event.
*/
function setTargetClosed(address target, bool closed) external;
/**
* @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the
* operation is not yet scheduled, has expired, was executed, or was canceled.
*/
function getSchedule(bytes32 id) external view returns (uint48);
/**
* @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never
* been scheduled.
*/
function getNonce(bytes32 id) external view returns (uint32);
/**
* @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to
* choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays
* required for the caller. The special value zero will automatically set the earliest possible time.
*
* Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when
* the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this
* scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.
*
* Emits a {OperationScheduled} event.
*
* NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If
* this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target
* contract if it is using standard Solidity ABI encoding.
*/
function schedule(
address target,
bytes calldata data,
uint48 when
) external returns (bytes32 operationId, uint32 nonce);
/**
* @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the
* execution delay is 0.
*
* Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the
* operation wasn't previously scheduled (if the caller doesn't have an execution delay).
*
* Emits an {OperationExecuted} event only if the call was scheduled and delayed.
*/
function execute(address target, bytes calldata data) external payable returns (uint32);
/**
* @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled
* operation that is cancelled.
*
* Requirements:
*
* - the caller must be the proposer, a guardian of the targeted function, or a global admin
*
* Emits a {OperationCanceled} event.
*/
function cancel(address caller, address target, bytes calldata data) external returns (uint32);
/**
* @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed
* (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.
*
* This is useful for contracts that want to enforce that calls targeting them were scheduled on the manager,
* with all the verifications that it implies.
*
* Emit a {OperationExecuted} event.
*/
function consumeScheduledOp(address caller, bytes calldata data) external;
/**
* @dev Hashing function for delayed operations.
*/
function hashOperation(
address caller,
address target,
bytes calldata data
) external view returns (bytes32);
/**
* @dev Changes the authority of a target managed by this manager instance.
*
* Requirements:
*
* - the caller must be a global admin
*/
function updateAuthority(address target, address newAuthority) external;
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity >=0.6.2;
import {IERC20} from './IERC20.sol';
/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[ERC-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC-20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/IERC2612.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC2612.sol)
pragma solidity >=0.6.2;
import {IERC20Permit} from './IERC20Permit.sol';
interface IERC2612 is IERC20Permit {}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/IERC4626.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (interfaces/IERC4626.sol)
pragma solidity >=0.6.2;
import {IERC20} from './IERC20.sol';
import {IERC20Metadata} from './IERC20Metadata.sol';
/**
* @dev Interface of the ERC-4626 "Tokenized Vault Standard", as defined in
* https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].
*/
interface IERC4626 is IERC20, IERC20Metadata {
event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);
event Withdraw(
address indexed sender,
address indexed receiver,
address indexed owner,
uint256 assets,
uint256 shares
);
/**
* @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.
*
* - MUST be an ERC-20 token contract.
* - MUST NOT revert.
*/
function asset() external view returns (address assetTokenAddress);
/**
* @dev Returns the total amount of the underlying asset that is “managed” by Vault.
*
* - SHOULD include any compounding that occurs from yield.
* - MUST be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT revert.
*/
function totalAssets() external view returns (uint256 totalManagedAssets);
/**
* @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal
* scenario where all the conditions are met.
*
* - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT show any variations depending on the caller.
* - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
* - MUST NOT revert.
*
* NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
* “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
* from.
*/
function convertToShares(uint256 assets) external view returns (uint256 shares);
/**
* @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal
* scenario where all the conditions are met.
*
* - MUST NOT be inclusive of any fees that are charged against assets in the Vault.
* - MUST NOT show any variations depending on the caller.
* - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.
* - MUST NOT revert.
*
* NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the
* “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and
* from.
*/
function convertToAssets(uint256 shares) external view returns (uint256 assets);
/**
* @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,
* through a deposit call.
*
* - MUST return a limited value if receiver is subject to some deposit limit.
* - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.
* - MUST NOT revert.
*/
function maxDeposit(address receiver) external view returns (uint256 maxAssets);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given
* current on-chain conditions.
*
* - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit
* call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called
* in the same transaction.
* - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the
* deposit would be accepted, regardless if the user has enough tokens approved, etc.
* - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by depositing.
*/
function previewDeposit(uint256 assets) external view returns (uint256 shares);
/**
* @dev Deposit `assets` underlying tokens and send the corresponding number of vault shares (`shares`) to `receiver`.
*
* - MUST emit the Deposit event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
* deposit execution, and are accounted for during deposit.
* - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not
* approving enough underlying tokens to the Vault contract, etc).
*
* NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
*/
function deposit(uint256 assets, address receiver) external returns (uint256 shares);
/**
* @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.
* - MUST return a limited value if receiver is subject to some mint limit.
* - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.
* - MUST NOT revert.
*/
function maxMint(address receiver) external view returns (uint256 maxShares);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given
* current on-chain conditions.
*
* - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call
* in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the
* same transaction.
* - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint
* would be accepted, regardless if the user has enough tokens approved, etc.
* - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by minting.
*/
function previewMint(uint256 shares) external view returns (uint256 assets);
/**
* @dev Mints exactly `shares` vault shares to `receiver` in exchange for `assets` underlying tokens.
*
* - MUST emit the Deposit event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint
* execution, and are accounted for during mint.
* - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not
* approving enough underlying tokens to the Vault contract, etc).
*
* NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.
*/
function mint(uint256 shares, address receiver) external returns (uint256 assets);
/**
* @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the
* Vault, through a withdraw call.
*
* - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
* - MUST NOT revert.
*/
function maxWithdraw(address owner) external view returns (uint256 maxAssets);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,
* given current on-chain conditions.
*
* - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw
* call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if
* called
* in the same transaction.
* - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though
* the withdrawal would be accepted, regardless if the user has enough shares, etc.
* - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by depositing.
*/
function previewWithdraw(uint256 assets) external view returns (uint256 shares);
/**
* @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.
*
* - MUST emit the Withdraw event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
* withdraw execution, and are accounted for during withdraw.
* - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner
* not having enough shares, etc).
*
* Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
* Those methods should be performed separately.
*/
function withdraw(
uint256 assets,
address receiver,
address owner
) external returns (uint256 shares);
/**
* @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,
* through a redeem call.
*
* - MUST return a limited value if owner is subject to some withdrawal limit or timelock.
* - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.
* - MUST NOT revert.
*/
function maxRedeem(address owner) external view returns (uint256 maxShares);
/**
* @dev Allows an on-chain or off-chain user to simulate the effects of their redemption at the current block,
* given current on-chain conditions.
*
* - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call
* in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the
* same transaction.
* - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the
* redemption would be accepted, regardless if the user has enough shares, etc.
* - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
* - MUST NOT revert.
*
* NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in
* share price or some other type of condition, meaning the depositor will lose assets by redeeming.
*/
function previewRedeem(uint256 shares) external view returns (uint256 assets);
/**
* @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.
*
* - MUST emit the Withdraw event.
* - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the
* redeem execution, and are accounted for during redeem.
* - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner
* not having enough shares, etc).
*
* NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.
* Those methods should be performed separately.
*/
function redeem(
uint256 shares,
address receiver,
address owner
) external returns (uint256 assets);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/dependencies/openzeppelin/LowLevelCall.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (utils/LowLevelCall.sol)
pragma solidity ^0.8.20;
/**
* @dev Library of low level call functions that implement different calling strategies to deal with the return data.
*
* WARNING: Using this library requires an advanced understanding of Solidity and how the EVM works. It is recommended
* to use the {Address} library instead.
*/
library LowLevelCall {
/// @dev Performs a Solidity function call using a low level `call` and ignoring the return data.
function callNoReturn(address target, bytes memory data) internal returns (bool success) {
return callNoReturn(target, 0, data);
}
/// @dev Same as {callNoReturn}, but allows to specify the value to be sent in the call.
function callNoReturn(
address target,
uint256 value,
bytes memory data
) internal returns (bool success) {
assembly ('memory-safe') {
success := call(gas(), target, value, add(data, 0x20), mload(data), 0x00, 0x00)
}
}
/// @dev Performs a Solidity function call using a low level `call` and returns the first 64 bytes of the result
/// in the scratch space of memory. Useful for functions that return a tuple of single-word values.
///
/// WARNING: Do not assume that the results are zero if `success` is false. Memory can be already allocated
/// and this function doesn't zero it out.
function callReturn64Bytes(
address target,
bytes memory data
) internal returns (bool success, bytes32 result1, bytes32 result2) {
return callReturn64Bytes(target, 0, data);
}
/// @dev Same as {callReturnBytes32Pair}, but allows to specify the value to be sent in the call.
function callReturn64Bytes(
address target,
uint256 value,
bytes memory data
) internal returns (bool success, bytes32 result1, bytes32 result2) {
assembly ('memory-safe') {
success := call(gas(), target, value, add(data, 0x20), mload(data), 0x00, 0x40)
result1 := mload(0x00)
result2 := mload(0x20)
}
}
/// @dev Performs a Solidity function call using a low level `staticcall` and ignoring the return data.
function staticcallNoReturn(
address target,
bytes memory data
) internal view returns (bool success) {
assembly ('memory-safe') {
success := staticcall(gas(), target, add(data, 0x20), mload(data), 0x00, 0x00)
}
}
/// @dev Performs a Solidity function call using a low level `staticcall` and returns the first 64 bytes of the result
/// in the scratch space of memory. Useful for functions that return a tuple of single-word values.
///
/// WARNING: Do not assume that the results are zero if `success` is false. Memory can be already allocated
/// and this function doesn't zero it out.
function staticcallReturn64Bytes(
address target,
bytes memory data
) internal view returns (bool success, bytes32 result1, bytes32 result2) {
assembly ('memory-safe') {
success := staticcall(gas(), target, add(data, 0x20), mload(data), 0x00, 0x40)
result1 := mload(0x00)
result2 := mload(0x20)
}
}
/// @dev Performs a Solidity function call using a low level `delegatecall` and ignoring the return data.
function delegatecallNoReturn(address target, bytes memory data) internal returns (bool success) {
assembly ('memory-safe') {
success := delegatecall(gas(), target, add(data, 0x20), mload(data), 0x00, 0x00)
}
}
/// @dev Performs a Solidity function call using a low level `delegatecall` and returns the first 64 bytes of the result
/// in the scratch space of memory. Useful for functions that return a tuple of single-word values.
///
/// WARNING: Do not assume that the results are zero if `success` is false. Memory can be already allocated
/// and this function doesn't zero it out.
function delegatecallReturn64Bytes(
address target,
bytes memory data
) internal returns (bool success, bytes32 result1, bytes32 result2) {
assembly ('memory-safe') {
success := delegatecall(gas(), target, add(data, 0x20), mload(data), 0x00, 0x40)
result1 := mload(0x00)
result2 := mload(0x20)
}
}
/// @dev Returns the size of the return data buffer.
function returnDataSize() internal pure returns (uint256 size) {
assembly ('memory-safe') {
size := returndatasize()
}
}
/// @dev Returns a buffer containing the return data from the last call.
function returnData() internal pure returns (bytes memory result) {
assembly ('memory-safe') {
result := mload(0x40)
mstore(result, returndatasize())
returndatacopy(add(result, 0x20), 0x00, returndatasize())
mstore(0x40, add(result, add(0x20, returndatasize())))
}
}
/// @dev Revert with the return data from the last call.
function bubbleRevert() internal pure {
assembly ('memory-safe') {
let fmp := mload(0x40)
returndatacopy(fmp, 0x00, returndatasize())
revert(fmp, returndatasize())
}
}
function bubbleRevert(bytes memory returndata) internal pure {
assembly ('memory-safe') {
revert(add(returndata, 0x20), mload(returndata))
}
}
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/hub/interfaces/IAssetInterestRateStrategy.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IBasicInterestRateStrategy} from 'src/hub/interfaces/IBasicInterestRateStrategy.sol';
/// @title IAssetInterestRateStrategy
/// @author Aave Labs
/// @notice Interface of the optimal-usage-based asset interest rate strategy.
interface IAssetInterestRateStrategy is IBasicInterestRateStrategy {
/// @notice Holds the interest rate data for a given asset.
/// @dev optimalUsageRatio The optimal usage ratio, in BPS. Maximum and minimum values are defined by `MAX_OPTIMAL_RATIO` and `MIN_OPTIMAL_RATIO`.
/// @dev baseDrawnRate The base drawn rate, in BPS.
/// @dev rateGrowthBeforeOptimal The rate growth before the optimal usage ratio, in BPS.
/// @dev rateGrowthAfterOptimal The rate growth after the optimal usage ratio, in BPS.
struct InterestRateData {
uint16 optimalUsageRatio;
uint32 baseDrawnRate;
uint32 rateGrowthBeforeOptimal;
uint32 rateGrowthAfterOptimal;
}
/// @notice Emitted when interest rate data is updated for an asset.
/// @param hub The address of the associated Hub.
/// @param assetId The identifier of the asset whose interest rate data is updated.
/// @param optimalUsageRatio The optimal usage ratio, in BPS.
/// @param baseDrawnRate The base drawn rate, in BPS.
/// @param rateGrowthBeforeOptimal The rate growth before the optimal usage ratio, in BPS.
/// @param rateGrowthAfterOptimal The rate growth after the optimal usage ratio, in BPS.
event UpdateInterestRateData(
address indexed hub,
uint256 indexed assetId,
uint256 optimalUsageRatio,
uint256 baseDrawnRate,
uint256 rateGrowthBeforeOptimal,
uint256 rateGrowthAfterOptimal
);
/// @notice Thrown when the given address is invalid.
error InvalidAddress();
/// @notice Thrown when the caller is not the Hub.
error OnlyHub();
/// @notice Thrown when the max possible rate is greater than `MAX_ALLOWED_DRAWN_RATE`.
error InvalidMaxDrawnRate();
/// @notice Thrown when the optimal usage ratio is less than `MIN_OPTIMAL_RATIO` or greater than `MAX_OPTIMAL_RATIO`.
error InvalidOptimalUsageRatio();
/// @notice Returns the full InterestRateData struct for the given asset.
/// @param assetId The identifier of the asset for which to get the data.
/// @return The InterestRateData struct for the given asset, all in BPS.
function getInterestRateData(uint256 assetId) external view returns (InterestRateData memory);
/// @notice Returns the optimal usage rate for the given asset.
/// @param assetId The identifier of the asset for which to get the optimal usage ratio.
/// @return The optimal usage ratio, in BPS.
function getOptimalUsageRatio(uint256 assetId) external view returns (uint256);
/// @notice Returns the base drawn rate.
/// @param assetId The identifier of the asset for which to get the base drawn rate.
/// @return The base drawn rate, in BPS.
function getBaseDrawnRate(uint256 assetId) external view returns (uint256);
/// @notice Returns the rate growth before the optimal usage ratio.
/// @dev Applicable when usage ratio > 0 and <= OPTIMAL_USAGE_RATIO.
/// @param assetId The identifier of the asset for which to get the rate growth before the optimal usage ratio.
/// @return The rate growth, in BPS.
function getRateGrowthBeforeOptimal(uint256 assetId) external view returns (uint256);
/// @notice Returns the rate growth after the optimal usage ratio.
/// @dev Applicable when usage ratio > OPTIMAL_USAGE_RATIO.
/// @param assetId The identifier of the asset for which to get the rate growth after the optimal usage ratio.
/// @return The rate growth, in BPS.
function getRateGrowthAfterOptimal(uint256 assetId) external view returns (uint256);
/// @notice Returns the maximum drawn rate.
/// @param assetId The identifier of the asset for which to get the maximum drawn rate.
/// @return The maximum drawn rate, in BPS.
function getMaxDrawnRate(uint256 assetId) external view returns (uint256);
/// @notice Returns the maximum allowed value for a drawn rate.
/// @return The maximum drawn rate, in BPS.
function MAX_ALLOWED_DRAWN_RATE() external view returns (uint256);
/// @notice Returns the minimum optimal usage ratio.
/// @return The minimum optimal usage ratio, expressed in BPS.
function MIN_OPTIMAL_RATIO() external view returns (uint256);
/// @notice Returns the maximum optimal usage ratio.
/// @return The maximum optimal usage ratio, expressed in BPS.
function MAX_OPTIMAL_RATIO() external view returns (uint256);
/// @notice Returns the address of the Hub.
function HUB() external view returns (address);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/hub/interfaces/IBasicInterestRateStrategy.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
/// @title IBasicInterestRateStrategy
/// @author Aave Labs
/// @notice Basic interface for any interest rate strategy.
interface IBasicInterestRateStrategy {
/// @notice Thrown when the interest rate data is not set for the asset.
/// @param assetId The identifier of the asset with no interest rate data set.
error InterestRateDataNotSet(uint256 assetId);
/// @notice Sets the interest rate parameters for a specified asset.
/// @param assetId The identifier of the asset.
/// @param data The encoded parameters used to configure the interest rate of the asset.
function setInterestRateData(uint256 assetId, bytes calldata data) external;
/// @notice Calculates the interest rate depending on the asset's state and configurations.
/// @param assetId The identifier of the asset.
/// @param liquidity The current available liquidity of the asset.
/// @param drawn The current drawn amount of the asset.
/// @param deficit The current deficit of the asset.
/// @param swept The current swept (reinvested) amount of the asset.
/// @return The interest rate, expressed in RAY.
function calculateInterestRate(
uint256 assetId,
uint256 liquidity,
uint256 drawn,
uint256 deficit,
uint256 swept
) external view returns (uint256);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/hub/interfaces/IHub.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IAccessManaged} from 'src/dependencies/openzeppelin/IAccessManaged.sol';
import {IHubBase} from 'src/hub/interfaces/IHubBase.sol';
/// @title IHub
/// @author Aave Labs
/// @notice Full interface for the Hub.
interface IHub is IHubBase, IAccessManaged {
/// @notice Asset position and configuration data.
/// @dev liquidity The liquidity available to be accessed, expressed in asset units.
/// @dev realizedFees The amount of fees realized but not yet minted, expressed in asset units.
/// @dev decimals The number of decimals of the underlying asset.
/// @dev addedShares The total shares added across all spokes.
/// @dev swept The outstanding liquidity which has been invested by the reinvestment controller, expressed in asset units.
/// @dev premiumOffsetRay The total premium offset across all spokes, used to calculate the premium, expressed in asset units and scaled by RAY.
/// @dev drawnShares The total drawn shares across all spokes.
/// @dev premiumShares The total premium shares across all spokes.
/// @dev liquidityFee The protocol fee charged on drawn and premium liquidity growth, expressed in BPS.
/// @dev drawnIndex The drawn index which monotonically increases according to the drawn rate, expressed in RAY.
/// @dev drawnRate The rate at which drawn assets grow, expressed in RAY.
/// @dev lastUpdateTimestamp The timestamp of the last accrual.
/// @dev underlying The address of the underlying asset.
/// @dev irStrategy The address of the interest rate strategy.
/// @dev reinvestmentController The address of the reinvestment controller.
/// @dev feeReceiver The address of the fee receiver spoke.
/// @dev deficitRay The amount of outstanding bad debt across all spokes, expressed in asset units and scaled by RAY.
struct Asset {
uint120 liquidity;
uint120 realizedFees;
uint8 decimals;
//
uint120 addedShares;
uint120 swept;
//
int200 premiumOffsetRay;
//
uint120 drawnShares;
uint120 premiumShares;
uint16 liquidityFee;
//
uint120 drawnIndex;
uint96 drawnRate;
uint40 lastUpdateTimestamp;
//
address underlying;
//
address irStrategy;
//
address reinvestmentController;
//
address feeReceiver;
//
uint200 deficitRay;
}
/// @notice Asset configuration. Subset of the `Asset` struct.
struct AssetConfig {
address feeReceiver;
uint16 liquidityFee;
address irStrategy;
address reinvestmentController;
}
/// @notice Spoke position and configuration data.
/// @dev drawnShares The drawn shares of a spoke for a given asset.
/// @dev premiumShares The premium shares of a spoke for a given asset.
/// @dev premiumOffsetRay The premium offset of a spoke for a given asset, used to calculate the premium, expressed in asset units and scaled by RAY.
/// @dev addedShares The added shares of a spoke for a given asset.
/// @dev addCap The maximum amount that can be added by a spoke, expressed in whole assets (not scaled by decimals). A value of `MAX_ALLOWED_SPOKE_CAP` indicates no cap.
/// @dev drawCap The maximum amount that can be drawn by a spoke, expressed in whole assets (not scaled by decimals). A value of `MAX_ALLOWED_SPOKE_CAP` indicates no cap.
/// @dev riskPremiumThreshold The maximum ratio of premium to drawn shares a spoke can have, expressed in BPS. A value of `MAX_RISK_PREMIUM_THRESHOLD` indicates no threshold.
/// @dev active True if the Spoke is allowed to perform any action.
/// @dev halted True if the Spoke is prevented from performing actions that instantly update liquidity.
/// @dev deficitRay The deficit reported by a spoke for a given asset, expressed in asset units and scaled by RAY.
struct SpokeData {
uint120 drawnShares;
uint120 premiumShares;
//
int200 premiumOffsetRay;
//
uint120 addedShares;
uint40 addCap;
uint40 drawCap;
uint24 riskPremiumThreshold;
bool active;
bool halted;
//
uint200 deficitRay;
}
/// @notice Spoke configuration data. Subset of the `SpokeData` struct.
struct SpokeConfig {
uint40 addCap;
uint40 drawCap;
uint24 riskPremiumThreshold;
bool active;
bool halted;
}
/// @notice Emitted when an asset is added.
/// @param assetId The identifier of the asset.
/// @param underlying The address of the underlying asset.
/// @param decimals The number of decimals of the asset.
event AddAsset(uint256 indexed assetId, address indexed underlying, uint8 decimals);
/// @notice Emitted when an asset is updated.
/// @param assetId The identifier of the asset.
/// @param drawnIndex The new drawn index of the asset.
/// @param drawnRate The new drawn rate of the asset.
/// @param accruedFees The accrued fees of the asset since the last mint.
event UpdateAsset(
uint256 indexed assetId,
uint256 drawnIndex,
uint256 drawnRate,
uint256 accruedFees
);
/// @notice Emitted when an asset configuration is updated.
/// @param assetId The identifier of the asset.
/// @param config The new asset configuration struct.
event UpdateAssetConfig(uint256 indexed assetId, AssetConfig config);
/// @notice Emitted when a spoke is added.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
event AddSpoke(uint256 indexed assetId, address indexed spoke);
/// @notice Emitted when a spoke configuration is updated.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @param config The new spoke configuration struct.
event UpdateSpokeConfig(uint256 indexed assetId, address indexed spoke, SpokeConfig config);
/// @notice Emitted when fees are minted to the fee receiver spoke.
/// @param assetId The identifier of the asset.
/// @param feeReceiver The address of the current fee receiver spoke.
/// @param shares The amount of shares minted.
/// @param assets The amount of assets used to mint the shares.
event MintFeeShares(
uint256 indexed assetId,
address indexed feeReceiver,
uint256 shares,
uint256 assets
);
/// @notice Emitted when liquidity is invested by the reinvestment controller.
/// @param assetId The identifier of the asset.
/// @param reinvestmentController The active asset controller.
/// @param amount The amount invested.
event Sweep(uint256 indexed assetId, address indexed reinvestmentController, uint256 amount);
/// @notice Emitted when liquidity is reclaimed (from swept liquidity) by the reinvestment controller.
/// @param assetId The identifier of the asset.
/// @param reinvestmentController The active asset controller.
/// @param amount The amount reclaimed.
event Reclaim(uint256 indexed assetId, address indexed reinvestmentController, uint256 amount);
/// @notice Emitted when a deficit is eliminated.
/// @param assetId The identifier of the asset.
/// @param callerSpoke The spoke that eliminated the deficit using its added shares.
/// @param coveredSpoke The spoke for which the deficit was eliminated.
/// @param shares The amount of shares removed.
/// @param deficitAmountRay The amount of deficit eliminated, expressed in asset units and scaled by RAY.
event EliminateDeficit(
uint256 indexed assetId,
address indexed callerSpoke,
address indexed coveredSpoke,
uint256 shares,
uint256 deficitAmountRay
);
/// @notice Thrown when an underlying asset is already listed.
error UnderlyingAlreadyListed();
/// @notice Thrown when an asset is not listed.
error AssetNotListed();
/// @notice Thrown when the add cap is exceeded.
/// @param addCap The current `addCap` of the asset, expressed in whole assets (not scaled by decimals).
error AddCapExceeded(uint256 addCap);
/// @notice Thrown when the available liquidity is insufficient.
/// @param liquidity The current available liquidity.
error InsufficientLiquidity(uint256 liquidity);
/// @notice Thrown when the transferred liquidity is insufficient.
/// @param liquidityNeeded The amount of additional liquidity needed.
error InsufficientTransferred(uint256 liquidityNeeded);
/// @notice Thrown when the draw cap is exceeded.
/// @param drawCap The current `drawCap` of the asset, expressed in whole assets (not scaled by decimals).
error DrawCapExceeded(uint256 drawCap);
/// @notice Thrown when a surplus amount of drawn is restored.
/// @param maxAllowedRestore The maximum allowed drawn amount to restore.
error SurplusDrawnRestored(uint256 maxAllowedRestore);
/// @notice Thrown when a surplus amount of premium is restored.
/// @param maxAllowedRestoreRay The maximum allowed premium amount to restore, expressed in asset units and scaled by RAY.
error SurplusPremiumRayRestored(uint256 maxAllowedRestoreRay);
/// @notice Thrown when the premium change is invalid.
error InvalidPremiumChange();
/// @notice Thrown when a surplus amount of drawn is reported as deficit.
/// @param maxAllowedDeficit The maximum allowed drawn to report as deficit.
error SurplusDrawnDeficitReported(uint256 maxAllowedDeficit);
/// @notice Thrown when a surplus amount of premium is reported as deficit.
/// @param maxAllowedDeficitRay The maximum allowed premium to report as deficit, expressed in asset units and scaled by RAY.
error SurplusPremiumRayDeficitReported(uint256 maxAllowedDeficitRay);
/// @notice Thrown when a spoke is not active.
error SpokeNotActive();
/// @notice Thrown when a spoke is halted.
error SpokeHalted();
/// @notice Thrown when a new reinvestment controller is the zero address and the asset has existing swept liquidity.
error InvalidReinvestmentController();
/// @notice Thrown when an invalid reinvestment controller attempts to perform a `sweep` action.
error OnlyReinvestmentController();
/// @notice Thrown when a spoke being added is already listed.
error SpokeAlreadyListed();
/// @notice Thrown when a spoke being updated is not listed.
error SpokeNotListed();
/// @notice Thrown when the amount is invalid.
error InvalidAmount();
/// @notice Thrown when the shares amount is invalid.
error InvalidShares();
/// @notice Thrown when an input address is invalid.
error InvalidAddress();
/// @notice Thrown if the liquidity fee is invalid when updating an asset configuration.
error InvalidLiquidityFee();
/// @notice Thrown when the asset decimals exceed the maximum allowed decimals.
error InvalidAssetDecimals();
/// @notice Thrown if the interest rate strategy or data are invalid when updating an asset configuration.
/// @dev The `irData` must be empty if the interest rate strategy is not updated.
error InvalidInterestRateStrategy();
/// @notice Adds a new asset to the Hub.
/// @dev The same underlying asset address cannot be added as an asset multiple times.
/// @dev The fee receiver is added as a new spoke with maximum add cap and zero draw cap.
/// @param underlying The address of the underlying asset.
/// @param decimals The number of decimals of `underlying`.
/// @param feeReceiver The address of the fee receiver spoke.
/// @param irStrategy The address of the interest rate strategy contract.
/// @param irData The interest rate data to apply to the given asset encoded in bytes.
/// @return The unique identifier of the added asset.
function addAsset(
address underlying,
uint8 decimals,
address feeReceiver,
address irStrategy,
bytes calldata irData
) external returns (uint256);
/// @notice Updates the configuration of an asset.
/// @dev If the fee receiver is updated, adds it as a new spoke with maximum add cap and zero draw cap, and sets old fee receiver caps to zero.
/// @dev If the fee receiver is updated, accrued fees are minted as shares before the update if their value exceeds one share.
/// @dev If the interest rate strategy is updated, it is configured with `irData`. Otherwise, `irData` must be empty.
/// @param assetId The identifier of the asset.
/// @param config The new configuration for the asset.
/// @param irData The interest rate data to apply to the given asset, encoded in bytes.
function updateAssetConfig(
uint256 assetId,
AssetConfig calldata config,
bytes calldata irData
) external;
/// @notice Registers a new spoke for a specific asset in the Hub.
/// @dev Reverts with `SpokeAlreadyListed` if spoke is already listed.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke to add.
/// @param params The configuration parameters for the Spoke.
function addSpoke(uint256 assetId, address spoke, SpokeConfig calldata params) external;
/// @notice Updates the configuration of a spoke for a specific asset.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke to update.
/// @param config The new configuration for the Spoke.
function updateSpokeConfig(uint256 assetId, address spoke, SpokeConfig calldata config) external;
/// @notice Updates the interest rate strategy for a specified asset.
/// @param assetId The identifier of the asset.
/// @param irData The interest rate data to apply to the given asset, encoded in bytes.
function setInterestRateData(uint256 assetId, bytes calldata irData) external;
/// @notice Mints shares to the fee receiver from accrued fees.
/// @dev No op when fees are worth less than one share.
/// @param assetId The identifier of the asset.
/// @return The amount of shares minted.
function mintFeeShares(uint256 assetId) external returns (uint256);
/// @notice Eliminates deficit by removing added shares of caller spoke.
/// @dev Only callable by active and authorized spokes.
/// @param assetId The identifier of the asset.
/// @param amount The amount of deficit to eliminate.
/// @param spoke The spoke for which the deficit is eliminated.
/// @return The amount of added shares removed.
/// @return The amount of deficit eliminated, expressed in asset units.
function eliminateDeficit(
uint256 assetId,
uint256 amount,
address spoke
) external returns (uint256, uint256);
/// @notice Allows a spoke to transfer its added shares of an asset to another spoke.
/// @dev Only callable by spokes.
/// @param assetId The identifier of the asset.
/// @param shares The amount of shares to move.
/// @param toSpoke The address of the recipient spoke.
function transferShares(uint256 assetId, uint256 shares, address toSpoke) external;
/// @notice Sweeps an amount of liquidity of the corresponding asset and sends it to the configured reinvestment controller.
/// @dev The controller handles the actual reinvestment of funds, redistribution of interest, and investment caps.
/// @param assetId The identifier of the asset.
/// @param amount The amount to sweep.
function sweep(uint256 assetId, uint256 amount) external;
/// @notice Reclaims an amount of liquidity of the corresponding asset from the configured reinvestment controller.
/// @dev The controller can only reclaim up to swept amount. All accrued interest is distributed offchain.
/// @dev Underlying assets must be transferred to the Hub before invocation.
/// @dev Extra untracked underlying liquidity in the Hub can be skimmed into the Hub's liquidity accounting through this action.
/// @param assetId The identifier of the asset.
/// @param amount The amount to reclaim.
function reclaim(uint256 assetId, uint256 amount) external;
/// @notice Returns whether the underlying is listed as an asset.
/// @param underlying The address of the underlying asset.
/// @return True if the underlying asset is listed.
function isUnderlyingListed(address underlying) external view returns (bool);
/// @notice Returns the number of listed assets.
function getAssetCount() external view returns (uint256);
/// @notice Returns information regarding the specified asset.
/// @dev `drawnIndex`, `drawnRate` and `lastUpdateTimestamp` can be outdated due to passage of time.
/// @param assetId The identifier of the asset.
/// @return The asset struct.
function getAsset(uint256 assetId) external view returns (Asset memory);
/// @notice Returns the asset configuration for the specified asset.
/// @param assetId The identifier of the asset.
/// @return The asset configuration struct.
function getAssetConfig(uint256 assetId) external view returns (AssetConfig memory);
/// @notice Returns the accrued fees for the asset, expressed in asset units.
/// @dev Accrued fees are excluded from total added assets.
/// @param assetId The identifier of the asset.
/// @return The amount of accrued fees.
function getAssetAccruedFees(uint256 assetId) external view returns (uint256);
/// @notice Returns the amount of liquidity swept by the reinvestment controller for the specified asset.
/// @param assetId The identifier of the asset.
/// @return The amount of liquidity swept.
function getAssetSwept(uint256 assetId) external view returns (uint256);
/// @notice Calculates the current drawn rate for the specified asset.
/// @param assetId The identifier of the asset.
/// @return The current drawn rate of the asset.
function getAssetDrawnRate(uint256 assetId) external view returns (uint256);
/// @notice Returns the number of spokes listed for the specified asset.
/// @param assetId The identifier of the asset.
function getSpokeCount(uint256 assetId) external view returns (uint256);
/// @notice Returns whether the Spoke is listed for the specified asset.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @return True if the Spoke is listed.
function isSpokeListed(uint256 assetId, address spoke) external view returns (bool);
/// @notice Returns the address of the Spoke for an asset at the given index.
/// @param assetId The identifier of the asset.
/// @param index The index of the Spoke.
/// @return The address of the Spoke.
function getSpokeAddress(uint256 assetId, uint256 index) external view returns (address);
/// @notice Returns the Spoke data struct.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @return The spoke data struct.
function getSpoke(uint256 assetId, address spoke) external view returns (SpokeData memory);
/// @notice Returns the Spoke configuration struct.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @return The spoke configuration struct.
function getSpokeConfig(
uint256 assetId,
address spoke
) external view returns (SpokeConfig memory);
/// @notice Returns the maximum allowed number of decimals for the underlying asset.
/// @return The maximum number of decimals (inclusive).
function MAX_ALLOWED_UNDERLYING_DECIMALS() external view returns (uint8);
/// @notice Returns the minimum allowed number of decimals for the underlying asset.
/// @return The minimum number of decimals (inclusive).
function MIN_ALLOWED_UNDERLYING_DECIMALS() external view returns (uint8);
/// @notice Returns the maximum value for any spoke cap (add or draw).
/// @dev The value is not inclusive; using the maximum value indicates no cap.
/// @return The maximum cap value, expressed in asset units.
function MAX_ALLOWED_SPOKE_CAP() external view returns (uint40);
/// @notice Returns the maximum value for any spoke risk premium threshold.
/// @dev The value is not inclusive; using the maximum value indicates no threshold.
/// @return The maximum risk premium threshold, expressed in BPS.
function MAX_RISK_PREMIUM_THRESHOLD() external view returns (uint24);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/hub/interfaces/IHubBase.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
/// @title IHubBase
/// @author Aave Labs
/// @notice Minimal interface for Hub.
interface IHubBase {
/// @notice Changes to premium owed accounting.
/// @dev sharesDelta The change in premium shares.
/// @dev offsetRayDelta The change in premium offset, expressed in asset units and scaled by RAY.
/// @dev restoredPremiumRay The restored premium, expressed in asset units and scaled by RAY.
struct PremiumDelta {
int256 sharesDelta;
int256 offsetRayDelta;
uint256 restoredPremiumRay;
}
/// @notice Emitted on the `add` action.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @param shares The amount of shares added.
/// @param amount The amount of assets added.
event Add(uint256 indexed assetId, address indexed spoke, uint256 shares, uint256 amount);
/// @notice Emitted on the `remove` action.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @param shares The amount of shares removed.
/// @param amount The amount of assets removed.
event Remove(uint256 indexed assetId, address indexed spoke, uint256 shares, uint256 amount);
/// @notice Emitted on the `draw` action.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @param drawnShares The amount of drawn shares.
/// @param drawnAmount The amount of drawn assets.
event Draw(
uint256 indexed assetId,
address indexed spoke,
uint256 drawnShares,
uint256 drawnAmount
);
/// @notice Emitted on the `restore` action.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @param drawnShares The amount of drawn shares.
/// @param premiumDelta The premium delta data struct.
/// @param drawnAmount The amount of drawn assets restored.
/// @param premiumAmount The amount of premium assets restored.
event Restore(
uint256 indexed assetId,
address indexed spoke,
uint256 drawnShares,
PremiumDelta premiumDelta,
uint256 drawnAmount,
uint256 premiumAmount
);
/// @notice Emitted on the `refreshPremium` action.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @param premiumDelta The premium delta data struct.
event RefreshPremium(uint256 indexed assetId, address indexed spoke, PremiumDelta premiumDelta);
/// @notice Emitted on the `reportDeficit` action.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @param drawnShares The amount of drawn shares reported as deficit.
/// @param premiumDelta The premium delta data struct.
/// @param deficitAmountRay The amount of deficit reported, expressed in asset units and scaled by RAY.
event ReportDeficit(
uint256 indexed assetId,
address indexed spoke,
uint256 drawnShares,
PremiumDelta premiumDelta,
uint256 deficitAmountRay
);
/// @notice Emitted on the `transferShares` action.
/// @param assetId The identifier of the asset.
/// @param sender The address of the sender.
/// @param receiver The address of the receiver.
/// @param shares The amount of shares transferred.
event TransferShares(
uint256 indexed assetId,
address indexed sender,
address indexed receiver,
uint256 shares
);
/// @notice Adds assets on behalf of a user.
/// @dev Only callable by active spokes.
/// @dev Underlying assets must be transferred to the Hub before invocation.
/// @dev Extra untracked underlying liquidity in the Hub can be skimmed into the Hub's liquidity accounting through this action.
/// @param assetId The identifier of the asset.
/// @param amount The amount of asset liquidity to add.
/// @return The amount of shares added.
function add(uint256 assetId, uint256 amount) external returns (uint256);
/// @notice Removes assets on behalf of a user.
/// @dev Only callable by active spokes.
/// @param assetId The identifier of the asset.
/// @param amount The amount of asset liquidity to remove.
/// @param to The address to transfer the assets to.
/// @return The amount of shares removed.
function remove(uint256 assetId, uint256 amount, address to) external returns (uint256);
/// @notice Draws assets on behalf of a user.
/// @dev Only callable by active spokes.
/// @param assetId The identifier of the asset.
/// @param amount The amount of assets to draw.
/// @param to The address to transfer the underlying assets to.
/// @return The amount of drawn shares.
function draw(uint256 assetId, uint256 amount, address to) external returns (uint256);
/// @notice Restores assets on behalf of a user.
/// @dev Only callable by active spokes.
/// @dev Interest is always paid off first from premium, then from drawn.
/// @dev Underlying assets must be transferred to the Hub before invocation.
/// @dev Extra untracked underlying liquidity in the Hub can be skimmed into the Hub's liquidity accounting through this action.
/// @param assetId The identifier of the asset.
/// @param drawnAmount The drawn amount to restore.
/// @param premiumDelta The premium delta to apply which signals premium repayment.
/// @return The amount of drawn shares restored.
function restore(
uint256 assetId,
uint256 drawnAmount,
PremiumDelta calldata premiumDelta
) external returns (uint256);
/// @notice Reports an owed amount by the caller Spoke as a deficit.
/// @dev Only callable by active spokes.
/// @param assetId The identifier of the asset.
/// @param drawnAmount The drawn amount to report as deficit.
/// @param premiumDelta The premium delta to apply which signals premium deficit.
/// @return The amount of drawn shares reported as deficit.
/// @return The amount of deficit reported, expressed in asset units.
function reportDeficit(
uint256 assetId,
uint256 drawnAmount,
PremiumDelta calldata premiumDelta
) external returns (uint256, uint256);
/// @notice Refreshes premium accounting.
/// @dev Only callable by active spokes.
/// @dev Asset and spoke premium should not decrease.
/// @param assetId The identifier of the asset.
/// @param premiumDelta The change in premium.
function refreshPremium(uint256 assetId, PremiumDelta calldata premiumDelta) external;
/// @notice Transfers an amount of added shares of the caller Spoke to the fee receiver Spoke.
/// @dev It can be used to execute one-time payments to the fee receiver Spoke (e.g., liquidation fees).
/// @dev Only callable by active spokes.
/// @param assetId The identifier of the asset.
/// @param shares The amount of shares to pay to feeReceiver.
function payFeeShares(uint256 assetId, uint256 shares) external;
/// @notice Converts the specified amount of assets to shares upon an `add` action.
/// @dev Rounds down to the nearest shares amount.
/// @dev Defaults to a 1:1 exchange rate.
/// @param assetId The identifier of the asset.
/// @param assets The amount of assets to convert to shares amount.
/// @return The amount of shares converted from assets amount.
function previewAddByAssets(uint256 assetId, uint256 assets) external view returns (uint256);
/// @notice Converts the specified shares amount to assets amount added upon an `add` action.
/// @dev Rounds up to the nearest assets amount.
/// @dev Defaults to a 1:1 exchange rate.
/// @param assetId The identifier of the asset.
/// @param shares The amount of shares to convert to assets amount.
/// @return The amount of assets converted from shares amount.
function previewAddByShares(uint256 assetId, uint256 shares) external view returns (uint256);
/// @notice Converts the specified amount of assets to shares amount removed upon a `remove` action.
/// @dev Rounds up to the nearest shares amount.
/// @dev Defaults to a 1:1 exchange rate.
/// @param assetId The identifier of the asset.
/// @param assets The amount of assets to convert to shares amount.
/// @return The amount of shares converted from assets amount.
function previewRemoveByAssets(uint256 assetId, uint256 assets) external view returns (uint256);
/// @notice Converts the specified amount of shares to assets amount removed upon a `remove` action.
/// @dev Rounds down to the nearest assets amount.
/// @dev Defaults to a 1:1 exchange rate.
/// @param assetId The identifier of the asset.
/// @param shares The amount of shares to convert to assets amount.
/// @return The amount of assets converted from shares amount.
function previewRemoveByShares(uint256 assetId, uint256 shares) external view returns (uint256);
/// @notice Converts the specified amount of assets to shares amount drawn upon a `draw` action.
/// @dev Rounds up to the nearest shares amount.
/// @param assetId The identifier of the asset.
/// @param assets The amount of assets to convert to shares amount.
/// @return The amount of shares converted from assets amount.
function previewDrawByAssets(uint256 assetId, uint256 assets) external view returns (uint256);
/// @notice Converts the specified amount of shares to assets amount drawn upon a `draw` action.
/// @dev Rounds down to the nearest assets amount.
/// @param assetId The identifier of the asset.
/// @param shares The amount of shares to convert to assets amount.
/// @return The amount of assets converted from shares amount.
function previewDrawByShares(uint256 assetId, uint256 shares) external view returns (uint256);
/// @notice Converts the specified amount of assets to shares amount restored upon a `restore` action.
/// @dev Rounds down to the nearest shares amount.
/// @param assetId The identifier of the asset.
/// @param assets The amount of assets to convert to shares amount.
/// @return The amount of shares converted from assets amount.
function previewRestoreByAssets(uint256 assetId, uint256 assets) external view returns (uint256);
/// @notice Converts the specified amount of shares to assets amount restored upon a `restore` action.
/// @dev Rounds up to the nearest assets amount.
/// @param assetId The identifier of the asset.
/// @param shares The amount of drawn shares to convert to assets amount.
/// @return The amount of assets converted from shares amount.
function previewRestoreByShares(uint256 assetId, uint256 shares) external view returns (uint256);
/// @notice Returns the asset identifier for the specified underlying asset.
/// @dev Reverts with `AssetNotListed` if the underlying is not listed.
/// @param underlying The address of the underlying asset.
function getAssetId(address underlying) external view returns (uint256);
/// @notice Returns the underlying address and decimals of the specified asset.
/// @param assetId The identifier of the asset.
/// @return The underlying address of the asset.
/// @return The decimals of the asset.
function getAssetUnderlyingAndDecimals(uint256 assetId) external view returns (address, uint8);
/// @notice Calculates the current drawn index for the specified asset.
/// @param assetId The identifier of the asset.
/// @return The current drawn index of the asset.
function getAssetDrawnIndex(uint256 assetId) external view returns (uint256);
/// @notice Returns the total amount of the specified asset added to the Hub.
/// @param assetId The identifier of the asset.
/// @return The amount of the asset added.
function getAddedAssets(uint256 assetId) external view returns (uint256);
/// @notice Returns the total amount of shares of the specified asset added to the Hub.
/// @param assetId The identifier of the asset.
/// @return The amount of shares of the asset added.
function getAddedShares(uint256 assetId) external view returns (uint256);
/// @notice Returns the amount of owed drawn and premium assets for the specified asset.
/// @param assetId The identifier of the asset.
/// @return The amount of owed drawn assets.
/// @return The amount of owed premium assets.
function getAssetOwed(uint256 assetId) external view returns (uint256, uint256);
/// @notice Returns the total amount of assets owed to the Hub.
/// @param assetId The identifier of the asset.
/// @return The total amount of the assets owed.
function getAssetTotalOwed(uint256 assetId) external view returns (uint256);
/// @notice Returns the amount of owed premium with full precision for specified asset.
/// @param assetId The identifier of the asset.
/// @return The amount of premium owed, expressed in asset units and scaled by RAY.
function getAssetPremiumRay(uint256 assetId) external view returns (uint256);
/// @notice Returns the amount of drawn shares of the specified asset.
/// @param assetId The identifier of the asset.
/// @return The amount of drawn shares.
function getAssetDrawnShares(uint256 assetId) external view returns (uint256);
/// @notice Returns the information regarding premium shares of the specified asset.
/// @param assetId The identifier of the asset.
/// @return The amount of premium shares owed to the asset.
/// @return The premium offset of the asset, expressed in asset units and scaled by RAY.
function getAssetPremiumData(uint256 assetId) external view returns (uint256, int256);
/// @notice Returns the amount of available liquidity for the specified asset.
/// @param assetId The identifier of the asset.
/// @return The amount of available liquidity.
function getAssetLiquidity(uint256 assetId) external view returns (uint256);
/// @notice Returns the amount of deficit with full precision of the specified asset.
/// @param assetId The identifier of the asset.
/// @return The amount of deficit, expressed in asset units and scaled by RAY.
function getAssetDeficitRay(uint256 assetId) external view returns (uint256);
/// @notice Returns the total amount of the specified assets added to the Hub by the specified spoke.
/// @dev If spoke is `asset.feeReceiver`, includes converted `unrealizedFeeShares` in return value.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @return The amount of added assets.
function getSpokeAddedAssets(uint256 assetId, address spoke) external view returns (uint256);
/// @notice Returns the total amount of shares of the specified asset added to the Hub by the specified spoke.
/// @dev If spoke is `asset.feeReceiver`, includes `unrealizedFeeShares` in return value.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @return The amount of added shares.
function getSpokeAddedShares(uint256 assetId, address spoke) external view returns (uint256);
/// @notice Returns the amount of the specified assets owed to the Hub by the specified spoke.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @return The amount of owed drawn assets.
/// @return The amount of owed premium assets.
function getSpokeOwed(uint256 assetId, address spoke) external view returns (uint256, uint256);
/// @notice Returns the total amount of the specified asset owed to the Hub by the specified spoke.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @return The total amount of the asset owed.
function getSpokeTotalOwed(uint256 assetId, address spoke) external view returns (uint256);
/// @notice Returns the amount of owed premium with full precision for specified asset and spoke.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @return The amount of owed premium assets, expressed in asset units and scaled by RAY.
function getSpokePremiumRay(uint256 assetId, address spoke) external view returns (uint256);
/// @notice Returns the amount of drawn shares of the specified asset by the specified spoke.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @return The amount of drawn shares.
function getSpokeDrawnShares(uint256 assetId, address spoke) external view returns (uint256);
/// @notice Returns the information regarding premium shares of the specified asset for the specified spoke.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @return The amount of premium shares.
/// @return The premium offset, expressed in asset units and scaled by RAY.
function getSpokePremiumData(
uint256 assetId,
address spoke
) external view returns (uint256, int256);
/// @notice Returns the amount of a given spoke's deficit with full precision for the specified asset.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @return The amount of deficit, expressed in asset units and scaled by RAY.
function getSpokeDeficitRay(uint256 assetId, address spoke) external view returns (uint256);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/hub/interfaces/IHubConfigurator.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IHub} from 'src/hub/interfaces/IHub.sol';
/// @title IHubConfigurator
/// @author Aave Labs
/// @notice Interface for HubConfigurator.
interface IHubConfigurator {
/// @notice Thrown when an address parameter is the zero address.
error InvalidAddress();
/// @notice Thrown when the list of assets and spoke configs are not the same length in `addSpokeToAssets`.
error MismatchedConfigs();
/// @notice Adds a new asset to a specified Hub.
/// @dev Retrieves the decimals of the underlying asset from its ERC20 contract.
/// @dev The fee receiver is automatically added as a Spoke with maximum caps.
/// @param hub The address of the Hub.
/// @param underlying The address of the underlying asset.
/// @param feeReceiver The address of the fee receiver Spoke.
/// @param liquidityFee The liquidity fee of the asset, expressed in BPS.
/// @param irStrategy The address of the interest rate strategy contract.
/// @param irData The interest rate data to apply to the given asset, encoded in bytes.
/// @return The unique identifier of the added asset.
function addAsset(
address hub,
address underlying,
address feeReceiver,
uint256 liquidityFee,
address irStrategy,
bytes calldata irData
) external returns (uint256);
/// @notice Adds a new asset to a specified Hub with explicit decimals.
/// @dev The fee receiver is automatically added as a Spoke with maximum caps.
/// @param hub The address of the Hub.
/// @param underlying The address of the underlying asset.
/// @param decimals The number of decimals of the asset.
/// @param feeReceiver The address of the fee receiver Spoke.
/// @param liquidityFee The liquidity fee of the asset, expressed in BPS.
/// @param irStrategy The address of the interest rate strategy contract.
/// @param irData The interest rate data to apply to the given asset, encoded in bytes.
/// @return The unique identifier of the added asset.
function addAssetWithDecimals(
address hub,
address underlying,
uint8 decimals,
address feeReceiver,
uint256 liquidityFee,
address irStrategy,
bytes calldata irData
) external returns (uint256);
/// @notice Updates the liquidity fee of an asset on a specified Hub.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
/// @param liquidityFee The new liquidity fee.
function updateLiquidityFee(address hub, uint256 assetId, uint256 liquidityFee) external;
/// @notice Updates the fee receiver of an asset on a specified hub.
/// @dev The fee receiver cannot be zero.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
/// @param feeReceiver The new fee receiver.
function updateFeeReceiver(address hub, uint256 assetId, address feeReceiver) external;
/// @notice Updates the liquidity fee and fee receiver of an asset on a specified Hub.
/// @dev The fee receiver cannot be zero.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
/// @param liquidityFee The new liquidity fee.
/// @param feeReceiver The new fee receiver.
function updateFeeConfig(
address hub,
uint256 assetId,
uint256 liquidityFee,
address feeReceiver
) external;
/// @notice Updates the interest rate strategy of an asset on a specified Hub.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
/// @param irStrategy The new interest rate strategy.
/// @param irData The interest rate data to apply to the given asset, encoded in bytes.
function updateInterestRateStrategy(
address hub,
uint256 assetId,
address irStrategy,
bytes calldata irData
) external;
/// @notice Updates the reinvestment controller of an asset on a specified Hub.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
/// @param reinvestmentController The new reinvestment controller.
function updateReinvestmentController(
address hub,
uint256 assetId,
address reinvestmentController
) external;
/// @notice Resets all Spokes' add and draw caps to zero for an asset on a specified Hub.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
function resetAssetCaps(address hub, uint256 assetId) external;
/// @notice Deactivates an asset on a specified Hub.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
function deactivateAsset(address hub, uint256 assetId) external;
/// @notice Halts an asset on a specified Hub.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
function haltAsset(address hub, uint256 assetId) external;
/// @notice Registers the Spoke for the specified asset on a specified Hub.
/// @param hub The address of the Hub.
/// @param spoke The address of the Spoke.
/// @param assetId The identifier of the asset to register the Spoke for.
/// @param config The Spoke configuration to register.
function addSpoke(
address hub,
address spoke,
uint256 assetId,
IHub.SpokeConfig calldata config
) external;
/// @notice Registers the same Spoke for multiple assets on a specified Hub, each with their own configuration.
/// @dev The i-th asset identifier in `assetIds` corresponds to the i-th configuration in `configs`.
/// @param hub The address of the Hub.
/// @param spoke The address of the Spoke.
/// @param assetIds The list of asset identifiers to register the Spoke for.
/// @param configs The list of Spoke configurations to register.
function addSpokeToAssets(
address hub,
address spoke,
uint256[] calldata assetIds,
IHub.SpokeConfig[] calldata configs
) external;
/// @notice Updates the active flag of an asset's Spoke on a specified Hub.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @param active The new active flag.
function updateSpokeActive(address hub, uint256 assetId, address spoke, bool active) external;
/// @notice Updates the halted flag of an asset's Spoke on a specified Hub.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @param halted The new halted flag.
function updateSpokeHalted(address hub, uint256 assetId, address spoke, bool halted) external;
/// @notice Updates the add cap of an asset's spoke on a specified hub.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @param addCap The new add cap.
function updateSpokeAddCap(address hub, uint256 assetId, address spoke, uint256 addCap) external;
/// @notice Updates the draw cap of an asset's Spoke on a specified Hub.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @param drawCap The new draw cap.
function updateSpokeDrawCap(
address hub,
uint256 assetId,
address spoke,
uint256 drawCap
) external;
/// @notice Updates the risk premium threshold of an asset's Spoke on a specified Hub.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @param riskPremiumThreshold The new risk premium threshold.
function updateSpokeRiskPremiumThreshold(
address hub,
uint256 assetId,
address spoke,
uint256 riskPremiumThreshold
) external;
/// @notice Updates the caps of an asset's Spoke on a specified Hub.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
/// @param spoke The address of the Spoke.
/// @param addCap The new add cap.
/// @param drawCap The new draw cap.
function updateSpokeCaps(
address hub,
uint256 assetId,
address spoke,
uint256 addCap,
uint256 drawCap
) external;
/// @notice Deactivates all assets of a Spoke on a specified Hub by setting the active flag to false.
/// @param hub The address of the Hub.
/// @param spoke The address of the Spoke.
function deactivateSpoke(address hub, address spoke) external;
/// @notice Halts all assets of a Spoke on a specified Hub by setting the halted flag to true.
/// @param hub The address of the Hub.
/// @param spoke The address of the Spoke.
function haltSpoke(address hub, address spoke) external;
/// @notice Resets draw cap and add cap to zero for a Spoke on a specified Hub.
/// @param hub The address of the Hub.
/// @param spoke The address of the Spoke.
function resetSpokeCaps(address hub, address spoke) external;
/// @notice Updates the interest rate data for an asset.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
/// @param irData The interest rate data to apply to the given asset, encoded in bytes.
function updateInterestRateData(address hub, uint256 assetId, bytes calldata irData) external;
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/interfaces/IExtSload.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
/// @title IExtSload
/// @author Aave Labs
/// @notice Minimal interface to easily access storage of source contract externally. See https://eips.ethereum.org/EIPS/eip-2330#rationale.
interface IExtSload {
/// @notice Returns the storage `value` of this contract at a given `slot`.
/// @param slot Slot to SLOAD from.
function extSload(bytes32 slot) external view returns (bytes32 value);
/// @notice Returns the storage `values` of this contract at the given `slots`.
/// @param slots Array of slots to SLOAD from.
function extSloads(bytes32[] calldata slots) external view returns (bytes32[] memory values);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/interfaces/IIntentConsumer.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {INoncesKeyed} from 'src/interfaces/INoncesKeyed.sol';
/// @title IIntentConsumer
/// @author Aave Labs
/// @notice Minimal interface for IntentConsumer.
interface IIntentConsumer is INoncesKeyed {
/// @notice Thrown when given signature is invalid.
error InvalidSignature();
/// @notice Returns the EIP-712 domain separator.
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/interfaces/IMulticall.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
/// @title IMulticall
/// @author Aave Labs
/// @notice Minimal interface for Multicall.
interface IMulticall {
/// @notice Call multiple functions in the current contract and return the data from each if they all succeed.
/// @param data The encoded function data for each of the calls to make to this contract.
/// @return results The results from each of the calls passed in via data.
function multicall(bytes[] calldata data) external returns (bytes[] memory);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/interfaces/INoncesKeyed.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
interface INoncesKeyed {
/// @notice Thrown when nonce being consumed does not match `currentNonce` for `account`.
error InvalidAccountNonce(address account, uint256 currentNonce);
/// @notice Allows caller to revoke their next sequential nonce at specified `key`.
/// @dev This does not invalidate nonce at other `key`s namespace.
/// @param key The key which specifies namespace of the nonce.
/// @return keyNonce The revoked key-prefixed nonce.
function useNonce(uint192 key) external returns (uint256 keyNonce);
/// @notice Returns the next unused nonce for an address and key. Result contains the key prefix.
/// @param owner The address of the nonce owner.
/// @param key The key which specifies namespace of the nonce.
/// @return keyNonce The first 24 bytes are for the key, & the last 8 bytes for the nonce.
function nonces(address owner, uint192 key) external view returns (uint256 keyNonce);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/interfaces/IRescuable.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
/// @title IRescuable
/// @author Aave Labs
/// @notice Interface for Rescuable.
interface IRescuable {
/// @notice Thrown when caller is not the rescue guardian.
error OnlyRescueGuardian();
/// @notice Recovers ERC20 tokens sent to this contract.
/// @param token The address of the ERC20 token to rescue.
/// @param to The address to send the rescued tokens to.
/// @param amount Amount of tokens to rescue.
function rescueToken(address token, address to, uint256 amount) external;
/// @notice Recovers native assets remaining in this contract.
/// @param to The address to send rescued native assets to.
/// @param amount Amount of native assets to rescue.
function rescueNative(address to, uint256 amount) external;
/// @notice Returns the rescue guardian address.
/// @return The address allowed to rescue funds.
function rescueGuardian() external view returns (address);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/position-manager/interfaces/IConfigPositionManager.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IPositionManagerIntentBase} from 'src/position-manager/interfaces/IPositionManagerIntentBase.sol';
type ConfigPermissions is uint8;
/// @title IConfigPositionManager
/// @author Aave Labs
/// @notice Interface for position manager handling user configuration actions on behalf of an user.
interface IConfigPositionManager is IPositionManagerIntentBase {
/// @notice Struct to hold the config permission values.
/// @dev canSetUsingAsCollateral Whether the delegatee can set using as collateral on behalf of the user.
/// @dev canUpdateUserRiskPremium Whether the delegatee can update user risk premium on behalf of the user.
/// @dev canUpdateUserDynamicConfig Whether the delegatee can update user dynamic config on behalf of the user.
struct ConfigPermissionValues {
bool canSetUsingAsCollateral;
bool canUpdateUserRiskPremium;
bool canUpdateUserDynamicConfig;
}
/// @notice Structured parameters for global permission permit intent.
/// @dev spoke The address of the Spoke.
/// @dev delegator The address of the delegator.
/// @dev delegatee The address of the delegatee.
/// @dev status The new status of the permission.
/// @dev nonce The key-prefixed nonce for the signature.
/// @dev deadline The deadline for the intent.
struct SetGlobalPermissionPermit {
address spoke;
address delegator;
address delegatee;
bool status;
uint256 nonce;
uint256 deadline;
}
/// @notice Structured parameters for using as collateral permission permit intent.
/// @dev spoke The address of the Spoke.
/// @dev delegator The address of the delegator.
/// @dev delegatee The address of the delegatee.
/// @dev status The new status of the permission.
/// @dev nonce The key-prefixed nonce for the signature.
/// @dev deadline The deadline for the intent.
struct SetCanSetUsingAsCollateralPermissionPermit {
address spoke;
address delegator;
address delegatee;
bool status;
uint256 nonce;
uint256 deadline;
}
/// @notice Structured parameters for user risk premium permission permit intent.
/// @dev spoke The address of the Spoke.
/// @dev delegator The address of the delegator.
/// @dev delegatee The address of the delegatee.
/// @dev status The new status of the permission.
/// @dev nonce The key-prefixed nonce for the signature.
/// @dev deadline The deadline for the intent.
struct SetCanUpdateUserRiskPremiumPermissionPermit {
address spoke;
address delegator;
address delegatee;
bool status;
uint256 nonce;
uint256 deadline;
}
/// @notice Structured parameters for user dynamic config permission permit intent.
/// @dev spoke The address of the Spoke.
/// @dev delegator The address of the delegator.
/// @dev delegatee The address of the delegatee.
/// @dev status The new status of the permission.
/// @dev nonce The key-prefixed nonce for the signature.
/// @dev deadline The deadline for the intent.
struct SetCanUpdateUserDynamicConfigPermissionPermit {
address spoke;
address delegator;
address delegatee;
bool status;
uint256 nonce;
uint256 deadline;
}
/// @notice Emitted when a global config permission is updated.
/// @param spoke The address of the Spoke.
/// @param delegator The address of the delegator.
/// @param delegatee The address of the delegatee.
/// @param oldPermissions The old config permissions.
/// @param newPermissions The new config permissions.
event UpdateConfigPermissions(
address indexed spoke,
address indexed delegator,
address indexed delegatee,
ConfigPermissions oldPermissions,
ConfigPermissions newPermissions
);
/// @notice Emitted when setting using as collateral on behalf of a user.
/// @param spoke The address of the Spoke.
/// @param caller The transaction initiator.
/// @param onBehalfOf The owner of the position being modified.
/// @param reserveId The identifier of the reserve.
/// @param usingAsCollateral Whether the reserve is enabled or disabled as collateral.
event SetUsingAsCollateralOnBehalfOf(
address indexed spoke,
address indexed caller,
address indexed onBehalfOf,
uint256 reserveId,
bool usingAsCollateral
);
/// @notice Emitted when updating user risk premium on behalf of a user.
/// @param spoke The address of the Spoke.
/// @param caller The transaction initiator.
/// @param onBehalfOf The owner of the position being modified.
event UpdateUserRiskPremiumOnBehalfOf(
address indexed spoke,
address indexed caller,
address indexed onBehalfOf
);
/// @notice Emitted when updating dynamic config on behalf of a user.
/// @param spoke The address of the Spoke.
/// @param caller The transaction initiator.
/// @param onBehalfOf The owner of the position being modified.
event UpdateUserDynamicConfigOnBehalfOf(
address indexed spoke,
address indexed caller,
address indexed onBehalfOf
);
/// @notice Thrown when the delegatee of a function was not given permission by the user.
error DelegateeNotAllowed();
/// @notice Sets the global permission for a delegatee.
/// @param spoke The address of the Spoke.
/// @param delegatee The address of the delegatee.
/// @param status The new permission status.
function setGlobalPermission(address spoke, address delegatee, bool status) external;
/// @notice Sets the using as collateral permission for a delegatee.
/// @param spoke The address of the Spoke.
/// @param delegatee The address of the delegatee.
/// @param status The new permission status.
function setCanSetUsingAsCollateralPermission(
address spoke,
address delegatee,
bool status
) external;
/// @notice Sets the user risk premium permission for a delegatee.
/// @param spoke The address of the Spoke.
/// @param delegatee The address of the delegatee.
/// @param status The new permission status.
function setCanUpdateUserRiskPremiumPermission(
address spoke,
address delegatee,
bool status
) external;
/// @notice Sets the user dynamic config permission for a delegatee.
/// @param spoke The address of the Spoke.
/// @param delegatee The address of the delegatee.
/// @param status The new permission status.
function setCanUpdateUserDynamicConfigPermission(
address spoke,
address delegatee,
bool status
) external;
/// @notice Sets the global permission for a delegatee using an EIP712-typed intent.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @param params The structured SetGlobalPermissionPermit parameters.
/// @param signature The EIP712-compliant signature bytes.
function setGlobalPermissionWithSig(
SetGlobalPermissionPermit calldata params,
bytes calldata signature
) external;
/// @notice Sets the using as collateral permission for a delegatee using an EIP712-typed intent.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @param params The structured SetCanSetUsingAsCollateralPermissionPermit parameters.
/// @param signature The EIP712-compliant signature bytes.
function setCanSetUsingAsCollateralPermissionWithSig(
SetCanSetUsingAsCollateralPermissionPermit calldata params,
bytes calldata signature
) external;
/// @notice Sets the user risk premium permission for a delegatee using an EIP712-typed intent.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @param params The structured SetCanUpdateUserRiskPremiumPermissionPermit parameters.
/// @param signature The EIP712-compliant signature bytes.
function setCanUpdateUserRiskPremiumPermissionWithSig(
SetCanUpdateUserRiskPremiumPermissionPermit calldata params,
bytes calldata signature
) external;
/// @notice Sets the user dynamic config permission for a delegatee using an EIP712-typed intent.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @param params The structured SetCanUpdateUserDynamicConfigPermissionPermit parameters.
/// @param signature The EIP712-compliant signature bytes.
function setCanUpdateUserDynamicConfigPermissionWithSig(
SetCanUpdateUserDynamicConfigPermissionPermit calldata params,
bytes calldata signature
) external;
/// @notice Renounces the global permission given by the delegator.
/// @param spoke The address of the Spoke.
/// @param delegator The address of the delegator.
function renounceGlobalPermission(address spoke, address delegator) external;
/// @notice Renounces the using as collateral permission given by the delegator.
/// @param spoke The address of the Spoke.
/// @param delegator The address of the delegator.
function renounceCanUpdateUsingAsCollateralPermission(address spoke, address delegator) external;
/// @notice Renounces the user risk premium permission given by the delegator.
/// @param spoke The address of the Spoke.
/// @param delegator The address of the delegator.
function renounceCanUpdateUserRiskPremiumPermission(address spoke, address delegator) external;
/// @notice Renounces the user dynamic config permission given by the delegator.
/// @param spoke The address of the Spoke.
/// @param delegator The address of the delegator.
function renounceCanUpdateUserDynamicConfigPermission(address spoke, address delegator) external;
/// @notice Sets the using as collateral status on behalf of a user for a specified reserve.
/// @dev The `msg.sender` must be the delegatee to perform this action on behalf of the user.
/// @dev Contract must be an active and approved user position manager of `onBehalfOf`.
/// @param spoke The address of the Spoke.
/// @param reserveId The id of the reserve.
/// @param usingAsCollateral The new using as collateral status.
/// @param onBehalfOf The address of the user.
function setUsingAsCollateralOnBehalfOf(
address spoke,
uint256 reserveId,
bool usingAsCollateral,
address onBehalfOf
) external;
/// @notice Updates the user risk premium on behalf of a user.
/// @dev The `msg.sender` must be the delegatee to perform this action on behalf of the user.
/// @dev Contract must be an active and approved user position manager of `onBehalfOf`.
/// @param spoke The address of the Spoke.
/// @param onBehalfOf The address of the user.
function updateUserRiskPremiumOnBehalfOf(address spoke, address onBehalfOf) external;
/// @notice Updates the user dynamic config on behalf of a user.
/// @dev The `msg.sender` must be the delegatee to perform this action on behalf of the user.
/// @dev Contract must be an active and approved user position manager of `onBehalfOf`.
/// @param spoke The address of the Spoke.
/// @param onBehalfOf The address of the user.
function updateUserDynamicConfigOnBehalfOf(address spoke, address onBehalfOf) external;
/// @notice Returns the config permissions for a delegatee on behalf of a user.
/// @param spoke The address of the Spoke.
/// @param delegatee The address of the delegatee.
/// @param onBehalfOf The address of the user.
/// @return The ConfigPermissionValues for the delegatee on behalf of the user.
function getConfigPermissions(
address spoke,
address delegatee,
address onBehalfOf
) external view returns (ConfigPermissionValues memory);
/// @notice Returns the type hash for the SetGlobalPermissionPermit intent.
function SET_GLOBAL_PERMISSION_PERMIT_TYPEHASH() external view returns (bytes32);
/// @notice Returns the type hash for the SetCanSetUsingAsCollateralPermissionPermit intent.
function SET_CAN_SET_USING_AS_COLLATERAL_PERMISSION_PERMIT_TYPEHASH()
external
view
returns (bytes32);
/// @notice Returns the type hash for the SetCanUpdateUserRiskPremiumPermissionPermit intent.
function SET_CAN_UPDATE_USER_RISK_PREMIUM_PERMISSION_PERMIT_TYPEHASH()
external
view
returns (bytes32);
/// @notice Returns the type hash for the SetCanUpdateUserDynamicConfigPermissionPermit intent.
function SET_CAN_UPDATE_USER_DYNAMIC_CONFIG_PERMISSION_PERMIT_TYPEHASH()
external
view
returns (bytes32);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/position-manager/interfaces/IGiverPositionManager.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IPositionManagerBase} from 'src/position-manager/interfaces/IPositionManagerBase.sol';
/// @title IGiverPositionManager
/// @author Aave Labs
/// @notice Interface for position manager handling supply and repay actions on behalf of users.
interface IGiverPositionManager is IPositionManagerBase {
/// @notice Emitted when supplying on behalf of a user.
/// @param spoke The address of the Spoke.
/// @param caller The transaction initiator, and supplier of the underlying asset.
/// @param onBehalfOf The owner of the modified position.
/// @param reserveId The identifier of the reserve.
/// @param suppliedShares The amount of supply shares minted.
/// @param suppliedAmount The amount of underlying asset supplied.
event SupplyOnBehalfOf(
address indexed spoke,
address indexed caller,
address indexed onBehalfOf,
uint256 reserveId,
uint256 suppliedShares,
uint256 suppliedAmount
);
/// @notice Emitted when repaying on behalf of a user.
/// @param spoke The address of the Spoke.
/// @param caller The transaction initiator who is repaying the underlying asset.
/// @param onBehalfOf The owner of the position whose debt is being repaid.
/// @param reserveId The identifier of the reserve.
/// @param repaidShares The amount of debt shares burned.
/// @param repaidAmount The amount of underlying asset repaid.
event RepayOnBehalfOf(
address indexed spoke,
address indexed caller,
address indexed onBehalfOf,
uint256 reserveId,
uint256 repaidShares,
uint256 repaidAmount
);
/// @notice Error thrown when the repay amount is set to `type(uint256).max`, as it is not allowed.
error RepayOnBehalfMaxUintNotAllowed();
/// @notice Executes a supply on behalf of a user.
/// @dev Contract must be an active and approved user position manager of `onBehalfOf`.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param amount The amount to supply.
/// @param onBehalfOf The address of the user to supply on behalf of.
/// @return The amount of shares supplied.
/// @return The amount of assets supplied.
function supplyOnBehalfOf(
address spoke,
uint256 reserveId,
uint256 amount,
address onBehalfOf
) external returns (uint256, uint256);
/// @notice Executes a repay on behalf of a user.
/// @dev If the amount exceeds the user's current debt, the entire debt is repaid.
/// @dev Using `type(uint256).max` to repay the full debt is not allowed with this method.
/// @dev Contract must be an active and approved user position manager of `onBehalfOf`.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param amount The amount to repay.
/// @param onBehalfOf The address of the user to repay on behalf of.
/// @return The amount of shares repaid.
/// @return The amount of assets repaid.
function repayOnBehalfOf(
address spoke,
uint256 reserveId,
uint256 amount,
address onBehalfOf
) external returns (uint256, uint256);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/position-manager/interfaces/INativeTokenGateway.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IPositionManagerBase} from 'src/position-manager/interfaces/IPositionManagerBase.sol';
/// @title INativeTokenGateway
/// @author Aave Labs
/// @notice Abstracts actions to the protocol involving the native token.
/// @dev Must be set as `PositionManager` on the Spoke for the user.
interface INativeTokenGateway is IPositionManagerBase {
/// @notice Thrown when the underlying asset is not the wrapped native asset.
error NotNativeWrappedAsset();
/// @notice Thrown when the native amount sent does not match the given amount parameter.
error NativeAmountMismatch();
/// @notice Wraps the native asset and supplies to a specified registered Spoke.
/// @dev Contract must be an active and approved user position manager of the caller.
/// @param spoke The address of the registered Spoke.
/// @param reserveId The identifier of the reserve for the wrapped asset.
/// @param amount Amount to wrap and supply.
/// @return The amount of shares supplied.
/// @return The amount of assets supplied.
function supplyNative(
address spoke,
uint256 reserveId,
uint256 amount
) external payable returns (uint256, uint256);
/// @notice Wraps the native asset, supplies to a specified registered Spoke and sets it as collateral.
/// @dev Contract must be an active and approved user position manager of the caller.
/// @param spoke The address of the registered Spoke.
/// @param reserveId The identifier of the reserve for the wrapped asset.
/// @param amount Amount to wrap and supply.
/// @return The amount of shares supplied.
/// @return The amount of assets supplied.
function supplyAsCollateralNative(
address spoke,
uint256 reserveId,
uint256 amount
) external payable returns (uint256, uint256);
/// @notice Withdraws the wrapped asset from a specified registered Spoke and unwraps it back to the native asset.
/// @dev Contract must be an active and approved user position manager of the caller.
/// @dev The withdrawn amount may be lower than requested if the user has insufficient supplied assets.
/// @param spoke The address of the registered Spoke.
/// @param reserveId The identifier of the reserve for the wrapped asset.
/// @param amount Amount to withdraw and unwrap.
/// @return The amount of shares withdrawn.
/// @return The amount of assets withdrawn.
function withdrawNative(
address spoke,
uint256 reserveId,
uint256 amount
) external returns (uint256, uint256);
/// @notice Borrows the wrapped asset from a specified registered Spoke and unwraps it back to the native asset.
/// @dev Contract must be an active and approved user position manager of the caller.
/// @param spoke The address of the registered Spoke.
/// @param reserveId The identifier of the reserve for the wrapped asset.
/// @param amount Amount to borrow and unwrap.
/// @return The amount of shares borrowed.
/// @return The amount of assets borrowed.
function borrowNative(
address spoke,
uint256 reserveId,
uint256 amount
) external returns (uint256, uint256);
/// @notice Wraps the native asset and repays debt on a specified registered Spoke.
/// @dev It refunds any excess funds sent beyond the required debt repayment.
/// @dev Contract must be an active and approved user position manager of the caller.
/// @param spoke The address of the registered Spoke.
/// @param reserveId The identifier of the reserve for the wrapped asset.
/// @param amount Amount to wrap and repay.
/// @return The amount of shares repaid.
/// @return The amount of assets repaid.
function repayNative(
address spoke,
uint256 reserveId,
uint256 amount
) external payable returns (uint256, uint256);
/// @notice Returns the address of the Native Wrapper.
function NATIVE_TOKEN_WRAPPER() external view returns (address);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/position-manager/interfaces/IPositionManagerBase.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IMulticall} from 'src/interfaces/IMulticall.sol';
import {IRescuable} from 'src/interfaces/IRescuable.sol';
/// @title IPositionManagerBase
/// @author Aave Labs
/// @notice Base interface for position managers.
/// @dev This base interface is not mandatory for position managers, it only provides optional convenience methods.
interface IPositionManagerBase is IRescuable, IMulticall {
/// @notice Emitted when the Spoke's registration status is updated.
event RegisterSpoke(address indexed spoke, bool registered);
/// @notice Thrown when the specified address is invalid.
error InvalidAddress();
/// @notice Thrown when the specified amount is invalid.
error InvalidAmount();
/// @notice Thrown when trying to call an unsupported action on this position manager.
error UnsupportedAction();
/// @notice Thrown when the specified Spoke is not registered.
error SpokeNotRegistered();
/// @notice Facilitates setting this position manager as user position manager on the specified registered Spoke
/// with a typed signature from `onBehalfOf`.
/// @dev The signature is consumed on the specified registered Spoke.
/// @dev The given data is passed to the Spoke for the signature to be verified.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @param spoke The address of the registered spoke.
/// @param onBehalfOf The address of the user on whose behalf this position manager can act.
/// @param approve True to approve the position manager, false to revoke approval.
/// @param nonce The key-prefixed nonce for the signature.
/// @param deadline The deadline for the intent.
/// @param signature The EIP712-typed signed bytes for the intent.
function setSelfAsUserPositionManagerWithSig(
address spoke,
address onBehalfOf,
bool approve,
uint256 nonce,
uint256 deadline,
bytes calldata signature
) external;
/// @notice Facilitates consuming a permit for the given reserve's underlying asset on the specified registered Spoke.
/// @dev The given data is passed to the underlying asset for the signature to be verified.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @dev Spender is this position manager contract.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param onBehalfOf The address of the user on whose behalf the permit is being used.
/// @param value The amount of the underlying asset to permit.
/// @param deadline The deadline for the permit.
function permitReserveUnderlying(
address spoke,
uint256 reserveId,
address onBehalfOf,
uint256 value,
uint256 deadline,
uint8 permitV,
bytes32 permitR,
bytes32 permitS
) external;
/// @notice Allows contract to renounce its position manager role for the specified user.
/// @param spoke The address of the registered Spoke.
/// @param user The address of the user to renounce the position manager role for.
function renouncePositionManagerRole(address spoke, address user) external;
/// @notice Registers or deregisters the Spoke.
/// @param spoke The address of the Spoke.
/// @param registered `true` to register, `false` to deregister.
function registerSpoke(address spoke, bool registered) external;
/// @notice Returns whether the specified Spoke is registered.
/// @param spoke The address of the Spoke.
/// @return `true` if the Spoke is registered, `false` otherwise.
function isSpokeRegistered(address spoke) external view returns (bool);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/position-manager/interfaces/IPositionManagerIntentBase.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IIntentConsumer} from 'src/interfaces/IIntentConsumer.sol';
import {IPositionManagerBase} from 'src/position-manager/interfaces/IPositionManagerBase.sol';
/// @title IPositionManagerIntentBase
/// @author Aave Labs
/// @notice Interface to extend PositionManagerBase with intent consuming capabilities.
interface IPositionManagerIntentBase is IIntentConsumer, IPositionManagerBase {}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/position-manager/interfaces/ISignatureGateway.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IPositionManagerIntentBase} from 'src/position-manager/interfaces/IPositionManagerIntentBase.sol';
/// @title ISignatureGateway
/// @author Aave Labs
/// @notice Minimal interface for protocol actions involving signed intents.
interface ISignatureGateway is IPositionManagerIntentBase {
/// @notice Intent data to supply assets to a reserve.
/// @param spoke The address of the registered Spoke.
/// @param reserveId The identifier of the reserve.
/// @param amount The amount of assets to supply.
/// @param onBehalfOf The address of the user on whose behalf the supply is performed.
/// @param nonce The key-prefixed nonce for the signature.
/// @param deadline The deadline for the intent.
struct Supply {
address spoke;
uint256 reserveId;
uint256 amount;
address onBehalfOf;
uint256 nonce;
uint256 deadline;
}
/// @notice Intent data to withdraw assets from a reserve.
/// @param spoke The address of the registered Spoke.
/// @param reserveId The identifier of the reserve.
/// @param amount The amount of assets to withdraw.
/// @param onBehalfOf The address of the user on whose behalf the withdraw is performed.
/// @param nonce The key-prefixed nonce for the signature.
/// @param deadline The deadline for the intent.
struct Withdraw {
address spoke;
uint256 reserveId;
uint256 amount;
address onBehalfOf;
uint256 nonce;
uint256 deadline;
}
/// @notice Intent data to borrow assets from a reserve.
/// @param spoke The address of the registered Spoke.
/// @param reserveId The identifier of the reserve.
/// @param amount The amount of assets to borrow.
/// @param onBehalfOf The address of the user on whose behalf the borrow is performed.
/// @param nonce The key-prefixed nonce for the signature.
/// @param deadline The deadline for the intent.
struct Borrow {
address spoke;
uint256 reserveId;
uint256 amount;
address onBehalfOf;
uint256 nonce;
uint256 deadline;
}
/// @notice Intent data to repay assets to a reserve.
/// @param spoke The address of the registered Spoke.
/// @param reserveId The identifier of the reserve.
/// @param amount The amount of assets to repay.
/// @param onBehalfOf The address of the user on whose behalf the repay is performed.
/// @param nonce The key-prefixed nonce for the signature.
/// @param deadline The deadline for the intent.
struct Repay {
address spoke;
uint256 reserveId;
uint256 amount;
address onBehalfOf;
uint256 nonce;
uint256 deadline;
}
/// @notice Intent data to enable or disable a reserve as collateral.
/// @param spoke The address of the registered Spoke.
/// @param reserveId The identifier of the reserve.
/// @param useAsCollateral True to enable the reserve as collateral, false to disable it.
/// @param onBehalfOf The address of the user on whose behalf the action is performed.
/// @param nonce The key-prefixed nonce for the signature.
/// @param deadline The deadline for the intent.
struct SetUsingAsCollateral {
address spoke;
uint256 reserveId;
bool useAsCollateral;
address onBehalfOf;
uint256 nonce;
uint256 deadline;
}
/// @notice Intent data to update the risk premium of a user position.
/// @param spoke The address of the registered Spoke.
/// @param onBehalfOf The address of the user whose risk premium is being updated.
/// @param nonce The key-prefixed nonce for the signature.
/// @param deadline The deadline for the intent.
struct UpdateUserRiskPremium {
address spoke;
address onBehalfOf;
uint256 nonce;
uint256 deadline;
}
/// @notice Intent data to update the dynamic configuration of a user position.
/// @param spoke The address of the registered Spoke.
/// @param onBehalfOf The address of the user whose dynamic config is being updated.
/// @param nonce The key-prefixed nonce for the signature.
/// @param deadline The deadline for the intent.
struct UpdateUserDynamicConfig {
address spoke;
address onBehalfOf;
uint256 nonce;
uint256 deadline;
}
/// @notice Facilitates `supply` action on the specified registered Spoke with a typed signature from `onBehalfOf`.
/// @dev Supplied assets are pulled from `onBehalfOf`, prior approval to this gateway is required.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @dev Contract must be an active and approved user position manager of `onBehalfOf`.
/// @param params The structured supply parameters.
/// @param signature The EIP712-typed signed bytes for the intent.
/// @return The amount of shares supplied.
/// @return The amount of assets supplied.
function supplyWithSig(
Supply calldata params,
bytes calldata signature
) external returns (uint256, uint256);
/// @notice Facilitates `withdraw` action on the specified registered Spoke with a typed signature from `onBehalfOf`.
/// @dev Providing an amount exceeding the user's current withdrawable balance indicates a request for a maximum withdrawal.
/// @dev Withdrawn assets are pushed to `onBehalfOf`.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @dev Contract must be an active and approved user position manager of `onBehalfOf`.
/// @param params The structured withdraw parameters.
/// @param signature The EIP712-typed signed bytes for the intent.
/// @return The amount of shares withdrawn.
/// @return The amount of assets withdrawn.
function withdrawWithSig(
Withdraw calldata params,
bytes calldata signature
) external returns (uint256, uint256);
/// @notice Facilitates `borrow` action on the specified registered Spoke with a typed signature from `onBehalfOf`.
/// @dev Borrowed assets are pushed to `onBehalfOf`.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @dev Contract must be an active and approved user position manager of `onBehalfOf`.
/// @param params The structured borrow parameters.
/// @param signature The EIP712-typed signed bytes for the intent.
/// @return The amount of shares borrowed.
/// @return The amount of assets borrowed.
function borrowWithSig(
Borrow calldata params,
bytes calldata signature
) external returns (uint256, uint256);
/// @notice Facilitates `repay` action on the specified registered Spoke with a typed signature from `onBehalfOf`.
/// @dev Repay assets are pulled from `onBehalfOf`, prior approval to this gateway is required.
/// @dev Providing an amount greater than the user's current debt indicates a request to repay the maximum possible amount.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @dev Contract must be an active and approved user position manager of `onBehalfOf`.
/// @param params The structured repay parameters.
/// @param signature The EIP712-typed signed bytes for the intent.
/// @return The amount of shares repaid.
/// @return The amount of assets repaid.
function repayWithSig(
Repay calldata params,
bytes calldata signature
) external returns (uint256, uint256);
/// @notice Facilitates `setUsingAsCollateral` action on the specified registered Spoke with a typed signature from `onBehalfOf`.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @dev Contract must be an active and approved user position manager of `onBehalfOf`.
/// @param params The structured setUsingAsCollateral parameters.
/// @param signature The EIP712-typed signed bytes for the intent.
function setUsingAsCollateralWithSig(
SetUsingAsCollateral calldata params,
bytes calldata signature
) external;
/// @notice Facilitates `updateUserRiskPremium` action on the specified registered Spoke with a typed signature from `onBehalfOf`.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @dev Contract must be an active and approved user position manager of `onBehalfOf`.
/// @param params The structured updateUserRiskPremium parameters.
/// @param signature The EIP712-typed signed bytes for the intent.
function updateUserRiskPremiumWithSig(
UpdateUserRiskPremium calldata params,
bytes calldata signature
) external;
/// @notice Facilitates `updateUserDynamicConfig` action on the specified registered Spoke with a typed signature from `onBehalfOf`.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @dev Contract must be an active and approved user position manager of `onBehalfOf`.
/// @param params The structured updateUserDynamicConfig parameters.
/// @param signature The EIP712-typed signed bytes for the intent.
function updateUserDynamicConfigWithSig(
UpdateUserDynamicConfig calldata params,
bytes calldata signature
) external;
/// @notice Returns the type hash for the Supply intent.
function SUPPLY_TYPEHASH() external view returns (bytes32);
/// @notice Returns the type hash for the Withdraw intent.
function WITHDRAW_TYPEHASH() external view returns (bytes32);
/// @notice Returns the type hash for the Borrow intent.
function BORROW_TYPEHASH() external view returns (bytes32);
/// @notice Returns the type hash for the Repay intent.
function REPAY_TYPEHASH() external view returns (bytes32);
/// @notice Returns the type hash for the SetUsingAsCollateral intent.
function SET_USING_AS_COLLATERAL_TYPEHASH() external view returns (bytes32);
/// @notice Returns the type hash for the UpdateUserRiskPremium intent.
function UPDATE_USER_RISK_PREMIUM_TYPEHASH() external view returns (bytes32);
/// @notice Returns the type hash for the UpdateUserDynamicConfig intent.
function UPDATE_USER_DYNAMIC_CONFIG_TYPEHASH() external view returns (bytes32);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/position-manager/interfaces/ITakerPositionManager.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IPositionManagerIntentBase} from 'src/position-manager/interfaces/IPositionManagerIntentBase.sol';
/// @title ITakerPositionManager
/// @author Aave Labs
/// @notice Interface for position manager handling withdraw permit and borrow permit actions on behalf of users.
/// @dev Allowances in the context of this TakerPositionManager represent how much the spender is allowed to impact
/// the owner position (decreasing supplied amount for the withdraw action, increasing debt amount for the borrow action),
/// and not the amount of assets that the spender will receive from the onBehalfOf action.
interface ITakerPositionManager is IPositionManagerIntentBase {
/// @notice Structured parameters for withdraw permit intent.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param owner The address of the owner.
/// @param spender The address of the spender.
/// @param amount The amount of allowance.
/// @param nonce The key-prefixed nonce for the signature.
/// @param deadline The deadline for the intent.
struct WithdrawPermit {
address spoke;
uint256 reserveId;
address owner;
address spender;
uint256 amount;
uint256 nonce;
uint256 deadline;
}
/// @notice Structured parameters for borrow permit intent.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param owner The address of the owner.
/// @param spender The address of the spender.
/// @param amount The amount of allowance.
/// @param nonce The key-prefixed nonce for the signature.
/// @param deadline The deadline for the intent.
struct BorrowPermit {
address spoke;
uint256 reserveId;
address owner;
address spender;
uint256 amount;
uint256 nonce;
uint256 deadline;
}
/// @notice Emitted when the withdraw allowance granted to a spender is updated.
/// @param spoke The address of the Spoke.
/// @param owner The address of the owner.
/// @param spender The address of the spender.
/// @param reserveId The identifier of the reserve.
/// @param amount The amount of allowance.
event WithdrawApproval(
address indexed spoke,
address indexed owner,
address indexed spender,
uint256 reserveId,
uint256 amount
);
/// @notice Emitted when the borrow allowance granted to a spender is updated.
/// @param spoke The address of the Spoke.
/// @param owner The address of the owner.
/// @param spender The address of the spender.
/// @param reserveId The identifier of the reserve.
/// @param amount The amount of allowance.
event BorrowApproval(
address indexed spoke,
address indexed owner,
address indexed spender,
uint256 reserveId,
uint256 amount
);
/// @notice Emitted when withdrawing on behalf of a user.
/// @param spoke The address of the Spoke.
/// @param caller The transaction initiator, and recipient of the underlying asset being withdrawn.
/// @param onBehalfOf The owner of the modified position.
/// @param reserveId The identifier of the reserve.
/// @param withdrawnShares The amount of supply shares burned.
/// @param withdrawnAmount The amount of underlying asset withdrawn.
event WithdrawOnBehalfOf(
address indexed spoke,
address indexed caller,
address indexed onBehalfOf,
uint256 reserveId,
uint256 withdrawnShares,
uint256 withdrawnAmount
);
/// @notice Emitted when borrowing on behalf of a user.
/// @param spoke The address of the Spoke.
/// @param caller The transaction initiator, and recipient of the underlying asset being borrowed.
/// @param onBehalfOf The owner of the position on which debt is generated.
/// @param reserveId The identifier of the reserve.
/// @param drawnShares The amount of debt shares minted.
/// @param drawnAmount The amount of underlying asset borrowed.
event BorrowOnBehalfOf(
address indexed spoke,
address indexed caller,
address indexed onBehalfOf,
uint256 reserveId,
uint256 drawnShares,
uint256 drawnAmount
);
/// @notice Thrown when the withdraw allowance is insufficient.
error InsufficientWithdrawAllowance(uint256 allowance, uint256 required);
/// @notice Thrown when the borrow allowance is insufficient.
error InsufficientBorrowAllowance(uint256 allowance, uint256 required);
/// @notice Approves a spender to withdraw assets from the specified reserve on behalf of the owner.
/// @dev Using `type(uint256).max` as the amount results in an infinite approval, so the allowance is never decreased.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param spender The address of the spender to receive the allowance.
/// @param amount The amount of allowance.
function approveWithdraw(
address spoke,
uint256 reserveId,
address spender,
uint256 amount
) external;
/// @notice Approves a spender to withdraw assets from the specified reserve on behalf of the owner using an EIP712-typed intent.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @dev Using `type(uint256).max` as the amount results in an infinite approval, so the allowance is never decreased.
/// @param params The structured WithdrawPermit parameters.
/// @param signature The EIP712-compliant signature bytes.
function approveWithdrawWithSig(
WithdrawPermit calldata params,
bytes calldata signature
) external;
/// @notice Approves a spender to borrow assets from the specified reserve on behalf of the owner.
/// @dev Using `type(uint256).max` as the amount results in an infinite approval, so the allowance is never decreased.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param spender The address of the spender to receive the allowance.
/// @param amount The amount of allowance.
function approveBorrow(
address spoke,
uint256 reserveId,
address spender,
uint256 amount
) external;
/// @notice Approves a spender to borrow assets from the specified reserve on behalf of the owner using an EIP712-typed intent.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @dev Using `type(uint256).max` as the amount results in an infinite approval, so the allowance is never decreased.
/// @param params The structured BorrowPermit parameters.
/// @param signature The EIP712-compliant signature bytes.
function approveBorrowWithSig(BorrowPermit calldata params, bytes calldata signature) external;
/// @notice Renounces the withdraw allowance given by the owner.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param owner The address of the owner.
function renounceWithdrawAllowance(address spoke, uint256 reserveId, address owner) external;
/// @notice Renounces the borrow allowance given by the owner.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param owner The address of the owner.
function renounceBorrowAllowance(address spoke, uint256 reserveId, address owner) external;
/// @notice Executes a withdraw on behalf of a user.
/// @dev The caller must have sufficient withdraw allowance from `onBehalfOf`.
/// @dev The caller receives the withdrawn assets.
/// @dev Contract must be an active and approved user position manager of `onBehalfOf`.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param amount The amount to withdraw.
/// @param onBehalfOf The address of the user to withdraw on behalf of.
/// @return The amount of shares withdrawn.
/// @return The amount of assets withdrawn.
function withdrawOnBehalfOf(
address spoke,
uint256 reserveId,
uint256 amount,
address onBehalfOf
) external returns (uint256, uint256);
/// @notice Executes a borrow on behalf of a user.
/// @dev The caller must have sufficient borrow allowance from `onBehalfOf`.
/// @dev The caller receives the borrowed assets.
/// @dev Contract must be an active and approved user position manager of `onBehalfOf`.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param amount The amount to borrow.
/// @param onBehalfOf The address of the user to borrow on behalf of.
/// @return The amount of shares borrowed.
/// @return The amount of assets borrowed.
function borrowOnBehalfOf(
address spoke,
uint256 reserveId,
uint256 amount,
address onBehalfOf
) external returns (uint256, uint256);
/// @notice Returns the withdraw allowance for a spender on behalf of an owner.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param owner The address of the owner.
/// @param spender The address of the spender.
/// @return The amount of withdraw allowance.
function withdrawAllowance(
address spoke,
uint256 reserveId,
address owner,
address spender
) external view returns (uint256);
/// @notice Returns the borrow allowance for a spender on behalf of an owner.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param owner The address of the owner.
/// @param spender The address of the spender.
/// @return The amount of borrow allowance.
function borrowAllowance(
address spoke,
uint256 reserveId,
address owner,
address spender
) external view returns (uint256);
/// @notice Returns the type hash for the WithdrawPermit intent.
function WITHDRAW_PERMIT_TYPEHASH() external view returns (bytes32);
/// @notice Returns the type hash for the BorrowPermit intent.
function BORROW_PERMIT_TYPEHASH() external view returns (bytes32);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/spoke/interfaces/IAaveOracle.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IPriceOracle} from 'src/spoke/interfaces/IPriceOracle.sol';
/// @title IAaveOracle
/// @author Aave Labs
/// @notice Interface for the Aave Oracle.
interface IAaveOracle is IPriceOracle {
/// @dev Emitted when the price feed source of a reserve is updated.
/// @param reserveId The identifier of the reserve.
/// @param source The price feed source of the reserve.
event UpdateReserveSource(uint256 indexed reserveId, address indexed source);
/// @dev Emitted when the Spoke is set.
/// @param spoke The address of the Spoke.
event SetSpoke(address indexed spoke);
/// @dev Thrown when the caller is not the deployer.
error OnlyDeployer();
/// @dev Thrown when the Spoke is already set.
error SpokeAlreadySet();
/// @dev Thrown when the price feed source uses a different number of decimals than the oracle.
/// @param reserveId The identifier of the reserve.
error InvalidSourceDecimals(uint256 reserveId);
/// @dev Thrown when the price feed source is invalid (zero address).
/// @param reserveId The identifier of the reserve.
error InvalidSource(uint256 reserveId);
/// @dev Thrown when the price feed source returns an invalid price (non-positive).
/// @param reserveId The identifier of the reserve.
error InvalidPrice(uint256 reserveId);
/// @dev Thrown when the given address is invalid.
error InvalidAddress();
/// @dev Thrown when the Spoke's oracle does not match the current oracle.
error OracleMismatch();
/// @notice Sets the address of the Spoke.
/// @dev Can only be called once by the deployer.
/// @dev The spoke should be set before any other function is called.
/// @param spoke The address of the Spoke.
function setSpoke(address spoke) external;
/// @notice Sets the price feed source of a reserve.
/// @dev Must be called by the Spoke.
/// @dev The source must implement IPriceFeed.
/// @param reserveId The identifier of the reserve.
/// @param source The price feed source of the reserve.
function setReserveSource(uint256 reserveId, address source) external;
/// @notice Returns the prices of multiple reserves.
/// @dev Reverts if the price of one of the reserves is not greater than 0.
/// @param reserveIds The identifiers of the reserves.
/// @return prices The prices of the reserves.
function getReservesPrices(
uint256[] calldata reserveIds
) external view returns (uint256[] memory);
/// @notice Returns the price feed source of a reserve.
/// @param reserveId The identifier of the reserve.
/// @return source The price feed source of the reserve.
function getReserveSource(uint256 reserveId) external view returns (address);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/spoke/interfaces/IPriceOracle.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
/// @title IPriceOracle
/// @author Aave Labs
/// @notice Basic interface for any price oracle.
/// @dev All prices must use the same number of decimals as the oracle and should be returned in the same currency.
interface IPriceOracle {
/// @dev Reverts if the caller is not the Spoke.
error OnlySpoke();
/// @notice Returns the address of the Spoke.
function spoke() external view returns (address);
/// @notice Returns the number of decimals used to return prices.
function decimals() external view returns (uint8);
/// @notice Returns the reserve price with `decimals` precision.
/// @dev Reverts if the price is not greater than 0.
/// @param reserveId The identifier of the reserve.
/// @return The price of the reserve.
function getReservePrice(uint256 reserveId) external view returns (uint256);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/spoke/interfaces/ISpoke.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IAccessManaged} from 'src/dependencies/openzeppelin/IAccessManaged.sol';
import {IIntentConsumer} from 'src/interfaces/IIntentConsumer.sol';
import {IMulticall} from 'src/interfaces/IMulticall.sol';
import {IHubBase} from 'src/hub/interfaces/IHubBase.sol';
import {IExtSload} from 'src/interfaces/IExtSload.sol';
type ReserveFlags is uint8;
/// @title ISpoke
/// @author Aave Labs
/// @notice Full interface for Spoke.
interface ISpoke is IAccessManaged, IIntentConsumer, IExtSload, IMulticall {
/// @notice Intent data to set user position managers with EIP712-typed signature.
/// @param onBehalfOf The address of the user on whose behalf position manager can act.
/// @param updates The array of position manager updates.
/// @param nonce The nonce for the signature.
/// @param deadline The deadline for the signature.
struct SetUserPositionManagers {
address onBehalfOf;
PositionManagerUpdate[] updates;
uint256 nonce;
uint256 deadline;
}
/// @notice Sub-Intent data to apply position manager update for user.
/// @param positionManager The address of the position manager.
/// @param approve True to approve the position manager, false to revoke approval.
struct PositionManagerUpdate {
address positionManager;
bool approve;
}
/// @notice Reserve level data.
/// @dev underlying The address of the underlying asset.
/// @dev hub The address of the associated Hub.
/// @dev assetId The identifier of the asset in the Hub.
/// @dev decimals The number of decimals of the underlying asset.
/// @dev collateralRisk The risk associated with a collateral asset, expressed in BPS.
/// @dev flags The packed boolean flags of the reserve (a wrapped uint8).
/// @dev dynamicConfigKey The key of the last reserve dynamic config.
struct Reserve {
address underlying;
//
IHubBase hub;
uint16 assetId;
uint8 decimals;
uint24 collateralRisk;
ReserveFlags flags;
uint32 dynamicConfigKey;
}
/// @notice Reserve configuration. Subset of the `Reserve` struct.
/// @dev collateralRisk The risk associated with a collateral asset, expressed in BPS.
/// @dev paused True if all actions are prevented for the reserve.
/// @dev frozen True if new activity is prevented for the reserve.
/// @dev borrowable True if the reserve is borrowable.
/// @dev receiveSharesEnabled True if the liquidator can receive collateral shares during liquidation.
struct ReserveConfig {
uint24 collateralRisk;
bool paused;
bool frozen;
bool borrowable;
bool receiveSharesEnabled;
}
/// @notice Dynamic reserve configuration data.
/// @dev collateralFactor The proportion of a reserve's value eligible to be used as collateral, expressed in BPS.
/// @dev maxLiquidationBonus The maximum extra amount of collateral given to the liquidator as bonus, expressed in BPS. 100_00 represents 0.00% bonus.
/// @dev liquidationFee The protocol fee charged on liquidations, taken from the collateral bonus given to the liquidator, expressed in BPS.
struct DynamicReserveConfig {
uint16 collateralFactor;
uint32 maxLiquidationBonus;
uint16 liquidationFee;
}
/// @notice Liquidation configuration data.
/// @dev targetHealthFactor The ideal health factor to restore a user position during liquidation, expressed in WAD.
/// @dev healthFactorForMaxBonus The health factor under which liquidation bonus is maximum, expressed in WAD.
/// @dev liquidationBonusFactor The value multiplied by `maxLiquidationBonus` to compute the minimum liquidation bonus, expressed in BPS.
struct LiquidationConfig {
uint128 targetHealthFactor;
uint64 healthFactorForMaxBonus;
uint16 liquidationBonusFactor;
}
/// @notice User position data per reserve.
/// @dev drawnShares The drawn shares of the user position.
/// @dev premiumShares The premium shares of the user position.
/// @dev premiumOffsetRay The premium offset of the user position, used to calculate the premium, expressed in asset units and scaled by RAY.
/// @dev suppliedShares The supplied shares of the user position.
/// @dev dynamicConfigKey The key of the user position dynamic config.
struct UserPosition {
uint120 drawnShares;
uint120 premiumShares;
//
int200 premiumOffsetRay;
//
uint120 suppliedShares;
uint32 dynamicConfigKey;
}
/// @notice Position manager configuration data.
/// @dev approval The mapping of position manager user approvals.
/// @dev active True if the position manager is active.
struct PositionManagerConfig {
mapping(address user => bool) approval;
bool active;
}
/// @notice User position status data.
/// @dev map The map of bitmap buckets for the position status.
/// @dev riskPremium The risk premium of the user position, expressed in BPS.
struct PositionStatus {
mapping(uint256 bucket => uint256) map;
uint24 riskPremium;
}
/// @notice User account data describing a user position and its health.
/// @dev riskPremium The risk premium of the user position, expressed in BPS.
/// @dev avgCollateralFactor The weighted average collateral factor of the user position, expressed in WAD.
/// @dev healthFactor The health factor of the user position, expressed in WAD. 1e18 represents a health factor of 1.00.
/// @dev totalCollateralValue The total collateral value of the user position, expressed in units of Value.
/// @dev totalDebtValueRay The total debt value of the user position, expressed in units of Value and scaled by RAY.
/// @dev activeCollateralCount The number of active collaterals, which includes reserves with `collateralFactor` > 0, `enabledAsCollateral` and `suppliedAmount` > 0.
/// @dev borrowCount The number of borrowed reserves of the user position.
struct UserAccountData {
uint256 riskPremium;
uint256 avgCollateralFactor;
uint256 healthFactor;
uint256 totalCollateralValue;
uint256 totalDebtValueRay;
uint256 activeCollateralCount;
uint256 borrowCount;
}
/// @notice Emitted when the immutable variables of the Spoke are set.
/// @param oracle The address of the oracle.
/// @param maxUserReservesLimit The max user reserves limit.
event SetSpokeImmutables(address indexed oracle, uint16 maxUserReservesLimit);
/// @notice Emitted when a liquidation config is updated.
/// @param config The new liquidation config.
event UpdateLiquidationConfig(LiquidationConfig config);
/// @notice Emitted when a reserve is added.
/// @param reserveId The identifier of the reserve.
/// @param assetId The identifier of the asset.
/// @param hub The address of the Hub where the asset is listed.
event AddReserve(uint256 indexed reserveId, uint256 indexed assetId, address indexed hub);
/// @notice Emitted when a reserve configuration is updated.
/// @param reserveId The identifier of the reserve.
/// @param config The reserve configuration.
event UpdateReserveConfig(uint256 indexed reserveId, ReserveConfig config);
/// @notice Emitted when the price source of a reserve is updated.
/// @param reserveId The identifier of the reserve.
/// @param priceSource The address of the new price source.
event UpdateReservePriceSource(uint256 indexed reserveId, address indexed priceSource);
/// @notice Emitted when a dynamic reserve config is added.
/// @dev The config key is the next available key for the reserve, which is now the latest config
/// key of the reserve.
/// @param reserveId The identifier of the reserve.
/// @param dynamicConfigKey The key of the added dynamic config.
/// @param config The dynamic reserve config.
event AddDynamicReserveConfig(
uint256 indexed reserveId,
uint32 indexed dynamicConfigKey,
DynamicReserveConfig config
);
/// @notice Emitted when a dynamic reserve config is updated.
/// @param reserveId The identifier of the reserve.
/// @param dynamicConfigKey The key of the updated dynamic config.
/// @param config The dynamic reserve config.
event UpdateDynamicReserveConfig(
uint256 indexed reserveId,
uint32 indexed dynamicConfigKey,
DynamicReserveConfig config
);
/// @notice Emitted on updatePositionManager action.
/// @param positionManager The address of the position manager.
/// @param active True if position manager has become active.
event UpdatePositionManager(address indexed positionManager, bool active);
/// @notice Emitted on the supply action.
/// @param reserveId The reserve identifier of the underlying asset.
/// @param caller The transaction initiator, and supplier of the underlying asset.
/// @param user The owner of the modified position.
/// @param suppliedShares The amount of supply shares minted.
/// @param suppliedAmount The amount of underlying asset supplied.
event Supply(
uint256 indexed reserveId,
address indexed caller,
address indexed user,
uint256 suppliedShares,
uint256 suppliedAmount
);
/// @notice Emitted on the withdraw action.
/// @param reserveId The reserve identifier of the underlying asset.
/// @param caller The transaction initiator, and recipient of the underlying asset being withdrawn.
/// @param user The owner of the modified position.
/// @param withdrawnShares The amount of supply shares burned.
/// @param withdrawnAmount The amount of underlying asset withdrawn.
event Withdraw(
uint256 indexed reserveId,
address indexed caller,
address indexed user,
uint256 withdrawnShares,
uint256 withdrawnAmount
);
/// @notice Emitted on the borrow action.
/// @param reserveId The reserve identifier of the underlying asset.
/// @param caller The transaction initiator, and recipient of the underlying asset being borrowed.
/// @param user The owner of the position on which debt is generated.
/// @param drawnShares The amount of debt shares minted.
/// @param drawnAmount The amount of underlying asset borrowed.
event Borrow(
uint256 indexed reserveId,
address indexed caller,
address indexed user,
uint256 drawnShares,
uint256 drawnAmount
);
/// @notice Emitted on the repay action.
/// @param reserveId The reserve identifier of the underlying asset.
/// @param caller The transaction initiator who is repaying the underlying asset.
/// @param user The owner of the position whose debt is being repaid.
/// @param drawnShares The amount of drawn shares burned.
/// @param totalAmountRepaid The amount of drawn and premium underlying assets repaid.
/// @param premiumDelta A struct representing the changes to premium debt after repayment.
event Repay(
uint256 indexed reserveId,
address indexed caller,
address indexed user,
uint256 drawnShares,
uint256 totalAmountRepaid,
IHubBase.PremiumDelta premiumDelta
);
/// @dev Emitted when a borrower is liquidated.
/// @param collateralReserveId The identifier of the reserve used as collateral, to receive as a result of the liquidation.
/// @param debtReserveId The identifier of the reserve to be repaid with the liquidation.
/// @param user The address of the borrower getting liquidated.
/// @param liquidator The address of the liquidator.
/// @param receiveShares True if the liquidator received collateral in supplied shares rather than underlying assets.
/// @param debtAmountRestored The amount of debt restored, expressed in asset units.
/// @param drawnSharesLiquidated The amount of drawn shares liquidated.
/// @param premiumDelta A struct representing the changes to premium debt after liquidation.
/// @param collateralAmountRemoved The amount of collateral removed, expressed in asset units.
/// @param collateralSharesLiquidated The total amount of collateral shares liquidated.
/// @param collateralSharesToLiquidator The amount of collateral shares that the liquidator received.
event LiquidationCall(
uint256 indexed collateralReserveId,
uint256 indexed debtReserveId,
address indexed user,
address liquidator,
bool receiveShares,
uint256 debtAmountRestored,
uint256 drawnSharesLiquidated,
IHubBase.PremiumDelta premiumDelta,
uint256 collateralAmountRemoved,
uint256 collateralSharesLiquidated,
uint256 collateralSharesToLiquidator
);
/// @notice Emitted when a reserve deficit is reported to the Hub.
/// @param reserveId The identifier of the reserve.
/// @param user The address of the user.
/// @param drawnShares The amount of drawn shares reported as deficit.
/// @param premiumDelta The premium delta data struct reported as deficit.
event ReportDeficit(
uint256 indexed reserveId,
address indexed user,
uint256 drawnShares,
IHubBase.PremiumDelta premiumDelta
);
/// @notice Emitted on setUsingAsCollateral action.
/// @param reserveId The reserve identifier of the underlying asset.
/// @param caller The transaction initiator.
/// @param user The owner of the position being modified.
/// @param usingAsCollateral Whether the reserve is enabled or disabled as collateral.
event SetUsingAsCollateral(
uint256 indexed reserveId,
address indexed caller,
address indexed user,
bool usingAsCollateral
);
/// @notice Emitted on updateUserRiskPremium action.
/// @param user The owner of the position being modified.
/// @param riskPremium The new risk premium (BPS) value of user.
event UpdateUserRiskPremium(address indexed user, uint256 riskPremium);
/// @notice Emitted when a user's dynamic config is refreshed for all reserves to their latest config key.
/// @param user The address of the user.
event RefreshAllUserDynamicConfig(address indexed user);
/// @notice Emitted when a user's dynamic config is refreshed for a single reserve to its latest config key.
/// @param user The address of the user.
/// @param reserveId The identifier of the reserve.
event RefreshSingleUserDynamicConfig(address indexed user, uint256 reserveId);
/// @notice Emitted on setUserPositionManager or renouncePositionManagerRole action.
/// @param user The address of the user on whose behalf position manager can act.
/// @param positionManager The address of the position manager.
/// @param approve True if position manager approval was granted, false if it was revoked.
event SetUserPositionManager(address indexed user, address indexed positionManager, bool approve);
/// @notice Emitted on refreshPremiumDebt action.
/// @param reserveId The identifier of the reserve.
/// @param user The address of the user.
/// @param premiumDelta The change in premium values.
event RefreshPremiumDebt(
uint256 indexed reserveId,
address indexed user,
IHubBase.PremiumDelta premiumDelta
);
/// @notice Thrown when an asset is not listed on the Hub when adding a reserve.
error AssetNotListed();
/// @notice Thrown when adding a new reserve if that reserve already exists for a given Hub/assetId pair.
error ReserveExists();
/// @notice Thrown when adding a new reserve if an asset id is invalid.
error InvalidAssetId();
/// @notice Thrown when adding a new reserve if the asset decimals are invalid.
error InvalidAssetDecimals();
/// @notice Thrown when updating a reserve if it is not listed.
error ReserveNotListed();
/// @notice Thrown when a reserve is not borrowable during a `borrow` action.
error ReserveNotBorrowable();
/// @notice Thrown when a reserve is paused during an attempted action.
error ReservePaused();
/// @notice Thrown when a reserve is frozen.
/// @dev Can only occur during an attempted `supply`, `borrow`, or `setUsingAsCollateral` action.
error ReserveFrozen();
/// @notice Thrown when an action causes a user's health factor to fall below the liquidation threshold.
error HealthFactorBelowThreshold();
/// @notice Thrown when reserve is not enabled as collateral during liquidation.
error ReserveNotEnabledAsCollateral();
/// @notice Thrown when a specified reserve is not supplied by the user during liquidation.
error ReserveNotSupplied();
/// @notice Thrown when a specified reserve is not borrowed by the user during liquidation.
error ReserveNotBorrowed();
/// @notice Thrown when an unauthorized caller attempts an action.
error Unauthorized();
/// @notice Thrown if a config key is uninitialized when updating a dynamic reserve config.
error DynamicConfigKeyUninitialized();
/// @notice Thrown for an invalid zero address.
error InvalidAddress();
/// @notice Thrown when the oracle decimals are not 8 in the constructor.
error InvalidOracleDecimals();
/// @notice Thrown when the maximum user reserves limit is zero in the constructor.
error InvalidMaxUserReservesLimit();
/// @notice Thrown when a collateral risk exceeds the maximum allowed.
error InvalidCollateralRisk();
/// @notice Thrown if a liquidation config is invalid when it is updated.
error InvalidLiquidationConfig();
/// @notice Thrown when a liquidation fee is invalid.
error InvalidLiquidationFee();
/// @notice Thrown when a collateral factor and max liquidation bonus are invalid.
error InvalidCollateralFactorAndMaxLiquidationBonus();
/// @notice Thrown when trying to set zero collateralFactor on historic dynamic configuration keys.
error InvalidCollateralFactor();
/// @notice Thrown when a self-liquidation is attempted.
error SelfLiquidation();
/// @notice Thrown during liquidation when a user's health factor is not below the liquidation threshold.
error HealthFactorNotBelowThreshold();
/// @notice Thrown when collateral or debt dust remains after a liquidation, and neither reserve is fully liquidated.
error MustNotLeaveDust();
/// @notice Thrown when a debt to cover input is zero.
error InvalidDebtToCover();
/// @notice Thrown when the liquidator tries to receive shares for a collateral reserve that is frozen or is not enabled to receive shares.
error CannotReceiveShares();
/// @notice Thrown when the maximum number of dynamic config keys is reached.
error MaximumDynamicConfigKeyReached();
/// @notice Thrown when user attempts to exceed either the maximum allowed collateral or borrowed reserves.
error MaximumUserReservesExceeded();
/// @notice Updates the liquidation config.
/// @param config The new liquidation config.
function updateLiquidationConfig(LiquidationConfig calldata config) external;
/// @notice Adds a new reserve to the Spoke.
/// @dev Allowed even if the Spoke has not yet been added to the Hub.
/// @dev Allowed even if the `active` flag is `false`.
/// @dev Allowed even if the Spoke has been added but the `addCap` is zero.
/// @param hub The address of the Hub where the asset is listed.
/// @param assetId The identifier of the asset in the Hub.
/// @param priceSource The address of the price source for the asset.
/// @param config The initial reserve configuration.
/// @param dynamicConfig The initial dynamic reserve configuration.
/// @return The identifier of the newly added reserve.
function addReserve(
address hub,
uint256 assetId,
address priceSource,
ReserveConfig calldata config,
DynamicReserveConfig calldata dynamicConfig
) external returns (uint256);
/// @notice Updates the reserve config for a given reserve.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @param reserveId The identifier of the reserve.
/// @param params The new reserve config.
function updateReserveConfig(uint256 reserveId, ReserveConfig calldata params) external;
/// @notice Updates the price source of a reserve.
/// @param reserveId The identifier of the reserve.
/// @param priceSource The address of the price source.
function updateReservePriceSource(uint256 reserveId, address priceSource) external;
/// @notice Updates the dynamic reserve config for a given reserve.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @dev Appends dynamic config to the next available key; reverts if `MAX_ALLOWED_DYNAMIC_CONFIG_KEY` is reached.
/// @param reserveId The identifier of the reserve.
/// @param dynamicConfig The new dynamic reserve config.
/// @return dynamicConfigKey The key of the added dynamic config.
function addDynamicReserveConfig(
uint256 reserveId,
DynamicReserveConfig calldata dynamicConfig
) external returns (uint32 dynamicConfigKey);
/// @notice Updates the dynamic reserve config for a given reserve at the specified key.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @dev Reverts with `DynamicConfigKeyUninitialized` if the config key has not been initialized yet.
/// @dev Reverts with `InvalidCollateralFactor` if the collateral factor is 0.
/// @param reserveId The identifier of the reserve.
/// @param dynamicConfigKey The key of the config to update.
/// @param dynamicConfig The new dynamic reserve config.
function updateDynamicReserveConfig(
uint256 reserveId,
uint32 dynamicConfigKey,
DynamicReserveConfig calldata dynamicConfig
) external;
/// @notice Allows an approved caller (admin) to toggle the active status of position manager.
/// @param positionManager The address of the position manager.
/// @param active True if positionManager is to be set as active.
function updatePositionManager(address positionManager, bool active) external;
/// @notice Supplies an amount of underlying asset of the specified reserve.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @dev The Spoke pulls the underlying asset from the caller, so prior token approval is required.
/// @dev Caller must be `onBehalfOf` or an authorized position manager for `onBehalfOf`.
/// @param reserveId The reserve identifier.
/// @param amount The amount of asset to supply.
/// @param onBehalfOf The owner of the position to add supply shares to.
/// @return The amount of shares supplied.
/// @return The amount of assets supplied.
function supply(
uint256 reserveId,
uint256 amount,
address onBehalfOf
) external returns (uint256, uint256);
/// @notice Withdraws a specified amount of underlying asset from the given reserve.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @dev Providing an amount greater than the maximum withdrawable value signals a full withdrawal.
/// @dev Caller must be `onBehalfOf` or an authorized position manager for `onBehalfOf`.
/// @dev Caller receives the underlying asset withdrawn.
/// @param reserveId The identifier of the reserve.
/// @param amount The amount of asset to withdraw.
/// @param onBehalfOf The owner of position to remove supply shares from.
/// @return The amount of shares withdrawn.
/// @return The amount of assets withdrawn.
function withdraw(
uint256 reserveId,
uint256 amount,
address onBehalfOf
) external returns (uint256, uint256);
/// @notice Borrows a specified amount of underlying asset from the given reserve.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @dev It reverts if the user would borrow more than the maximum allowed number of borrowed reserves.
/// @dev Caller must be `onBehalfOf` or an authorized position manager for `onBehalfOf`.
/// @dev Caller receives the underlying asset borrowed.
/// @param reserveId The identifier of the reserve.
/// @param amount The amount of asset to borrow.
/// @param onBehalfOf The owner of the position against which debt is generated.
/// @return The amount of shares borrowed.
/// @return The amount of assets borrowed.
function borrow(
uint256 reserveId,
uint256 amount,
address onBehalfOf
) external returns (uint256, uint256);
/// @notice Repays a specified amount of underlying asset to a given reserve.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @dev The Spoke pulls the underlying asset from the caller, so prior approval is required.
/// @dev Caller must be `onBehalfOf` or an authorized position manager for `onBehalfOf`.
/// @param reserveId The identifier of the reserve.
/// @param amount The amount of asset to repay.
/// @param onBehalfOf The owner of the position whose debt is repaid.
/// @return The amount of shares repaid.
/// @return The amount of assets repaid.
function repay(
uint256 reserveId,
uint256 amount,
address onBehalfOf
) external returns (uint256, uint256);
/// @notice Liquidates a user position.
/// @dev It reverts if the reserves associated with any of the given reserve identifiers are not listed.
/// @dev The Spoke pulls underlying repaid debt assets from caller (Liquidator), hence it needs prior approval.
/// @param collateralReserveId The reserveId of the underlying asset used as collateral by the liquidated user.
/// @param debtReserveId The reserveId of the underlying asset borrowed by the liquidated user, to be repaid by Liquidator.
/// @param user The address of the user to liquidate.
/// @param debtToCover The desired amount of debt to cover.
/// @param receiveShares True to receive collateral in supplied shares, false to receive in underlying assets.
function liquidationCall(
uint256 collateralReserveId,
uint256 debtReserveId,
address user,
uint256 debtToCover,
bool receiveShares
) external;
/// @notice Allows suppliers to enable/disable a specific supplied reserve as collateral.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @dev It reverts if the user exceeds the maximum allowed collateral reserves when enabling.
/// @dev Reserves with zero supplied or zero collateral factor count towards the max allowed collateral reserves.
/// @dev Caller must be `onBehalfOf` or an authorized position manager for `onBehalfOf`.
/// @param reserveId The reserve identifier of the underlying asset.
/// @param usingAsCollateral True if the user wants to use the supply as collateral.
/// @param onBehalfOf The owner of the position being modified.
function setUsingAsCollateral(
uint256 reserveId,
bool usingAsCollateral,
address onBehalfOf
) external;
/// @notice Allows updating the risk premium on onBehalfOf position.
/// @dev Caller must be `onBehalfOf`, an authorized position manager for `onBehalfOf`, or admin.
/// @param onBehalfOf The owner of the position being modified.
function updateUserRiskPremium(address onBehalfOf) external;
/// @notice Allows updating the dynamic configuration for all collateral reserves on onBehalfOf position.
/// @dev Caller must be `onBehalfOf`, an authorized position manager for `onBehalfOf`, or admin.
/// @param onBehalfOf The owner of the position being modified.
function updateUserDynamicConfig(address onBehalfOf) external;
/// @notice Enables a user to grant or revoke approval for a position manager.
/// @dev Allows approving inactive position managers.
/// @param positionManager The address of the position manager.
/// @param approve True to approve the position manager, false to revoke approval.
function setUserPositionManager(address positionManager, bool approve) external;
/// @notice Enables a user to grant or revoke approval for an array of position managers using an EIP712-typed intent.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @dev Allows duplicated updates and the last one is persisted. Allows approving inactive position managers.
/// @param params The structured setUserPositionManagers parameter.
/// @param signature The EIP712-compliant signature bytes.
function setUserPositionManagersWithSig(
SetUserPositionManagers calldata params,
bytes calldata signature
) external;
/// @notice Allows position manager (as caller) to renounce their approval given by the user.
/// @param user The address of the user.
function renouncePositionManagerRole(address user) external;
/// @notice Allows consuming a permit signature for the given reserve's underlying asset.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @dev The Spoke must be configured as the spender.
/// @param reserveId The identifier of the reserve.
/// @param onBehalfOf The address of the user on whose behalf the permit is being used.
/// @param value The amount of the underlying asset to permit.
/// @param deadline The deadline for the permit.
/// @param permitV The v parameter of the permit signature.
/// @param permitR The r parameter of the permit signature.
/// @param permitS The s parameter of the permit signature.
function permitReserve(
uint256 reserveId,
address onBehalfOf,
uint256 value,
uint256 deadline,
uint8 permitV,
bytes32 permitR,
bytes32 permitS
) external;
/// @notice Returns the liquidation config struct.
function getLiquidationConfig() external view returns (LiquidationConfig memory);
/// @notice Returns the number of listed reserves on the Spoke.
/// @dev Count includes reserves that are not currently active.
function getReserveCount() external view returns (uint256);
/// @notice Returns the total amount of supplied assets of a given reserve.
/// @param reserveId The identifier of the reserve.
/// @return The amount of supplied assets.
function getReserveSuppliedAssets(uint256 reserveId) external view returns (uint256);
/// @notice Returns the total amount of supplied shares of a given reserve.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @param reserveId The identifier of the reserve.
/// @return The amount of supplied shares.
function getReserveSuppliedShares(uint256 reserveId) external view returns (uint256);
/// @notice Returns the debt of a given reserve.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @dev The total debt of the reserve is the sum of drawn debt and premium debt.
/// @param reserveId The identifier of the reserve.
/// @return The amount of drawn debt.
/// @return The amount of premium debt.
function getReserveDebt(uint256 reserveId) external view returns (uint256, uint256);
/// @notice Returns the total debt of a given reserve.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @dev The total debt of the reserve is the sum of drawn debt and premium debt.
/// @param reserveId The identifier of the reserve.
/// @return The total debt amount.
function getReserveTotalDebt(uint256 reserveId) external view returns (uint256);
/// @notice Returns the reserve identifier for a given asset in a Hub.
/// @dev It reverts if no reserve is associated with the given asset identifier.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset on the Hub.
/// @return The identifier of the reserve.
function getReserveId(address hub, uint256 assetId) external view returns (uint256);
/// @notice Returns the reserve struct data in storage.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @param reserveId The identifier of the reserve.
/// @return The reserve struct.
function getReserve(uint256 reserveId) external view returns (Reserve memory);
/// @notice Returns the reserve configuration struct data in storage.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @param reserveId The identifier of the reserve.
/// @return The reserve configuration struct.
function getReserveConfig(uint256 reserveId) external view returns (ReserveConfig memory);
/// @notice Returns the dynamic reserve configuration struct at the specified key.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @dev Does not revert if `dynamicConfigKey` is unset.
/// @param reserveId The identifier of the reserve.
/// @param dynamicConfigKey The key of the dynamic config.
/// @return The dynamic reserve configuration struct.
function getDynamicReserveConfig(
uint256 reserveId,
uint32 dynamicConfigKey
) external view returns (DynamicReserveConfig memory);
/// @notice Returns two flags indicating whether the reserve is used as collateral and whether it is borrowed by the user.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @dev Even if enabled as collateral, it will only count towards user position if the collateral factor is greater than 0.
/// @param reserveId The identifier of the reserve.
/// @param user The address of the user.
/// @return True if the reserve is enabled as collateral by the user.
/// @return True if the reserve is borrowed by the user.
function getUserReserveStatus(uint256 reserveId, address user) external view returns (bool, bool);
/// @notice Returns the amount of assets supplied by a specific user for a given reserve.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @param reserveId The identifier of the reserve.
/// @param user The address of the user.
/// @return The amount of assets supplied by the user.
function getUserSuppliedAssets(uint256 reserveId, address user) external view returns (uint256);
/// @notice Returns the amount of shares supplied by a specific user for a given reserve.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @param reserveId The identifier of the reserve.
/// @param user The address of the user.
/// @return The amount of shares supplied by the user.
function getUserSuppliedShares(uint256 reserveId, address user) external view returns (uint256);
/// @notice Returns the debt of a specific user for a given reserve.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @dev The total debt of the user is the sum of drawn debt and premium debt.
/// @param reserveId The identifier of the reserve.
/// @param user The address of the user.
/// @return The amount of drawn debt.
/// @return The amount of premium debt.
function getUserDebt(uint256 reserveId, address user) external view returns (uint256, uint256);
/// @notice Returns the total debt of a specific user for a given reserve.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @dev The total debt of the user is the sum of drawn debt and premium debt.
/// @param reserveId The identifier of the reserve.
/// @param user The address of the user.
/// @return The total debt amount.
function getUserTotalDebt(uint256 reserveId, address user) external view returns (uint256);
/// @notice Returns the full precision premium debt of a specific user for a given reserve.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @param reserveId The identifier of the reserve.
/// @param user The address of the user.
/// @return The amount of premium debt, expressed in asset units and scaled by RAY.
function getUserPremiumDebtRay(uint256 reserveId, address user) external view returns (uint256);
/// @notice Returns the user position struct in storage.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @param reserveId The identifier of the reserve.
/// @param user The address of the user.
/// @return The user position struct.
function getUserPosition(
uint256 reserveId,
address user
) external view returns (UserPosition memory);
/// @notice Returns the most up-to-date user account data information.
/// @dev Utilizes user's current dynamic configuration of user position.
/// @param user The address of the user.
/// @return The user account data struct.
function getUserAccountData(address user) external view returns (UserAccountData memory);
/// @notice Returns the risk premium from the user's last position update.
/// @param user The address of the user.
/// @return The risk premium of the user from the last position update, expressed in BPS.
function getUserLastRiskPremium(address user) external view returns (uint256);
/// @notice Returns the liquidation bonus for a given health factor, based on the user's current dynamic configuration.
/// @dev It reverts if the reserve associated with the given reserve identifier is not listed.
/// @param reserveId The identifier of the reserve.
/// @param user The address of the user.
/// @param healthFactor The health factor of the user, expressed in WAD.
/// @return The liquidation bonus for the user, expressed in BPS.
function getLiquidationBonus(
uint256 reserveId,
address user,
uint256 healthFactor
) external view returns (uint256);
/// @notice Returns whether positionManager is currently activated by governance.
/// @param positionManager The address of the position manager.
/// @return True if positionManager is currently active.
function isPositionManagerActive(address positionManager) external view returns (bool);
/// @notice Returns whether positionManager is active and approved by user.
/// @param user The address of the user.
/// @param positionManager The address of the position manager.
/// @return True if positionManager is active and approved by user.
function isPositionManager(address user, address positionManager) external view returns (bool);
/// @notice Returns the address of the external `LiquidationLogic` library.
function getLiquidationLogic() external pure returns (address);
/// @notice Returns the type hash for the SetUserPositionManagers intent.
/// @return The bytes-encoded EIP-712 struct hash representing the intent.
function SET_USER_POSITION_MANAGERS_TYPEHASH() external view returns (bytes32);
/// @notice Returns the address of the AaveOracle contract.
function ORACLE() external view returns (address);
/// @notice Returns the maximum allowed number of collateral and borrow reserves per user (each counted separately).
function MAX_USER_RESERVES_LIMIT() external view returns (uint16);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/spoke/interfaces/ISpokeConfigurator.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {ISpoke} from 'src/spoke/interfaces/ISpoke.sol';
/// @title ISpokeConfigurator
/// @author Aave Labs
/// @notice Interface for the SpokeConfigurator.
interface ISpokeConfigurator {
/// @notice Thrown when an address parameter is the zero address.
error InvalidAddress();
/// @notice Updates the price source of a reserve.
/// @dev The price source must implement IPriceFeed.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param priceSource The new price source.
function updateReservePriceSource(address spoke, uint256 reserveId, address priceSource) external;
/// @notice Updates the liquidation target health factor of a spoke.
/// @param spoke The address of the Spoke.
/// @param targetHealthFactor The new liquidation target health factor.
function updateLiquidationTargetHealthFactor(address spoke, uint256 targetHealthFactor) external;
/// @notice Updates the health factor for max liquidation bonus of a spoke.
/// @param spoke The address of the Spoke.
/// @param healthFactorForMaxBonus The new health factor for max liquidation bonus.
function updateHealthFactorForMaxBonus(address spoke, uint256 healthFactorForMaxBonus) external;
/// @notice Updates the liquidation bonus factor of a spoke.
/// @param spoke The address of the Spoke.
/// @param liquidationBonusFactor The new liquidation bonus factor.
function updateLiquidationBonusFactor(address spoke, uint256 liquidationBonusFactor) external;
/// @notice Updates the liquidation config of a spoke.
/// @param spoke The address of the Spoke.
/// @param liquidationConfig The new liquidation config.
function updateLiquidationConfig(
address spoke,
ISpoke.LiquidationConfig calldata liquidationConfig
) external;
/// @notice Adds a new reserve to a spoke.
/// @dev The asset corresponding to the reserve must be already listed on the Hub.
/// @dev The price source must implement IPriceFeed.
/// @param spoke The address of the Spoke.
/// @param hub The address of the Hub where the asset corresponding to the reserve is listed.
/// @param assetId The identifier of the asset.
/// @param priceSource The address of the price source.
/// @param config The configuration of the reserve.
/// @param dynamicConfig The dynamic configuration of the reserve.
/// @return reserveId The identifier of the reserve.
function addReserve(
address spoke,
address hub,
uint256 assetId,
address priceSource,
ISpoke.ReserveConfig calldata config,
ISpoke.DynamicReserveConfig calldata dynamicConfig
) external returns (uint256);
/// @notice Updates the paused flag of a reserve.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param paused The new paused flag.
function updatePaused(address spoke, uint256 reserveId, bool paused) external;
/// @notice Updates the frozen flag of a reserve.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param frozen The new frozen flag.
function updateFrozen(address spoke, uint256 reserveId, bool frozen) external;
/// @notice Updates the borrowable flag of a reserve.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param borrowable The new borrowable flag.
function updateBorrowable(address spoke, uint256 reserveId, bool borrowable) external;
/// @notice Updates whether receiving shares on liquidation is enabled.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param receiveSharesEnabled The new receiveSharesEnabled flag.
function updateReceiveSharesEnabled(
address spoke,
uint256 reserveId,
bool receiveSharesEnabled
) external;
/// @notice Updates the collateral risk of a reserve.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param collateralRisk The new collateral risk.
function updateCollateralRisk(address spoke, uint256 reserveId, uint256 collateralRisk) external;
/// @notice Adds a dynamic config to a reserve, identical to the latest one but with the specified collateral factor.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param collateralFactor The new collateral factor.
/// @return The dynamicConfigKey of the added dynamic configuration.
function addCollateralFactor(
address spoke,
uint256 reserveId,
uint16 collateralFactor
) external returns (uint32);
/// @notice Updates an existing collateral factor of a reserve at the specified key.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param dynamicConfigKey The key of the dynamic config to update.
/// @param collateralFactor The new collateral factor.
function updateCollateralFactor(
address spoke,
uint256 reserveId,
uint32 dynamicConfigKey,
uint16 collateralFactor
) external;
/// @notice Adds a dynamic config to a reserve, identical to the latest one but with the specified max liquidation bonus.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param maxLiquidationBonus The new max liquidation bonus.
/// @return The dynamicConfigKey of the added dynamic configuration.
function addMaxLiquidationBonus(
address spoke,
uint256 reserveId,
uint256 maxLiquidationBonus
) external returns (uint32);
/// @notice Updates an existing liquidation bonus of a reserve at the specified key.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param dynamicConfigKey The key of the dynamic config to update.
/// @param maxLiquidationBonus The new liquidation bonus.
function updateMaxLiquidationBonus(
address spoke,
uint256 reserveId,
uint32 dynamicConfigKey,
uint256 maxLiquidationBonus
) external;
/// @notice Adds a dynamic config to a reserve, identical to the latest one but with the specified liquidation fee.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param liquidationFee The new liquidation fee.
/// @return The dynamicConfigKey of the added dynamic configuration.
function addLiquidationFee(
address spoke,
uint256 reserveId,
uint256 liquidationFee
) external returns (uint32);
/// @notice Updates an existing liquidation fee of a reserve at the specified key.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param dynamicConfigKey The key of the dynamic config to update.
/// @param liquidationFee The new liquidation fee.
function updateLiquidationFee(
address spoke,
uint256 reserveId,
uint32 dynamicConfigKey,
uint256 liquidationFee
) external;
/// @notice Adds a dynamic config to a reserve.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param dynamicConfig The new dynamic config.
/// @return dynamicConfigKey The key of the added dynamic config.
function addDynamicReserveConfig(
address spoke,
uint256 reserveId,
ISpoke.DynamicReserveConfig calldata dynamicConfig
) external returns (uint32);
/// @notice Updates the dynamic config of a reserve at the specified key.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
/// @param dynamicConfigKey The key of the dynamic config to update.
/// @param dynamicConfig The new dynamic config.
function updateDynamicReserveConfig(
address spoke,
uint256 reserveId,
uint32 dynamicConfigKey,
ISpoke.DynamicReserveConfig calldata dynamicConfig
) external;
/// @notice Pauses all reserves of a spoke.
/// @param spoke The address of the Spoke.
function pauseAllReserves(address spoke) external;
/// @notice Freezes all reserves of a spoke.
/// @param spoke The address of the Spoke.
function freezeAllReserves(address spoke) external;
/// @notice Pauses a reserve of a spoke.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
function pauseReserve(address spoke, uint256 reserveId) external;
/// @notice Freezes a reserve of a spoke.
/// @param spoke The address of the Spoke.
/// @param reserveId The identifier of the reserve.
function freezeReserve(address spoke, uint256 reserveId) external;
/// @notice Updates the active flag of a spoke's position manager.
/// @param spoke The address of the Spoke.
/// @param positionManager The address of the position manager.
/// @param active The new active flag.
function updatePositionManager(address spoke, address positionManager, bool active) external;
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/spoke/interfaces/ITokenizationSpoke.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
import {IERC2612, IERC20Permit} from 'src/dependencies/openzeppelin/IERC2612.sol';
import {IERC4626} from 'src/dependencies/openzeppelin/IERC4626.sol';
import {IIntentConsumer} from 'src/interfaces/IIntentConsumer.sol';
/// @title ITokenizationSpoke
/// @author Aave Labs
interface ITokenizationSpoke is IERC4626, IERC2612, IIntentConsumer {
/// @notice Intent data to deposit assets into the TokenizationSpoke.
/// @param depositor The address of the user depositing assets.
/// @param assets The amount of assets to deposit.
/// @param receiver The address that will receive the minted shares.
/// @param nonce The key-prefixed nonce for the signature.
/// @param deadline The deadline for the intent.
struct TokenizedDeposit {
address depositor;
uint256 assets;
address receiver;
uint256 nonce;
uint256 deadline;
}
/// @notice Intent data to mint shares from the TokenizationSpoke.
/// @param depositor The address of the user depositing assets.
/// @param shares The amount of shares to mint.
/// @param receiver The address that will receive the minted shares.
/// @param nonce The key-prefixed nonce for the signature.
/// @param deadline The deadline for the intent.
struct TokenizedMint {
address depositor;
uint256 shares;
address receiver;
uint256 nonce;
uint256 deadline;
}
/// @notice Intent data to withdraw assets from the TokenizationSpoke.
/// @param owner The address of the user withdrawing assets.
/// @param assets The amount of assets to withdraw.
/// @param receiver The address that will receive the withdrawn assets.
/// @param nonce The key-prefixed nonce for the signature.
/// @param deadline The deadline for the intent.
struct TokenizedWithdraw {
address owner;
uint256 assets;
address receiver;
uint256 nonce;
uint256 deadline;
}
/// @notice Intent data to redeem shares from the TokenizationSpoke.
/// @param owner The address of the user redeeming shares.
/// @param shares The amount of shares to redeem.
/// @param receiver The address that will receive the redeemed assets.
/// @param nonce The key-prefixed nonce for the signature.
/// @param deadline The deadline for the intent.
struct TokenizedRedeem {
address owner;
uint256 shares;
address receiver;
uint256 nonce;
uint256 deadline;
}
/// @notice Emitted when the immutable variables of the TokenizationSpoke are set.
/// @param hub The address of the Hub.
/// @param assetId The identifier of the asset.
event SetTokenizationSpokeImmutables(address indexed hub, uint256 indexed assetId);
/// @notice Deposits assets into the TokenizationSpoke with a signature.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @param params The parameters for the deposit.
/// @param signature The EIP712-typed signed bytes for the deposit.
/// @return The amount of shares minted.
function depositWithSig(
TokenizedDeposit calldata params,
bytes calldata signature
) external returns (uint256);
/// @notice Mints shares of the TokenizationSpoke with a signature.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @param params The parameters for the mint.
/// @param signature The EIP712-typed signed bytes for the mint.
/// @return The amount of assets deposited.
function mintWithSig(
TokenizedMint calldata params,
bytes calldata signature
) external returns (uint256);
/// @notice Withdraws assets from the TokenizationSpoke with a signature.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @param params The parameters for the withdraw.
/// @param signature The EIP712-typed signed bytes for the withdraw.
/// @return The amount of shares burnt.
function withdrawWithSig(
TokenizedWithdraw calldata params,
bytes calldata signature
) external returns (uint256);
/// @notice Redeems shares from the TokenizationSpoke with a signature.
/// @dev Uses keyed-nonces where for each key's namespace nonce is consumed sequentially.
/// @param params The parameters for the redeem.
/// @param signature The EIP712-typed signed bytes for the redeem.
/// @return The amount of assets burnt.
function redeemWithSig(
TokenizedRedeem calldata params,
bytes calldata signature
) external returns (uint256);
/// @notice Deposits assets into the vault with an underlying asset ERC2612-typed permit.
/// @param assets The amount of assets to deposit.
/// @param receiver The receiver of the shares.
/// @param deadline The deadline of the permit.
/// @param v The v value of the permit.
/// @param r The r value of the permit.
/// @param s The s value of the permit.
/// @return The amount of shares minted.
function depositWithPermit(
uint256 assets,
address receiver,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256);
/// @notice Sets approval for `spender` to spend `owner`'s share tokens via EIP712-typed signature.
/// @dev Uses keyed-nonces where the share token permit nonce is consumed sequentially and key namespace is always set to `PERMIT_NONCE_NAMESPACE`.
/// @dev Implements EIP-2612 permit functionality for the vault share token.
/// @param owner The address of the token owner granting approval.
/// @param spender The address being granted approval to spend tokens.
/// @param value The amount of tokens approved for spending.
/// @param deadline The timestamp by which the permit must be used.
/// @param v The recovery byte of the signature.
/// @param r The first 32 bytes of the signature.
/// @param s The second 32 bytes of the signature.
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/// @notice Revokes the current PERMIT_NAMESPACE_NONCE of caller & increments the nonce at this key.
/// @return The consumed keyed-nonce.
function usePermitNonce() external returns (uint256);
/// @notice Resets the allowance of an owner for the caller.
/// @param owner The owner of the allowance to renounce.
function renounceAllowance(address owner) external;
/// @notice Returns the address of the associated Hub.
function hub() external view returns (address);
/// @notice Returns the identifier of the associated asset.
function assetId() external view returns (uint256);
/// @notice Returns the maximum allowed spoke cap.
function MAX_ALLOWED_SPOKE_CAP() external view returns (uint40);
/// @notice Returns the nonce namespace for share token EIP-2612 permit signatures.
/// @dev Share token permits strictly use this dedicated namespace in the keyed-nonce system as the nonce key.
/// @dev Other vault intent operations can also use the this namespace as the nonce key.
function PERMIT_NONCE_NAMESPACE() external pure returns (uint192);
/// @notice Returns the type hash for the deposit intent.
function DEPOSIT_TYPEHASH() external pure returns (bytes32);
/// @notice Returns the type hash for the mint intent.
function MINT_TYPEHASH() external pure returns (bytes32);
/// @notice Returns the type hash for the withdraw intent.
function WITHDRAW_TYPEHASH() external pure returns (bytes32);
/// @notice Returns the type hash for the redeem intent.
function REDEEM_TYPEHASH() external pure returns (bytes32);
/// @notice Returns the type hash for the share token permit intent.
function PERMIT_TYPEHASH() external pure returns (bytes32);
/// @notice Returns the EIP-712 domain separator.
function DOMAIN_SEPARATOR()
external
view
override(IERC20Permit, IIntentConsumer)
returns (bytes32);
}
lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/spoke/interfaces/ITreasurySpoke.sol
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;
/// @title ITreasurySpoke
/// @author Aave Labs
/// @notice Interface for the TreasurySpoke.
interface ITreasurySpoke {
/// @notice Supplies a specified amount of the underlying asset to the specified Hub.
/// @dev The Spoke pulls the underlying asset from the caller, so prior approval is required.
/// @param hub The address of the Hub.
/// @param underlying The address of the underlying asset.
/// @param amount The amount of asset to supply.
/// @return The amount of shares supplied.
/// @return The amount of assets supplied.
function supply(
address hub,
address underlying,
uint256 amount
) external returns (uint256, uint256);
/// @notice Supplies a specified amount of the underlying asset to the specified Hub.
/// @dev The underlying asset must already be transferred to the Hub before calling.
/// @param hub The address of the Hub.
/// @param underlying The address of the underlying asset.
/// @param amount The amount of asset to supply.
/// @return The amount of shares supplied.
/// @return The amount of assets supplied.
function supplySkimmed(
address hub,
address underlying,
uint256 amount
) external returns (uint256, uint256);
/// @notice Withdraws a specified amount of underlying asset from the specified Hub.
/// @dev Providing an amount greater than the maximum withdrawable value signals a full withdrawal.
/// @param hub The address of the Hub.
/// @param underlying The address of the underlying asset.
/// @param amount The amount of asset to withdraw.
/// @return The amount of shares withdrawn.
/// @return The amount of assets withdrawn.
function withdraw(
address hub,
address underlying,
uint256 amount
) external returns (uint256, uint256);
/// @notice Transfers a specified amount of ERC20 tokens from this contract.
/// @param token The address of the ERC20 token to transfer.
/// @param to The recipient address.
/// @param amount The amount of tokens to transfer.
function transfer(address token, address to, uint256 amount) external;
/// @notice Returns the amount of assets supplied by this spoke.
/// @param hub The address of the Hub.
/// @param underlying The address of the underlying asset.
/// @return The amount of assets supplied.
function getSuppliedAssets(address hub, address underlying) external view returns (uint256);
/// @notice Returns the amount of shares supplied by this spoke.
/// @dev Shares are denominated relative to the supply side.
/// @param hub The address of the Hub.
/// @param underlying The address of the underlying asset.
/// @return The amount of shares supplied.
function getSuppliedShares(address hub, address underlying) external view returns (uint256);
}
lib/aave-helpers/lib/aave-address-book/src/AaveV4.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;
import {IHub} from 'aave-v4/hub/interfaces/IHub.sol';
import {IHubConfigurator} from 'aave-v4/hub/interfaces/IHubConfigurator.sol';
import {ISpoke} from 'aave-v4/spoke/interfaces/ISpoke.sol';
import {ISpokeConfigurator} from 'aave-v4/spoke/interfaces/ISpokeConfigurator.sol';
import {ITokenizationSpoke} from 'aave-v4/spoke/interfaces/ITokenizationSpoke.sol';
import {ITreasurySpoke} from 'aave-v4/spoke/interfaces/ITreasurySpoke.sol';
import {IAaveOracle} from 'aave-v4/spoke/interfaces/IAaveOracle.sol';
import {IConfigPositionManager} from 'aave-v4/position-manager/interfaces/IConfigPositionManager.sol';
import {IGiverPositionManager} from 'aave-v4/position-manager/interfaces/IGiverPositionManager.sol';
import {ITakerPositionManager} from 'aave-v4/position-manager/interfaces/ITakerPositionManager.sol';
import {INativeTokenGateway} from 'aave-v4/position-manager/interfaces/INativeTokenGateway.sol';
import {ISignatureGateway} from 'aave-v4/position-manager/interfaces/ISignatureGateway.sol';
import {IAaveV4ConfigEngine} from 'aave-v4/config-engine/interfaces/IAaveV4ConfigEngine.sol';
import {IAccessManagerEnumerable} from 'aave-v4/access/interfaces/IAccessManagerEnumerable.sol';
import {IBasicInterestRateStrategy} from 'aave-v4/hub/interfaces/IBasicInterestRateStrategy.sol';
struct PositionManagers {
IGiverPositionManager giver;
ITakerPositionManager taker;
IConfigPositionManager config;
INativeTokenGateway nativeGateway;
ISignatureGateway signatureGateway;
}
lib/aave-helpers/lib/aave-address-book/src/AaveV4Ethereum.sol
// AUTOGENERATED - MANUAL CHANGES WILL BE REVERTED BY THE GENERATOR
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;
import {IHub, IHubConfigurator, ISpoke, ISpokeConfigurator, ITokenizationSpoke, ITreasurySpoke, IAaveOracle, IConfigPositionManager, IGiverPositionManager, ITakerPositionManager, INativeTokenGateway, ISignatureGateway, IAaveV4ConfigEngine, IAccessManagerEnumerable, IBasicInterestRateStrategy, PositionManagers} from './AaveV4.sol';
library AaveV4Ethereum {
// https://etherscan.io/address/0x08aE3BE30958cDd1847ec58fFfd4C451a87fDF01
IAccessManagerEnumerable internal constant ACCESS_MANAGER =
IAccessManagerEnumerable(0x08aE3BE30958cDd1847ec58fFfd4C451a87fDF01);
// https://etherscan.io/address/0x1F0753480bB03EaA00863224602267B7E0525C3d
IHubConfigurator internal constant HUB_CONFIGURATOR =
IHubConfigurator(0x1F0753480bB03EaA00863224602267B7E0525C3d);
// https://etherscan.io/address/0x9BFFf48BFb5A7AE70c348d4d4cb97E8DEFa5389a
ISpokeConfigurator internal constant SPOKE_CONFIGURATOR =
ISpokeConfigurator(0x9BFFf48BFb5A7AE70c348d4d4cb97E8DEFa5389a);
// https://etherscan.io/address/0xB9B0b8616f6Bf6841972a52058132BE08d723155
ITreasurySpoke internal constant TREASURY_SPOKE =
ITreasurySpoke(0xB9B0b8616f6Bf6841972a52058132BE08d723155);
// https://etherscan.io/address/0xa1673fbD457747A05e91D9ef904Cb12827916B1E
IAaveV4ConfigEngine internal constant CONFIG_ENGINE =
IAaveV4ConfigEngine(0xa1673fbD457747A05e91D9ef904Cb12827916B1E);
// https://etherscan.io/address/0x6f48d9Cdb8EE6E17c96B2d8Aec128af426A295c1
address internal constant RISK_STEWARD = 0x6f48d9Cdb8EE6E17c96B2d8Aec128af426A295c1;
// https://etherscan.io/address/0x47c71dFEB55Ebaa431Ae3fbF99Ea50e0D3d30fA8
address internal constant RISK_COUNCIL = 0x47c71dFEB55Ebaa431Ae3fbF99Ea50e0D3d30fA8;
}
library AaveV4EthereumHubs {
// https://etherscan.io/address/0xCca852Bc40e560adC3b1Cc58CA5b55638ce826c9
IHub internal constant CORE_HUB = IHub(0xCca852Bc40e560adC3b1Cc58CA5b55638ce826c9);
// https://etherscan.io/address/0x06002e9c4412CB7814a791eA3666D905871E536A
IHub internal constant PLUS_HUB = IHub(0x06002e9c4412CB7814a791eA3666D905871E536A);
// https://etherscan.io/address/0x943827DCA022D0F354a8a8c332dA1e5Eb9f9F931
IHub internal constant PRIME_HUB = IHub(0x943827DCA022D0F354a8a8c332dA1e5Eb9f9F931);
// https://etherscan.io/address/0x62d63197660c080236193CA60b70E49A08E90368
IHub internal constant GLOBAL_DOLLAR_HUB = IHub(0x62d63197660c080236193CA60b70E49A08E90368);
}
library AaveV4EthereumSpokes {
// https://etherscan.io/address/0xB9B0b8616f6Bf6841972a52058132BE08d723155
ITreasurySpoke internal constant TREASURY_SPOKE =
ITreasurySpoke(0xB9B0b8616f6Bf6841972a52058132BE08d723155);
// https://etherscan.io/address/0x973a023A77420ba610f06b3858aD991Df6d85A08
ISpoke internal constant BLUECHIP_SPOKE = ISpoke(0x973a023A77420ba610f06b3858aD991Df6d85A08);
// https://etherscan.io/address/0xdA1266a7b8620819dAE3F8bd6B546Da36e505bB8
IAaveOracle internal constant BLUECHIP_SPOKE_ORACLE =
IAaveOracle(0xdA1266a7b8620819dAE3F8bd6B546Da36e505bB8);
// https://etherscan.io/address/0x58131E79531caB1d52301228d1f7b842F26B9649
ISpoke internal constant ETHENA_CORRELATED_SPOKE =
ISpoke(0x58131E79531caB1d52301228d1f7b842F26B9649);
// https://etherscan.io/address/0x9b91a0943CADf554742E8Fb358B1cC4ae4F85F01
IAaveOracle internal constant ETHENA_CORRELATED_SPOKE_ORACLE =
IAaveOracle(0x9b91a0943CADf554742E8Fb358B1cC4ae4F85F01);
// https://etherscan.io/address/0xba1B3D55D249692b669A164024A838309B7508AF
ISpoke internal constant ETHENA_ECOSYSTEM_SPOKE =
ISpoke(0xba1B3D55D249692b669A164024A838309B7508AF);
// https://etherscan.io/address/0xc390dbe9fc00D6db73C52d375642b47008C33c90
IAaveOracle internal constant ETHENA_ECOSYSTEM_SPOKE_ORACLE =
IAaveOracle(0xc390dbe9fc00D6db73C52d375642b47008C33c90);
// https://etherscan.io/address/0xD8B93635b8C6d0fF98CbE90b5988E3F2d1Cd9da1
ISpoke internal constant FOREX_SPOKE = ISpoke(0xD8B93635b8C6d0fF98CbE90b5988E3F2d1Cd9da1);
// https://etherscan.io/address/0xB3CE6E7b6d389a66eA4a3777bA07219d00FB3a9D
IAaveOracle internal constant FOREX_SPOKE_ORACLE =
IAaveOracle(0xB3CE6E7b6d389a66eA4a3777bA07219d00FB3a9D);
// https://etherscan.io/address/0x65407b940966954b23dfA3caA5C0702bB42984DC
ISpoke internal constant GOLD_SPOKE = ISpoke(0x65407b940966954b23dfA3caA5C0702bB42984DC);
// https://etherscan.io/address/0x0083421fd178749af2201ddA5A7C3feB5790B80c
IAaveOracle internal constant GOLD_SPOKE_ORACLE =
IAaveOracle(0x0083421fd178749af2201ddA5A7C3feB5790B80c);
// https://etherscan.io/address/0x7EC68b5695e803e98a21a9A05d744F28b0a7753D
ISpoke internal constant LOMBARD_BTC_SPOKE = ISpoke(0x7EC68b5695e803e98a21a9A05d744F28b0a7753D);
// https://etherscan.io/address/0x198Cac7f54FFc7d709Ac0FEc4B6454CE73e21D3D
IAaveOracle internal constant LOMBARD_BTC_SPOKE_ORACLE =
IAaveOracle(0x198Cac7f54FFc7d709Ac0FEc4B6454CE73e21D3D);
// https://etherscan.io/address/0x94e7A5dCbE816e498b89aB752661904E2F56c485
ISpoke internal constant MAIN_SPOKE = ISpoke(0x94e7A5dCbE816e498b89aB752661904E2F56c485);
// https://etherscan.io/address/0x99B2B6CEa9C3D2fd8F4d90f86741C44B212a6127
IAaveOracle internal constant MAIN_SPOKE_ORACLE =
IAaveOracle(0x99B2B6CEa9C3D2fd8F4d90f86741C44B212a6127);
// https://etherscan.io/address/0xAD75cE6354f87F3135cE10621d385d8D1e2562C2
ISpoke internal constant PAXG_GOLD_SPOKE = ISpoke(0xAD75cE6354f87F3135cE10621d385d8D1e2562C2);
// https://etherscan.io/address/0x8CEcC12b23ED45EC2A9b9EB57EA6974c0cae850B
IAaveOracle internal constant PAXG_GOLD_SPOKE_ORACLE =
IAaveOracle(0x8CEcC12b23ED45EC2A9b9EB57EA6974c0cae850B);
// https://etherscan.io/address/0x956d8e0A89cfa3744428C4641b5a53B56167a7f9
ISpoke internal constant USDG_PENDLE_SPOKE = ISpoke(0x956d8e0A89cfa3744428C4641b5a53B56167a7f9);
// https://etherscan.io/address/0x692cD2F7653680aFf316Ac309ce825FCF573B7Ee
IAaveOracle internal constant USDG_PENDLE_SPOKE_ORACLE =
IAaveOracle(0x692cD2F7653680aFf316Ac309ce825FCF573B7Ee);
// https://etherscan.io/address/0xbF10BDfE177dE0336aFD7fcCF80A904E15386219
ISpoke internal constant ETHERFI_ESPOKE = ISpoke(0xbF10BDfE177dE0336aFD7fcCF80A904E15386219);
// https://etherscan.io/address/0xd8B153FaAA8f2b1bC774916FEd333A4F3dE48792
IAaveOracle internal constant ETHERFI_ESPOKE_ORACLE =
IAaveOracle(0xd8B153FaAA8f2b1bC774916FEd333A4F3dE48792);
// https://etherscan.io/address/0x3131FE68C4722e726fe6B2819ED68e514395B9a4
ISpoke internal constant KELP_ESPOKE = ISpoke(0x3131FE68C4722e726fe6B2819ED68e514395B9a4);
// https://etherscan.io/address/0x37C316996C714Bf906743071e04E62220b3271ac
IAaveOracle internal constant KELP_ESPOKE_ORACLE =
IAaveOracle(0x37C316996C714Bf906743071e04E62220b3271ac);
// https://etherscan.io/address/0xe1900480ac69f0B296841Cd01cC37546d92F35Cd
ISpoke internal constant LIDO_ESPOKE = ISpoke(0xe1900480ac69f0B296841Cd01cC37546d92F35Cd);
// https://etherscan.io/address/0x664D73b6C3591333Fd79510f7ce9ef81228824F5
IAaveOracle internal constant LIDO_ESPOKE_ORACLE =
IAaveOracle(0x664D73b6C3591333Fd79510f7ce9ef81228824F5);
// https://etherscan.io/address/0x774b9655413c34809c1f1b16b654465A89EBE989
ISpoke internal constant USDG_MAPLE_ESPOKE = ISpoke(0x774b9655413c34809c1f1b16b654465A89EBE989);
// https://etherscan.io/address/0x47a7cC7Fd47aCed15087a8b6e0ACFddCD63C811A
IAaveOracle internal constant USDG_MAPLE_ESPOKE_ORACLE =
IAaveOracle(0x47a7cC7Fd47aCed15087a8b6e0ACFddCD63C811A);
}
library AaveV4EthereumSpokePriceFeeds {
// https://etherscan.io/address/0x5424384B256154046E9667dDFaaa5e550145215e
address internal constant BLUECHIP_SPOKE_WETH_PRICE_FEED =
0x5424384B256154046E9667dDFaaa5e550145215e;
// https://etherscan.io/address/0xDaa4B74C6bAc4e25188e64ebc68DB5050b690cAc
address internal constant BLUECHIP_SPOKE_WBTC_PRICE_FEED =
0xDaa4B74C6bAc4e25188e64ebc68DB5050b690cAc;
// https://etherscan.io/address/0xb41E773f507F7a7EA890b1afB7d2b660c30C8B0A
address internal constant BLUECHIP_SPOKE_cbBTC_PRICE_FEED =
0xb41E773f507F7a7EA890b1afB7d2b660c30C8B0A;
// https://etherscan.io/address/0xe1D97bF61901B075E9626c8A2340a7De385861Ef
address internal constant BLUECHIP_SPOKE_wstETH_PRICE_FEED =
0xe1D97bF61901B075E9626c8A2340a7De385861Ef;
// https://etherscan.io/address/0x3f73F03aa83B2A48ed27E964eD0fDb590332095B
address internal constant BLUECHIP_SPOKE_PRIME_USDC_PRICE_FEED =
0x3f73F03aa83B2A48ed27E964eD0fDb590332095B;
// https://etherscan.io/address/0x260326c220E469358846b187eE53328303Efe19C
address internal constant BLUECHIP_SPOKE_PRIME_USDT_PRICE_FEED =
0x260326c220E469358846b187eE53328303Efe19C;
// https://etherscan.io/address/0xD110cac5d8682A3b045D5524a9903E031d70FCCd
address internal constant BLUECHIP_SPOKE_GHO_PRICE_FEED =
0xD110cac5d8682A3b045D5524a9903E031d70FCCd;
// https://etherscan.io/address/0x3f73F03aa83B2A48ed27E964eD0fDb590332095B
address internal constant BLUECHIP_SPOKE_CORE_USDC_PRICE_FEED =
0x3f73F03aa83B2A48ed27E964eD0fDb590332095B;
// https://etherscan.io/address/0x25DEd2f9aE6ae9416693AB63Abe3aB25493861FD
address internal constant BLUECHIP_SPOKE_frxUSD_PRICE_FEED =
0x25DEd2f9aE6ae9416693AB63Abe3aB25493861FD;
// https://etherscan.io/address/0xa6aB031A4d189B24628EC9Eb155F0a0f1A0E55a3
address internal constant BLUECHIP_SPOKE_EURC_PRICE_FEED =
0xa6aB031A4d189B24628EC9Eb155F0a0f1A0E55a3;
// https://etherscan.io/address/0x260326c220E469358846b187eE53328303Efe19C
address internal constant BLUECHIP_SPOKE_CORE_USDT_PRICE_FEED =
0x260326c220E469358846b187eE53328303Efe19C;
// https://etherscan.io/address/0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4
address internal constant BLUECHIP_SPOKE_USDG_PRICE_FEED =
0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4;
// https://etherscan.io/address/0x0a72df02CE3E4185b6CEDf561f0AE651E9BeE235
address internal constant ETHENA_CORRELATED_SPOKE_PT_USDe_7MAY2026_PRICE_FEED =
0x0a72df02CE3E4185b6CEDf561f0AE651E9BeE235;
// https://etherscan.io/address/0xa0dc0249c32fa79e8B9b17c735908a60b1141B40
address internal constant ETHENA_CORRELATED_SPOKE_PT_sUSDE_7MAY2026_PRICE_FEED =
0xa0dc0249c32fa79e8B9b17c735908a60b1141B40;
// https://etherscan.io/address/0x42bc86f2f08419280a99d8fbEa4672e7c30a86ec
address internal constant ETHENA_CORRELATED_SPOKE_sUSDe_PRICE_FEED =
0x42bc86f2f08419280a99d8fbEa4672e7c30a86ec;
// https://etherscan.io/address/0xC26D4a1c46d884cfF6dE9800B6aE7A8Cf48B4Ff8
address internal constant ETHENA_CORRELATED_SPOKE_USDe_PRICE_FEED =
0xC26D4a1c46d884cfF6dE9800B6aE7A8Cf48B4Ff8;
// https://etherscan.io/address/0x0a72df02CE3E4185b6CEDf561f0AE651E9BeE235
address internal constant ETHENA_ECOSYSTEM_SPOKE_PT_USDe_7MAY2026_PRICE_FEED =
0x0a72df02CE3E4185b6CEDf561f0AE651E9BeE235;
// https://etherscan.io/address/0xa0dc0249c32fa79e8B9b17c735908a60b1141B40
address internal constant ETHENA_ECOSYSTEM_SPOKE_PT_sUSDE_7MAY2026_PRICE_FEED =
0xa0dc0249c32fa79e8B9b17c735908a60b1141B40;
// https://etherscan.io/address/0x42bc86f2f08419280a99d8fbEa4672e7c30a86ec
address internal constant ETHENA_ECOSYSTEM_SPOKE_sUSDe_PRICE_FEED =
0x42bc86f2f08419280a99d8fbEa4672e7c30a86ec;
// https://etherscan.io/address/0xC26D4a1c46d884cfF6dE9800B6aE7A8Cf48B4Ff8
address internal constant ETHENA_ECOSYSTEM_SPOKE_USDe_PRICE_FEED =
0xC26D4a1c46d884cfF6dE9800B6aE7A8Cf48B4Ff8;
// https://etherscan.io/address/0x3f73F03aa83B2A48ed27E964eD0fDb590332095B
address internal constant ETHENA_ECOSYSTEM_SPOKE_PLUS_USDC_PRICE_FEED =
0x3f73F03aa83B2A48ed27E964eD0fDb590332095B;
// https://etherscan.io/address/0x260326c220E469358846b187eE53328303Efe19C
address internal constant ETHENA_ECOSYSTEM_SPOKE_PLUS_USDT_PRICE_FEED =
0x260326c220E469358846b187eE53328303Efe19C;
// https://etherscan.io/address/0xD110cac5d8682A3b045D5524a9903E031d70FCCd
address internal constant ETHENA_ECOSYSTEM_SPOKE_GHO_PRICE_FEED =
0xD110cac5d8682A3b045D5524a9903E031d70FCCd;
// https://etherscan.io/address/0x3f73F03aa83B2A48ed27E964eD0fDb590332095B
address internal constant ETHENA_ECOSYSTEM_SPOKE_CORE_USDC_PRICE_FEED =
0x3f73F03aa83B2A48ed27E964eD0fDb590332095B;
// https://etherscan.io/address/0x25DEd2f9aE6ae9416693AB63Abe3aB25493861FD
address internal constant ETHENA_ECOSYSTEM_SPOKE_frxUSD_PRICE_FEED =
0x25DEd2f9aE6ae9416693AB63Abe3aB25493861FD;
// https://etherscan.io/address/0x260326c220E469358846b187eE53328303Efe19C
address internal constant ETHENA_ECOSYSTEM_SPOKE_CORE_USDT_PRICE_FEED =
0x260326c220E469358846b187eE53328303Efe19C;
// https://etherscan.io/address/0xa6aB031A4d189B24628EC9Eb155F0a0f1A0E55a3
address internal constant FOREX_SPOKE_EURC_PRICE_FEED =
0xa6aB031A4d189B24628EC9Eb155F0a0f1A0E55a3;
// https://etherscan.io/address/0x3f73F03aa83B2A48ed27E964eD0fDb590332095B
address internal constant FOREX_SPOKE_USDC_PRICE_FEED =
0x3f73F03aa83B2A48ed27E964eD0fDb590332095B;
// https://etherscan.io/address/0x260326c220E469358846b187eE53328303Efe19C
address internal constant FOREX_SPOKE_USDT_PRICE_FEED =
0x260326c220E469358846b187eE53328303Efe19C;
// https://etherscan.io/address/0xf0eaC18E908B34770FDEe46d069c846bDa866759
address internal constant FOREX_SPOKE_RLUSD_PRICE_FEED =
0xf0eaC18E908B34770FDEe46d069c846bDa866759;
// https://etherscan.io/address/0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4
address internal constant FOREX_SPOKE_USDG_PRICE_FEED =
0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4;
// https://etherscan.io/address/0x25DEd2f9aE6ae9416693AB63Abe3aB25493861FD
address internal constant FOREX_SPOKE_frxUSD_PRICE_FEED =
0x25DEd2f9aE6ae9416693AB63Abe3aB25493861FD;
// https://etherscan.io/address/0xD110cac5d8682A3b045D5524a9903E031d70FCCd
address internal constant FOREX_SPOKE_GHO_PRICE_FEED = 0xD110cac5d8682A3b045D5524a9903E031d70FCCd;
// https://etherscan.io/address/0x214eD9Da11D2fbe465a6fc601a91E62EbEc1a0D6
address internal constant GOLD_SPOKE_XAUt_PRICE_FEED = 0x214eD9Da11D2fbe465a6fc601a91E62EbEc1a0D6;
// https://etherscan.io/address/0x3f73F03aa83B2A48ed27E964eD0fDb590332095B
address internal constant GOLD_SPOKE_USDC_PRICE_FEED = 0x3f73F03aa83B2A48ed27E964eD0fDb590332095B;
// https://etherscan.io/address/0xf0eaC18E908B34770FDEe46d069c846bDa866759
address internal constant GOLD_SPOKE_RLUSD_PRICE_FEED =
0xf0eaC18E908B34770FDEe46d069c846bDa866759;
// https://etherscan.io/address/0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4
address internal constant GOLD_SPOKE_USDG_PRICE_FEED = 0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4;
// https://etherscan.io/address/0x25DEd2f9aE6ae9416693AB63Abe3aB25493861FD
address internal constant GOLD_SPOKE_frxUSD_PRICE_FEED =
0x25DEd2f9aE6ae9416693AB63Abe3aB25493861FD;
// https://etherscan.io/address/0xa6aB031A4d189B24628EC9Eb155F0a0f1A0E55a3
address internal constant GOLD_SPOKE_EURC_PRICE_FEED = 0xa6aB031A4d189B24628EC9Eb155F0a0f1A0E55a3;
// https://etherscan.io/address/0xD110cac5d8682A3b045D5524a9903E031d70FCCd
address internal constant GOLD_SPOKE_GHO_PRICE_FEED = 0xD110cac5d8682A3b045D5524a9903E031d70FCCd;
// https://etherscan.io/address/0x260326c220E469358846b187eE53328303Efe19C
address internal constant GOLD_SPOKE_USDT_PRICE_FEED = 0x260326c220E469358846b187eE53328303Efe19C;
// https://etherscan.io/address/0xf8c04B50499872A5B5137219DEc0F791f7f620D0
address internal constant LOMBARD_BTC_SPOKE_LBTC_PRICE_FEED =
0xf8c04B50499872A5B5137219DEc0F791f7f620D0;
// https://etherscan.io/address/0xDaa4B74C6bAc4e25188e64ebc68DB5050b690cAc
address internal constant LOMBARD_BTC_SPOKE_WBTC_PRICE_FEED =
0xDaa4B74C6bAc4e25188e64ebc68DB5050b690cAc;
// https://etherscan.io/address/0xb41E773f507F7a7EA890b1afB7d2b660c30C8B0A
address internal constant LOMBARD_BTC_SPOKE_cbBTC_PRICE_FEED =
0xb41E773f507F7a7EA890b1afB7d2b660c30C8B0A;
// https://etherscan.io/address/0x5424384B256154046E9667dDFaaa5e550145215e
address internal constant MAIN_SPOKE_WETH_PRICE_FEED = 0x5424384B256154046E9667dDFaaa5e550145215e;
// https://etherscan.io/address/0xe1D97bF61901B075E9626c8A2340a7De385861Ef
address internal constant MAIN_SPOKE_wstETH_PRICE_FEED =
0xe1D97bF61901B075E9626c8A2340a7De385861Ef;
// https://etherscan.io/address/0x87625393534d5C102cADB66D37201dF24cc26d4C
address internal constant MAIN_SPOKE_weETH_PRICE_FEED =
0x87625393534d5C102cADB66D37201dF24cc26d4C;
// https://etherscan.io/address/0xDaa4B74C6bAc4e25188e64ebc68DB5050b690cAc
address internal constant MAIN_SPOKE_WBTC_PRICE_FEED = 0xDaa4B74C6bAc4e25188e64ebc68DB5050b690cAc;
// https://etherscan.io/address/0xb41E773f507F7a7EA890b1afB7d2b660c30C8B0A
address internal constant MAIN_SPOKE_cbBTC_PRICE_FEED =
0xb41E773f507F7a7EA890b1afB7d2b660c30C8B0A;
// https://etherscan.io/address/0xF02C1e2A3B77c1cacC72f72B44f7d0a4c62e4a85
address internal constant MAIN_SPOKE_AAVE_PRICE_FEED = 0xF02C1e2A3B77c1cacC72f72B44f7d0a4c62e4a85;
// https://etherscan.io/address/0xC7e9b623ed51F033b32AE7f1282b1AD62C28C183
address internal constant MAIN_SPOKE_LINK_PRICE_FEED = 0xC7e9b623ed51F033b32AE7f1282b1AD62C28C183;
// https://etherscan.io/address/0x3f73F03aa83B2A48ed27E964eD0fDb590332095B
address internal constant MAIN_SPOKE_USDC_PRICE_FEED = 0x3f73F03aa83B2A48ed27E964eD0fDb590332095B;
// https://etherscan.io/address/0x260326c220E469358846b187eE53328303Efe19C
address internal constant MAIN_SPOKE_USDT_PRICE_FEED = 0x260326c220E469358846b187eE53328303Efe19C;
// https://etherscan.io/address/0xa6aB031A4d189B24628EC9Eb155F0a0f1A0E55a3
address internal constant MAIN_SPOKE_EURC_PRICE_FEED = 0xa6aB031A4d189B24628EC9Eb155F0a0f1A0E55a3;
// https://etherscan.io/address/0xf0eaC18E908B34770FDEe46d069c846bDa866759
address internal constant MAIN_SPOKE_RLUSD_PRICE_FEED =
0xf0eaC18E908B34770FDEe46d069c846bDa866759;
// https://etherscan.io/address/0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4
address internal constant MAIN_SPOKE_USDG_PRICE_FEED = 0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4;
// https://etherscan.io/address/0x25DEd2f9aE6ae9416693AB63Abe3aB25493861FD
address internal constant MAIN_SPOKE_frxUSD_PRICE_FEED =
0x25DEd2f9aE6ae9416693AB63Abe3aB25493861FD;
// https://etherscan.io/address/0xD110cac5d8682A3b045D5524a9903E031d70FCCd
address internal constant MAIN_SPOKE_GHO_PRICE_FEED = 0xD110cac5d8682A3b045D5524a9903E031d70FCCd;
// https://etherscan.io/address/0x214eD9Da11D2fbe465a6fc601a91E62EbEc1a0D6
address internal constant PAXG_GOLD_SPOKE_PAXG_PRICE_FEED =
0x214eD9Da11D2fbe465a6fc601a91E62EbEc1a0D6;
// https://etherscan.io/address/0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4
address internal constant PAXG_GOLD_SPOKE_USDG_PRICE_FEED =
0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4;
// https://etherscan.io/address/0x89F6Eb404AbF19FE817426dD2E2E0F14D1a5712e
address internal constant USDG_PENDLE_SPOKE_PT_USDG_24SEP2026_PRICE_FEED =
0x89F6Eb404AbF19FE817426dD2E2E0F14D1a5712e;
// https://etherscan.io/address/0x3f73F03aa83B2A48ed27E964eD0fDb590332095B
address internal constant USDG_PENDLE_SPOKE_USDC_PRICE_FEED =
0x3f73F03aa83B2A48ed27E964eD0fDb590332095B;
// https://etherscan.io/address/0x260326c220E469358846b187eE53328303Efe19C
address internal constant USDG_PENDLE_SPOKE_USDT_PRICE_FEED =
0x260326c220E469358846b187eE53328303Efe19C;
// https://etherscan.io/address/0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4
address internal constant USDG_PENDLE_SPOKE_CORE_USDG_PRICE_FEED =
0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4;
// https://etherscan.io/address/0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4
address internal constant USDG_PENDLE_SPOKE_GLOBAL_DOLLAR_USDG_PRICE_FEED =
0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4;
// https://etherscan.io/address/0x87625393534d5C102cADB66D37201dF24cc26d4C
address internal constant ETHERFI_ESPOKE_weETH_PRICE_FEED =
0x87625393534d5C102cADB66D37201dF24cc26d4C;
// https://etherscan.io/address/0x5424384B256154046E9667dDFaaa5e550145215e
address internal constant ETHERFI_ESPOKE_WETH_PRICE_FEED =
0x5424384B256154046E9667dDFaaa5e550145215e;
// https://etherscan.io/address/0x7292C95A5f6A501a9c4B34f6393e221F2A0139c3
address internal constant KELP_ESPOKE_rsETH_PRICE_FEED =
0x7292C95A5f6A501a9c4B34f6393e221F2A0139c3;
// https://etherscan.io/address/0x5424384B256154046E9667dDFaaa5e550145215e
address internal constant KELP_ESPOKE_WETH_PRICE_FEED =
0x5424384B256154046E9667dDFaaa5e550145215e;
// https://etherscan.io/address/0xe1D97bF61901B075E9626c8A2340a7De385861Ef
address internal constant LIDO_ESPOKE_wstETH_PRICE_FEED =
0xe1D97bF61901B075E9626c8A2340a7De385861Ef;
// https://etherscan.io/address/0x5424384B256154046E9667dDFaaa5e550145215e
address internal constant LIDO_ESPOKE_WETH_PRICE_FEED =
0x5424384B256154046E9667dDFaaa5e550145215e;
// https://etherscan.io/address/0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4
address internal constant USDG_MAPLE_ESPOKE_GLOBAL_DOLLAR_USDG_PRICE_FEED =
0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4;
// https://etherscan.io/address/0x5A6FcB0ebc018b6FD94Fc5f5A9F0948d0D40f040
address internal constant USDG_MAPLE_ESPOKE_syrupUSDG_PRICE_FEED =
0x5A6FcB0ebc018b6FD94Fc5f5A9F0948d0D40f040;
// https://etherscan.io/address/0x3f73F03aa83B2A48ed27E964eD0fDb590332095B
address internal constant USDG_MAPLE_ESPOKE_USDC_PRICE_FEED =
0x3f73F03aa83B2A48ed27E964eD0fDb590332095B;
// https://etherscan.io/address/0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4
address internal constant USDG_MAPLE_ESPOKE_CORE_USDG_PRICE_FEED =
0x83D20dEEdcd4aC1313496c8CBcAad0fa298c0CE4;
}
library AaveV4EthereumTokenizationSpokes {
// https://etherscan.io/address/0x7320CF22Ac095bA2a2e0a652F77efB836c2E751b
ITokenizationSpoke internal constant CORE_WETH_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x7320CF22Ac095bA2a2e0a652F77efB836c2E751b);
// https://etherscan.io/address/0xcb0E7dA9c635628f6d4827355AeCa75aB8d3560f
ITokenizationSpoke internal constant CORE_wstETH_TOKENIZATION_SPOKE =
ITokenizationSpoke(0xcb0E7dA9c635628f6d4827355AeCa75aB8d3560f);
// https://etherscan.io/address/0x559cEc2C840D9DBB18936Afc5E5341D78bfC7Cbe
ITokenizationSpoke internal constant CORE_weETH_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x559cEc2C840D9DBB18936Afc5E5341D78bfC7Cbe);
// https://etherscan.io/address/0x45a04Ca1A5cbEeA4B44356c75EDd29b33eB2527a
ITokenizationSpoke internal constant CORE_rsETH_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x45a04Ca1A5cbEeA4B44356c75EDd29b33eB2527a);
// https://etherscan.io/address/0x5eC44a70F309854fe04d495cFE1B5dA63DD1cc73
ITokenizationSpoke internal constant CORE_USDT_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x5eC44a70F309854fe04d495cFE1B5dA63DD1cc73);
// https://etherscan.io/address/0x531E90a2376902DE8915789Fcc1075e3B0c153E7
ITokenizationSpoke internal constant CORE_USDC_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x531E90a2376902DE8915789Fcc1075e3B0c153E7);
// https://etherscan.io/address/0x58C14a5E061c9bC6926c5b853445290F296C2F7B
ITokenizationSpoke internal constant CORE_GHO_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x58C14a5E061c9bC6926c5b853445290F296C2F7B);
// https://etherscan.io/address/0xC8a125AE4275a78AADc53B46Ca10566Bc9B249E0
ITokenizationSpoke internal constant CORE_RLUSD_TOKENIZATION_SPOKE =
ITokenizationSpoke(0xC8a125AE4275a78AADc53B46Ca10566Bc9B249E0);
// https://etherscan.io/address/0xAC2435E3C25e8246870D33ce0a26988A46d5DB68
ITokenizationSpoke internal constant CORE_USDG_TOKENIZATION_SPOKE =
ITokenizationSpoke(0xAC2435E3C25e8246870D33ce0a26988A46d5DB68);
// https://etherscan.io/address/0x2226749630775ee20230Ad65214fB339087eF30D
ITokenizationSpoke internal constant CORE_frxUSD_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x2226749630775ee20230Ad65214fB339087eF30D);
// https://etherscan.io/address/0x6D9e2Cdd61CaF69af99b275704B6e272C41c6718
ITokenizationSpoke internal constant CORE_EURC_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x6D9e2Cdd61CaF69af99b275704B6e272C41c6718);
// https://etherscan.io/address/0x82A9CC4656784E55Ef2E78F704028B5E1Bfc1732
ITokenizationSpoke internal constant CORE_WBTC_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x82A9CC4656784E55Ef2E78F704028B5E1Bfc1732);
// https://etherscan.io/address/0x33B41B74366F55327d959FfF6D6b6fBc2853dbB1
ITokenizationSpoke internal constant CORE_cbBTC_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x33B41B74366F55327d959FfF6D6b6fBc2853dbB1);
// https://etherscan.io/address/0x7961F140B570490849DB878AE222570ea838799d
ITokenizationSpoke internal constant CORE_LBTC_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x7961F140B570490849DB878AE222570ea838799d);
// https://etherscan.io/address/0x4E712562fcb5337011398B6C630f55b60641cd5e
ITokenizationSpoke internal constant CORE_XAUt_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x4E712562fcb5337011398B6C630f55b60641cd5e);
// https://etherscan.io/address/0x0A65197b16C5969F92672051c9C9C0C75B369135
ITokenizationSpoke internal constant CORE_AAVE_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x0A65197b16C5969F92672051c9C9C0C75B369135);
// https://etherscan.io/address/0xE69C2045095C8Ab3E2a7d77de2328faE5baF797c
ITokenizationSpoke internal constant CORE_LINK_TOKENIZATION_SPOKE =
ITokenizationSpoke(0xE69C2045095C8Ab3E2a7d77de2328faE5baF797c);
// https://etherscan.io/address/0x90774889c22D2F2Adf44da1f04C7c95542590df4
ITokenizationSpoke internal constant PLUS_PT_sUSDE_7MAY2026_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x90774889c22D2F2Adf44da1f04C7c95542590df4);
// https://etherscan.io/address/0xdd2Eb78BF9e6aC5068B95aD2d451e8c9Af10ac81
ITokenizationSpoke internal constant PLUS_PT_USDe_7MAY2026_TOKENIZATION_SPOKE =
ITokenizationSpoke(0xdd2Eb78BF9e6aC5068B95aD2d451e8c9Af10ac81);
// https://etherscan.io/address/0x24f8c062e1E0451736C1D6E023510DA262a41df4
ITokenizationSpoke internal constant PLUS_sUSDe_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x24f8c062e1E0451736C1D6E023510DA262a41df4);
// https://etherscan.io/address/0x502Cd81da6a8F1785eb2eEE72713B7388E16A854
ITokenizationSpoke internal constant PLUS_USDe_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x502Cd81da6a8F1785eb2eEE72713B7388E16A854);
// https://etherscan.io/address/0xc94bdd83D2c7655C280655D60954e79E88D4F949
ITokenizationSpoke internal constant PLUS_USDC_TOKENIZATION_SPOKE =
ITokenizationSpoke(0xc94bdd83D2c7655C280655D60954e79E88D4F949);
// https://etherscan.io/address/0xA54382db40EC602c0a173A08f9E86Ed40F9D4D10
ITokenizationSpoke internal constant PLUS_GHO_TOKENIZATION_SPOKE =
ITokenizationSpoke(0xA54382db40EC602c0a173A08f9E86Ed40F9D4D10);
// https://etherscan.io/address/0x80835EB50694EE0e519743f67e5401e6FD300006
ITokenizationSpoke internal constant PLUS_USDT_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x80835EB50694EE0e519743f67e5401e6FD300006);
// https://etherscan.io/address/0x2087513383330B961A3753B47627Bbf149F31c70
ITokenizationSpoke internal constant PRIME_WETH_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x2087513383330B961A3753B47627Bbf149F31c70);
// https://etherscan.io/address/0x5AE3d87De89CA6Ce501e8317887F71EABED69E18
ITokenizationSpoke internal constant PRIME_WBTC_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x5AE3d87De89CA6Ce501e8317887F71EABED69E18);
// https://etherscan.io/address/0xD38098faf52D8E915EdED84fBF30F81C17906938
ITokenizationSpoke internal constant PRIME_cbBTC_TOKENIZATION_SPOKE =
ITokenizationSpoke(0xD38098faf52D8E915EdED84fBF30F81C17906938);
// https://etherscan.io/address/0xFCD3D3C69cd032DE0cc78fE529B7447D2fe7F666
ITokenizationSpoke internal constant PRIME_wstETH_TOKENIZATION_SPOKE =
ITokenizationSpoke(0xFCD3D3C69cd032DE0cc78fE529B7447D2fe7F666);
// https://etherscan.io/address/0x486415fb1F8b062c89ED548f871cf64304AACb31
ITokenizationSpoke internal constant PRIME_USDC_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x486415fb1F8b062c89ED548f871cf64304AACb31);
// https://etherscan.io/address/0x46c588DD8453aC259c1f6a54b4C9A93C2aC3762D
ITokenizationSpoke internal constant PRIME_USDT_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x46c588DD8453aC259c1f6a54b4C9A93C2aC3762D);
// https://etherscan.io/address/0x900fD46d565d1ac8995928c0179052ec02a6D0E1
ITokenizationSpoke internal constant PRIME_GHO_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x900fD46d565d1ac8995928c0179052ec02a6D0E1);
// https://etherscan.io/address/0x7Df10B4A01350D2A1d95cFbE7c9207d7210A2663
ITokenizationSpoke internal constant GLOBAL_DOLLAR_PT_USDG_24SEP2026_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x7Df10B4A01350D2A1d95cFbE7c9207d7210A2663);
// https://etherscan.io/address/0xaed7c529bD2878170B61C758DfAa215AC7a4FD07
ITokenizationSpoke internal constant GLOBAL_DOLLAR_USDC_TOKENIZATION_SPOKE =
ITokenizationSpoke(0xaed7c529bD2878170B61C758DfAa215AC7a4FD07);
// https://etherscan.io/address/0xa0e97e45C2f89003730E467Bd484fA3eEcE5B4Cf
ITokenizationSpoke internal constant GLOBAL_DOLLAR_USDT_TOKENIZATION_SPOKE =
ITokenizationSpoke(0xa0e97e45C2f89003730E467Bd484fA3eEcE5B4Cf);
// https://etherscan.io/address/0x378B4a7c394E22bd562F66eB612165893533c124
ITokenizationSpoke internal constant GLOBAL_DOLLAR_USDG_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x378B4a7c394E22bd562F66eB612165893533c124);
// https://etherscan.io/address/0x6493a23874b506D5Bb6038ea44aE9CC74cD00849
ITokenizationSpoke internal constant GLOBAL_DOLLAR_PAXG_TOKENIZATION_SPOKE =
ITokenizationSpoke(0x6493a23874b506D5Bb6038ea44aE9CC74cD00849);
}
library AaveV4EthereumIRStrategies {
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_WETH_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_wstETH_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_weETH_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_rsETH_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_USDT_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_USDC_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_GHO_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_RLUSD_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_USDG_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_frxUSD_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_EURC_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_WBTC_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_cbBTC_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_LBTC_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_XAUt_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_AAVE_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f
IBasicInterestRateStrategy internal constant CORE_LINK_IR_STRATEGY =
IBasicInterestRateStrategy(0xAD88791B0F81D1FA242f637eB05bee0cbc53fe2f);
// https://etherscan.io/address/0x31280650661b8443723fa9739b3A164E3696af48
IBasicInterestRateStrategy internal constant PLUS_PT_sUSDE_7MAY2026_IR_STRATEGY =
IBasicInterestRateStrategy(0x31280650661b8443723fa9739b3A164E3696af48);
// https://etherscan.io/address/0x31280650661b8443723fa9739b3A164E3696af48
IBasicInterestRateStrategy internal constant PLUS_PT_USDe_7MAY2026_IR_STRATEGY =
IBasicInterestRateStrategy(0x31280650661b8443723fa9739b3A164E3696af48);
// https://etherscan.io/address/0x31280650661b8443723fa9739b3A164E3696af48
IBasicInterestRateStrategy internal constant PLUS_sUSDe_IR_STRATEGY =
IBasicInterestRateStrategy(0x31280650661b8443723fa9739b3A164E3696af48);
// https://etherscan.io/address/0x31280650661b8443723fa9739b3A164E3696af48
IBasicInterestRateStrategy internal constant PLUS_USDe_IR_STRATEGY =
IBasicInterestRateStrategy(0x31280650661b8443723fa9739b3A164E3696af48);
// https://etherscan.io/address/0x31280650661b8443723fa9739b3A164E3696af48
IBasicInterestRateStrategy internal constant PLUS_USDC_IR_STRATEGY =
IBasicInterestRateStrategy(0x31280650661b8443723fa9739b3A164E3696af48);
// https://etherscan.io/address/0x31280650661b8443723fa9739b3A164E3696af48
IBasicInterestRateStrategy internal constant PLUS_GHO_IR_STRATEGY =
IBasicInterestRateStrategy(0x31280650661b8443723fa9739b3A164E3696af48);
// https://etherscan.io/address/0x31280650661b8443723fa9739b3A164E3696af48
IBasicInterestRateStrategy internal constant PLUS_USDT_IR_STRATEGY =
IBasicInterestRateStrategy(0x31280650661b8443723fa9739b3A164E3696af48);
// https://etherscan.io/address/0xDCd924047a4bDBFef9CCDDe845E5D45373Ad276D
IBasicInterestRateStrategy internal constant PRIME_WETH_IR_STRATEGY =
IBasicInterestRateStrategy(0xDCd924047a4bDBFef9CCDDe845E5D45373Ad276D);
// https://etherscan.io/address/0xDCd924047a4bDBFef9CCDDe845E5D45373Ad276D
IBasicInterestRateStrategy internal constant PRIME_WBTC_IR_STRATEGY =
IBasicInterestRateStrategy(0xDCd924047a4bDBFef9CCDDe845E5D45373Ad276D);
// https://etherscan.io/address/0xDCd924047a4bDBFef9CCDDe845E5D45373Ad276D
IBasicInterestRateStrategy internal constant PRIME_cbBTC_IR_STRATEGY =
IBasicInterestRateStrategy(0xDCd924047a4bDBFef9CCDDe845E5D45373Ad276D);
// https://etherscan.io/address/0xDCd924047a4bDBFef9CCDDe845E5D45373Ad276D
IBasicInterestRateStrategy internal constant PRIME_wstETH_IR_STRATEGY =
IBasicInterestRateStrategy(0xDCd924047a4bDBFef9CCDDe845E5D45373Ad276D);
// https://etherscan.io/address/0xDCd924047a4bDBFef9CCDDe845E5D45373Ad276D
IBasicInterestRateStrategy internal constant PRIME_USDC_IR_STRATEGY =
IBasicInterestRateStrategy(0xDCd924047a4bDBFef9CCDDe845E5D45373Ad276D);
// https://etherscan.io/address/0xDCd924047a4bDBFef9CCDDe845E5D45373Ad276D
IBasicInterestRateStrategy internal constant PRIME_USDT_IR_STRATEGY =
IBasicInterestRateStrategy(0xDCd924047a4bDBFef9CCDDe845E5D45373Ad276D);
// https://etherscan.io/address/0xDCd924047a4bDBFef9CCDDe845E5D45373Ad276D
IBasicInterestRateStrategy internal constant PRIME_GHO_IR_STRATEGY =
IBasicInterestRateStrategy(0xDCd924047a4bDBFef9CCDDe845E5D45373Ad276D);
// https://etherscan.io/address/0xD7eC225DC053151100A0ef47b94a77AAD9C413b7
IBasicInterestRateStrategy internal constant GLOBAL_DOLLAR_PT_USDG_24SEP2026_IR_STRATEGY =
IBasicInterestRateStrategy(0xD7eC225DC053151100A0ef47b94a77AAD9C413b7);
// https://etherscan.io/address/0xD7eC225DC053151100A0ef47b94a77AAD9C413b7
IBasicInterestRateStrategy internal constant GLOBAL_DOLLAR_USDC_IR_STRATEGY =
IBasicInterestRateStrategy(0xD7eC225DC053151100A0ef47b94a77AAD9C413b7);
// https://etherscan.io/address/0xD7eC225DC053151100A0ef47b94a77AAD9C413b7
IBasicInterestRateStrategy internal constant GLOBAL_DOLLAR_USDT_IR_STRATEGY =
IBasicInterestRateStrategy(0xD7eC225DC053151100A0ef47b94a77AAD9C413b7);
// https://etherscan.io/address/0xD7eC225DC053151100A0ef47b94a77AAD9C413b7
IBasicInterestRateStrategy internal constant GLOBAL_DOLLAR_USDG_IR_STRATEGY =
IBasicInterestRateStrategy(0xD7eC225DC053151100A0ef47b94a77AAD9C413b7);
// https://etherscan.io/address/0xD7eC225DC053151100A0ef47b94a77AAD9C413b7
IBasicInterestRateStrategy internal constant GLOBAL_DOLLAR_syrupUSDG_IR_STRATEGY =
IBasicInterestRateStrategy(0xD7eC225DC053151100A0ef47b94a77AAD9C413b7);
// https://etherscan.io/address/0xD7eC225DC053151100A0ef47b94a77AAD9C413b7
IBasicInterestRateStrategy internal constant GLOBAL_DOLLAR_PAXG_IR_STRATEGY =
IBasicInterestRateStrategy(0xD7eC225DC053151100A0ef47b94a77AAD9C413b7);
}
library AaveV4EthereumPositionManagers {
// https://etherscan.io/address/0x17A54b8d6D9C68e7fa1C7112AC998EA1BA51d11e
IGiverPositionManager internal constant GIVER_POSITION_MANAGER =
IGiverPositionManager(0x17A54b8d6D9C68e7fa1C7112AC998EA1BA51d11e);
// https://etherscan.io/address/0x6c044c0D3801499bCAbfAd458B70880bc518e9F7
ITakerPositionManager internal constant TAKER_POSITION_MANAGER =
ITakerPositionManager(0x6c044c0D3801499bCAbfAd458B70880bc518e9F7);
// https://etherscan.io/address/0x51305839CE822a7b4b12AA7D86eA7005052d575c
IConfigPositionManager internal constant CONFIG_POSITION_MANAGER =
IConfigPositionManager(0x51305839CE822a7b4b12AA7D86eA7005052d575c);
// https://etherscan.io/address/0xe68ab4F90Fe026B9873F5F276eD2d7efBbbE42Be
INativeTokenGateway internal constant NATIVE_TOKEN_GATEWAY =
INativeTokenGateway(0xe68ab4F90Fe026B9873F5F276eD2d7efBbbE42Be);
// https://etherscan.io/address/0xfbC184337Dc6595D8bf62968Bda46e7De7AF9c3d
ISignatureGateway internal constant SIGNATURE_GATEWAY =
ISignatureGateway(0xfbC184337Dc6595D8bf62968Bda46e7De7AF9c3d);
}
library AaveV4EthereumExternalLibraries {
// https://etherscan.io/address/0x88dF535473C5adf1f57789734A05E555F7Deb8DB
address internal constant LIQUIDATION_LOGIC = 0x88dF535473C5adf1f57789734A05E555F7Deb8DB;
}
library AaveV4EthereumAssets {
// https://etherscan.io/address/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
address internal constant WETH_UNDERLYING = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
uint8 internal constant WETH_DECIMALS = 18;
// https://etherscan.io/address/0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0
address internal constant wstETH_UNDERLYING = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0;
uint8 internal constant wstETH_DECIMALS = 18;
// https://etherscan.io/address/0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee
address internal constant weETH_UNDERLYING = 0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee;
uint8 internal constant weETH_DECIMALS = 18;
// https://etherscan.io/address/0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7
address internal constant rsETH_UNDERLYING = 0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7;
uint8 internal constant rsETH_DECIMALS = 18;
// https://etherscan.io/address/0xdAC17F958D2ee523a2206206994597C13D831ec7
address internal constant USDT_UNDERLYING = 0xdAC17F958D2ee523a2206206994597C13D831ec7;
uint8 internal constant USDT_DECIMALS = 6;
// https://etherscan.io/address/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
address internal constant USDC_UNDERLYING = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
uint8 internal constant USDC_DECIMALS = 6;
// https://etherscan.io/address/0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f
address internal constant GHO_UNDERLYING = 0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f;
uint8 internal constant GHO_DECIMALS = 18;
// https://etherscan.io/address/0x8292Bb45bf1Ee4d140127049757C2E0fF06317eD
address internal constant RLUSD_UNDERLYING = 0x8292Bb45bf1Ee4d140127049757C2E0fF06317eD;
uint8 internal constant RLUSD_DECIMALS = 18;
// https://etherscan.io/address/0xe343167631d89B6Ffc58B88d6b7fB0228795491D
address internal constant USDG_UNDERLYING = 0xe343167631d89B6Ffc58B88d6b7fB0228795491D;
uint8 internal constant USDG_DECIMALS = 6;
// https://etherscan.io/address/0xCAcd6fd266aF91b8AeD52aCCc382b4e165586E29
address internal constant frxUSD_UNDERLYING = 0xCAcd6fd266aF91b8AeD52aCCc382b4e165586E29;
uint8 internal constant frxUSD_DECIMALS = 18;
// https://etherscan.io/address/0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c
address internal constant EURC_UNDERLYING = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;
uint8 internal constant EURC_DECIMALS = 6;
// https://etherscan.io/address/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599
address internal constant WBTC_UNDERLYING = 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599;
uint8 internal constant WBTC_DECIMALS = 8;
// https://etherscan.io/address/0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf
address internal constant cbBTC_UNDERLYING = 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf;
uint8 internal constant cbBTC_DECIMALS = 8;
// https://etherscan.io/address/0x8236a87084f8B84306f72007F36F2618A5634494
address internal constant LBTC_UNDERLYING = 0x8236a87084f8B84306f72007F36F2618A5634494;
uint8 internal constant LBTC_DECIMALS = 8;
// https://etherscan.io/address/0x68749665FF8D2d112Fa859AA293F07A622782F38
address internal constant XAUt_UNDERLYING = 0x68749665FF8D2d112Fa859AA293F07A622782F38;
uint8 internal constant XAUt_DECIMALS = 6;
// https://etherscan.io/address/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9
address internal constant AAVE_UNDERLYING = 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9;
uint8 internal constant AAVE_DECIMALS = 18;
// https://etherscan.io/address/0x514910771AF9Ca656af840dff83E8264EcF986CA
address internal constant LINK_UNDERLYING = 0x514910771AF9Ca656af840dff83E8264EcF986CA;
uint8 internal constant LINK_DECIMALS = 18;
// https://etherscan.io/address/0x3de0ff76E8b528C092d47b9DaC775931cef80F49
address internal constant PT_sUSDE_7MAY2026_UNDERLYING =
0x3de0ff76E8b528C092d47b9DaC775931cef80F49;
uint8 internal constant PT_sUSDE_7MAY2026_DECIMALS = 18;
// https://etherscan.io/address/0xAeBf0Bb9f57E89260d57f31AF34eB58657d96Ce0
address internal constant PT_USDe_7MAY2026_UNDERLYING =
0xAeBf0Bb9f57E89260d57f31AF34eB58657d96Ce0;
uint8 internal constant PT_USDe_7MAY2026_DECIMALS = 18;
// https://etherscan.io/address/0x9D39A5DE30e57443BfF2A8307A4256c8797A3497
address internal constant sUSDe_UNDERLYING = 0x9D39A5DE30e57443BfF2A8307A4256c8797A3497;
uint8 internal constant sUSDe_DECIMALS = 18;
// https://etherscan.io/address/0x4c9EDD5852cd905f086C759E8383e09bff1E68B3
address internal constant USDe_UNDERLYING = 0x4c9EDD5852cd905f086C759E8383e09bff1E68B3;
uint8 internal constant USDe_DECIMALS = 18;
// https://etherscan.io/address/0xc1906aeCf868749a2DeE203F59b904c0cf212140
address internal constant PT_USDG_24SEP2026_UNDERLYING =
0xc1906aeCf868749a2DeE203F59b904c0cf212140;
uint8 internal constant PT_USDG_24SEP2026_DECIMALS = 6;
// https://etherscan.io/address/0x87b65C4aAFFA76881f9E96F3e7ED945ddFC3Cd7A
address internal constant syrupUSDG_UNDERLYING = 0x87b65C4aAFFA76881f9E96F3e7ED945ddFC3Cd7A;
uint8 internal constant syrupUSDG_DECIMALS = 6;
// https://etherscan.io/address/0x45804880De22913dAFE09f4980848ECE6EcbAf78
address internal constant PAXG_UNDERLYING = 0x45804880De22913dAFE09f4980848ECE6EcbAf78;
uint8 internal constant PAXG_DECIMALS = 18;
}
library AaveV4EthereumGetters {
function getAllHubs() internal pure returns (IHub[] memory) {
IHub[] memory hubs = new IHub[](4);
hubs[0] = AaveV4EthereumHubs.CORE_HUB;
hubs[1] = AaveV4EthereumHubs.PLUS_HUB;
hubs[2] = AaveV4EthereumHubs.PRIME_HUB;
hubs[3] = AaveV4EthereumHubs.GLOBAL_DOLLAR_HUB;
return hubs;
}
function getAllSpokes() internal pure returns (ISpoke[] memory) {
ISpoke[] memory spokes = new ISpoke[](13);
spokes[0] = AaveV4EthereumSpokes.BLUECHIP_SPOKE;
spokes[1] = AaveV4EthereumSpokes.ETHENA_CORRELATED_SPOKE;
spokes[2] = AaveV4EthereumSpokes.ETHENA_ECOSYSTEM_SPOKE;
spokes[3] = AaveV4EthereumSpokes.FOREX_SPOKE;
spokes[4] = AaveV4EthereumSpokes.GOLD_SPOKE;
spokes[5] = AaveV4EthereumSpokes.LOMBARD_BTC_SPOKE;
spokes[6] = AaveV4EthereumSpokes.MAIN_SPOKE;
spokes[7] = AaveV4EthereumSpokes.PAXG_GOLD_SPOKE;
spokes[8] = AaveV4EthereumSpokes.USDG_PENDLE_SPOKE;
spokes[9] = AaveV4EthereumSpokes.ETHERFI_ESPOKE;
spokes[10] = AaveV4EthereumSpokes.KELP_ESPOKE;
spokes[11] = AaveV4EthereumSpokes.LIDO_ESPOKE;
spokes[12] = AaveV4EthereumSpokes.USDG_MAPLE_ESPOKE;
return spokes;
}
function getAllTokenizationSpokes() internal pure returns (ITokenizationSpoke[] memory) {
ITokenizationSpoke[] memory tokenizedSpokes = new ITokenizationSpoke[](36);
tokenizedSpokes[0] = AaveV4EthereumTokenizationSpokes.CORE_WETH_TOKENIZATION_SPOKE;
tokenizedSpokes[1] = AaveV4EthereumTokenizationSpokes.CORE_wstETH_TOKENIZATION_SPOKE;
tokenizedSpokes[2] = AaveV4EthereumTokenizationSpokes.CORE_weETH_TOKENIZATION_SPOKE;
tokenizedSpokes[3] = AaveV4EthereumTokenizationSpokes.CORE_rsETH_TOKENIZATION_SPOKE;
tokenizedSpokes[4] = AaveV4EthereumTokenizationSpokes.CORE_USDT_TOKENIZATION_SPOKE;
tokenizedSpokes[5] = AaveV4EthereumTokenizationSpokes.CORE_USDC_TOKENIZATION_SPOKE;
tokenizedSpokes[6] = AaveV4EthereumTokenizationSpokes.CORE_GHO_TOKENIZATION_SPOKE;
tokenizedSpokes[7] = AaveV4EthereumTokenizationSpokes.CORE_RLUSD_TOKENIZATION_SPOKE;
tokenizedSpokes[8] = AaveV4EthereumTokenizationSpokes.CORE_USDG_TOKENIZATION_SPOKE;
tokenizedSpokes[9] = AaveV4EthereumTokenizationSpokes.CORE_frxUSD_TOKENIZATION_SPOKE;
tokenizedSpokes[10] = AaveV4EthereumTokenizationSpokes.CORE_EURC_TOKENIZATION_SPOKE;
tokenizedSpokes[11] = AaveV4EthereumTokenizationSpokes.CORE_WBTC_TOKENIZATION_SPOKE;
tokenizedSpokes[12] = AaveV4EthereumTokenizationSpokes.CORE_cbBTC_TOKENIZATION_SPOKE;
tokenizedSpokes[13] = AaveV4EthereumTokenizationSpokes.CORE_LBTC_TOKENIZATION_SPOKE;
tokenizedSpokes[14] = AaveV4EthereumTokenizationSpokes.CORE_XAUt_TOKENIZATION_SPOKE;
tokenizedSpokes[15] = AaveV4EthereumTokenizationSpokes.CORE_AAVE_TOKENIZATION_SPOKE;
tokenizedSpokes[16] = AaveV4EthereumTokenizationSpokes.CORE_LINK_TOKENIZATION_SPOKE;
tokenizedSpokes[17] = AaveV4EthereumTokenizationSpokes
.PLUS_PT_sUSDE_7MAY2026_TOKENIZATION_SPOKE;
tokenizedSpokes[18] = AaveV4EthereumTokenizationSpokes.PLUS_PT_USDe_7MAY2026_TOKENIZATION_SPOKE;
tokenizedSpokes[19] = AaveV4EthereumTokenizationSpokes.PLUS_sUSDe_TOKENIZATION_SPOKE;
tokenizedSpokes[20] = AaveV4EthereumTokenizationSpokes.PLUS_USDe_TOKENIZATION_SPOKE;
tokenizedSpokes[21] = AaveV4EthereumTokenizationSpokes.PLUS_USDC_TOKENIZATION_SPOKE;
tokenizedSpokes[22] = AaveV4EthereumTokenizationSpokes.PLUS_GHO_TOKENIZATION_SPOKE;
tokenizedSpokes[23] = AaveV4EthereumTokenizationSpokes.PLUS_USDT_TOKENIZATION_SPOKE;
tokenizedSpokes[24] = AaveV4EthereumTokenizationSpokes.PRIME_WETH_TOKENIZATION_SPOKE;
tokenizedSpokes[25] = AaveV4EthereumTokenizationSpokes.PRIME_WBTC_TOKENIZATION_SPOKE;
tokenizedSpokes[26] = AaveV4EthereumTokenizationSpokes.PRIME_cbBTC_TOKENIZATION_SPOKE;
tokenizedSpokes[27] = AaveV4EthereumTokenizationSpokes.PRIME_wstETH_TOKENIZATION_SPOKE;
tokenizedSpokes[28] = AaveV4EthereumTokenizationSpokes.PRIME_USDC_TOKENIZATION_SPOKE;
tokenizedSpokes[29] = AaveV4EthereumTokenizationSpokes.PRIME_USDT_TOKENIZATION_SPOKE;
tokenizedSpokes[30] = AaveV4EthereumTokenizationSpokes.PRIME_GHO_TOKENIZATION_SPOKE;
tokenizedSpokes[31] = AaveV4EthereumTokenizationSpokes
.GLOBAL_DOLLAR_PT_USDG_24SEP2026_TOKENIZATION_SPOKE;
tokenizedSpokes[32] = AaveV4EthereumTokenizationSpokes.GLOBAL_DOLLAR_USDC_TOKENIZATION_SPOKE;
tokenizedSpokes[33] = AaveV4EthereumTokenizationSpokes.GLOBAL_DOLLAR_USDT_TOKENIZATION_SPOKE;
tokenizedSpokes[34] = AaveV4EthereumTokenizationSpokes.GLOBAL_DOLLAR_USDG_TOKENIZATION_SPOKE;
tokenizedSpokes[35] = AaveV4EthereumTokenizationSpokes.GLOBAL_DOLLAR_PAXG_TOKENIZATION_SPOKE;
return tokenizedSpokes;
}
function getAllSpokesRaw() internal pure returns (address[] memory) {
address[] memory spokes = new address[](50);
spokes[0] = address(AaveV4EthereumSpokes.TREASURY_SPOKE);
spokes[1] = address(AaveV4EthereumSpokes.BLUECHIP_SPOKE);
spokes[2] = address(AaveV4EthereumSpokes.ETHENA_CORRELATED_SPOKE);
spokes[3] = address(AaveV4EthereumSpokes.ETHENA_ECOSYSTEM_SPOKE);
spokes[4] = address(AaveV4EthereumSpokes.FOREX_SPOKE);
spokes[5] = address(AaveV4EthereumSpokes.GOLD_SPOKE);
spokes[6] = address(AaveV4EthereumSpokes.LOMBARD_BTC_SPOKE);
spokes[7] = address(AaveV4EthereumSpokes.MAIN_SPOKE);
spokes[8] = address(AaveV4EthereumSpokes.PAXG_GOLD_SPOKE);
spokes[9] = address(AaveV4EthereumSpokes.USDG_PENDLE_SPOKE);
spokes[10] = address(AaveV4EthereumSpokes.ETHERFI_ESPOKE);
spokes[11] = address(AaveV4EthereumSpokes.KELP_ESPOKE);
spokes[12] = address(AaveV4EthereumSpokes.LIDO_ESPOKE);
spokes[13] = address(AaveV4EthereumSpokes.USDG_MAPLE_ESPOKE);
spokes[14] = address(AaveV4EthereumTokenizationSpokes.CORE_WETH_TOKENIZATION_SPOKE);
spokes[15] = address(AaveV4EthereumTokenizationSpokes.CORE_wstETH_TOKENIZATION_SPOKE);
spokes[16] = address(AaveV4EthereumTokenizationSpokes.CORE_weETH_TOKENIZATION_SPOKE);
spokes[17] = address(AaveV4EthereumTokenizationSpokes.CORE_rsETH_TOKENIZATION_SPOKE);
spokes[18] = address(AaveV4EthereumTokenizationSpokes.CORE_USDT_TOKENIZATION_SPOKE);
spokes[19] = address(AaveV4EthereumTokenizationSpokes.CORE_USDC_TOKENIZATION_SPOKE);
spokes[20] = address(AaveV4EthereumTokenizationSpokes.CORE_GHO_TOKENIZATION_SPOKE);
spokes[21] = address(AaveV4EthereumTokenizationSpokes.CORE_RLUSD_TOKENIZATION_SPOKE);
spokes[22] = address(AaveV4EthereumTokenizationSpokes.CORE_USDG_TOKENIZATION_SPOKE);
spokes[23] = address(AaveV4EthereumTokenizationSpokes.CORE_frxUSD_TOKENIZATION_SPOKE);
spokes[24] = address(AaveV4EthereumTokenizationSpokes.CORE_EURC_TOKENIZATION_SPOKE);
spokes[25] = address(AaveV4EthereumTokenizationSpokes.CORE_WBTC_TOKENIZATION_SPOKE);
spokes[26] = address(AaveV4EthereumTokenizationSpokes.CORE_cbBTC_TOKENIZATION_SPOKE);
spokes[27] = address(AaveV4EthereumTokenizationSpokes.CORE_LBTC_TOKENIZATION_SPOKE);
spokes[28] = address(AaveV4EthereumTokenizationSpokes.CORE_XAUt_TOKENIZATION_SPOKE);
spokes[29] = address(AaveV4EthereumTokenizationSpokes.CORE_AAVE_TOKENIZATION_SPOKE);
spokes[30] = address(AaveV4EthereumTokenizationSpokes.CORE_LINK_TOKENIZATION_SPOKE);
spokes[31] = address(
AaveV4EthereumTokenizationSpokes.PLUS_PT_sUSDE_7MAY2026_TOKENIZATION_SPOKE
);
spokes[32] = address(AaveV4EthereumTokenizationSpokes.PLUS_PT_USDe_7MAY2026_TOKENIZATION_SPOKE);
spokes[33] = address(AaveV4EthereumTokenizationSpokes.PLUS_sUSDe_TOKENIZATION_SPOKE);
spokes[34] = address(AaveV4EthereumTokenizationSpokes.PLUS_USDe_TOKENIZATION_SPOKE);
spokes[35] = address(AaveV4EthereumTokenizationSpokes.PLUS_USDC_TOKENIZATION_SPOKE);
spokes[36] = address(AaveV4EthereumTokenizationSpokes.PLUS_GHO_TOKENIZATION_SPOKE);
spokes[37] = address(AaveV4EthereumTokenizationSpokes.PLUS_USDT_TOKENIZATION_SPOKE);
spokes[38] = address(AaveV4EthereumTokenizationSpokes.PRIME_WETH_TOKENIZATION_SPOKE);
spokes[39] = address(AaveV4EthereumTokenizationSpokes.PRIME_WBTC_TOKENIZATION_SPOKE);
spokes[40] = address(AaveV4EthereumTokenizationSpokes.PRIME_cbBTC_TOKENIZATION_SPOKE);
spokes[41] = address(AaveV4EthereumTokenizationSpokes.PRIME_wstETH_TOKENIZATION_SPOKE);
spokes[42] = address(AaveV4EthereumTokenizationSpokes.PRIME_USDC_TOKENIZATION_SPOKE);
spokes[43] = address(AaveV4EthereumTokenizationSpokes.PRIME_USDT_TOKENIZATION_SPOKE);
spokes[44] = address(AaveV4EthereumTokenizationSpokes.PRIME_GHO_TOKENIZATION_SPOKE);
spokes[45] = address(
AaveV4EthereumTokenizationSpokes.GLOBAL_DOLLAR_PT_USDG_24SEP2026_TOKENIZATION_SPOKE
);
spokes[46] = address(AaveV4EthereumTokenizationSpokes.GLOBAL_DOLLAR_USDC_TOKENIZATION_SPOKE);
spokes[47] = address(AaveV4EthereumTokenizationSpokes.GLOBAL_DOLLAR_USDT_TOKENIZATION_SPOKE);
spokes[48] = address(AaveV4EthereumTokenizationSpokes.GLOBAL_DOLLAR_USDG_TOKENIZATION_SPOKE);
spokes[49] = address(AaveV4EthereumTokenizationSpokes.GLOBAL_DOLLAR_PAXG_TOKENIZATION_SPOKE);
return spokes;
}
function getPositionManagers() internal pure returns (PositionManagers memory) {
return
PositionManagers({
giver: AaveV4EthereumPositionManagers.GIVER_POSITION_MANAGER,
taker: AaveV4EthereumPositionManagers.TAKER_POSITION_MANAGER,
config: AaveV4EthereumPositionManagers.CONFIG_POSITION_MANAGER,
nativeGateway: AaveV4EthereumPositionManagers.NATIVE_TOKEN_GATEWAY,
signatureGateway: AaveV4EthereumPositionManagers.SIGNATURE_GATEWAY
});
}
}
lib/aave-helpers/lib/aave-address-book/src/ChainlinkEthereum.sol
// AUTOGENERATED - MANUAL CHANGES WILL BE REVERTED BY THE GENERATOR
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;
library ChainlinkEthereum {
// https://etherscan.io/address/0x0C2e4Df738e99e8db80012f5bb2a303f3f48Ca74
address internal constant JTRSY_NAV = 0x0C2e4Df738e99e8db80012f5bb2a303f3f48Ca74;
// https://etherscan.io/address/0x75A0d3264a949C2C920d7F25Df174af1FaF73399
address internal constant FBTC_Proof_of_Reserves = 0x75A0d3264a949C2C920d7F25Df174af1FaF73399;
// https://etherscan.io/address/0x4ad7B025127e89263242aB68F0f9c4E5C033B489
address internal constant RAI__ETH = 0x4ad7B025127e89263242aB68F0f9c4E5C033B489;
// https://etherscan.io/address/0x0606Be69451B1C9861Ac6b3626b99093b713E801
address internal constant FIL__ETH = 0x0606Be69451B1C9861Ac6b3626b99093b713E801;
// https://etherscan.io/address/0x5ed77a9D9b7cc80E9d0D7711024AF38C2643C1c4
address internal constant VBILL_NAV_Aave_LlamaGuard = 0x5ed77a9D9b7cc80E9d0D7711024AF38C2643C1c4;
// https://etherscan.io/address/0xb177857a1799aA5F7fEb5799Fdf12CbE8fdF78B1
address internal constant USDf__USD = 0xb177857a1799aA5F7fEb5799Fdf12CbE8fdF78B1;
// https://etherscan.io/address/0xfAA9147190c2C2cc5B8387B4f49016bDB3380572
address internal constant FDUSD__USD = 0xfAA9147190c2C2cc5B8387B4f49016bDB3380572;
// https://etherscan.io/address/0x9d2F2f96B24C444ee32E57c04F7d944bcb8c8549
address internal constant rsETH__ETH_Exchange_Rate = 0x9d2F2f96B24C444ee32E57c04F7d944bcb8c8549;
// https://etherscan.io/address/0xD6aA3D25116d8dA79Ea0246c4826EB951872e02e
address internal constant UNI__ETH = 0xD6aA3D25116d8dA79Ea0246c4826EB951872e02e;
// https://etherscan.io/address/0xBfC7d98Eea35380ceEC0a1DC1702Ea186723602C
address internal constant USDD__USDC_Exchange_Rate = 0xBfC7d98Eea35380ceEC0a1DC1702Ea186723602C;
// https://etherscan.io/address/0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46
address internal constant USDT__ETH = 0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46;
// https://etherscan.io/address/0x636A000262F6aA9e1F094ABF0aD8f645C44f641C
address internal constant ezETH__ETH = 0x636A000262F6aA9e1F094ABF0aD8f645C44f641C;
// https://etherscan.io/address/0x7fb9B4a05e7B4F0c1Ac0B0046784cc0aCE8CbBC5
address internal constant Scroll_Healthcheck = 0x7fb9B4a05e7B4F0c1Ac0B0046784cc0aCE8CbBC5;
// https://etherscan.io/address/0xF4E1B57FB228879D057ac5AE33973e8C53e4A0e0
address internal constant CSPX__USD = 0xF4E1B57FB228879D057ac5AE33973e8C53e4A0e0;
// https://etherscan.io/address/0x5c9C449BbC9a6075A2c061dF312a35fd1E05fF22
address internal constant weETH__ETH = 0x5c9C449BbC9a6075A2c061dF312a35fd1E05fF22;
// https://etherscan.io/address/0x0d16d4528239e9ee52fa531af613AcdB23D88c94
address internal constant BAT__ETH = 0x0d16d4528239e9ee52fa531af613AcdB23D88c94;
// https://etherscan.io/address/0x7Eaa6f116Ab9E57f58d9A9Ce88cc3f1c2476ECfA
address internal constant stBTC_Proof_of_Reserves = 0x7Eaa6f116Ab9E57f58d9A9Ce88cc3f1c2476ECfA;
// https://etherscan.io/address/0x0981af0C002345c9C5AD5efd26242D0cBe5aCA99
address internal constant Synthetix_Aggregator_Debt_Ratio =
0x0981af0C002345c9C5AD5efd26242D0cBe5aCA99;
// https://etherscan.io/address/0x3E7d1eAB13ad0104d2750B8863b489D65364e32D
address internal constant USDT__USD = 0x3E7d1eAB13ad0104d2750B8863b489D65364e32D;
// https://etherscan.io/address/0x214eD9Da11D2fbe465a6fc601a91E62EbEc1a0D6
address internal constant XAU__USD = 0x214eD9Da11D2fbe465a6fc601a91E62EbEc1a0D6;
// https://etherscan.io/address/0xe572CeF69f43c2E488b33924AF04BDacE19079cf
address internal constant SUSHI__ETH = 0xe572CeF69f43c2E488b33924AF04BDacE19079cf;
// https://etherscan.io/address/0x5b79480BbF13930B777B2Cb9Ca8d664B7AA3aa6a
address internal constant CUSDO__USD = 0x5b79480BbF13930B777B2Cb9Ca8d664B7AA3aa6a;
// https://etherscan.io/address/0xf8fF43E991A81e6eC886a3D281A2C6cC19aE70Fc
address internal constant KNC__USD = 0xf8fF43E991A81e6eC886a3D281A2C6cC19aE70Fc;
// https://etherscan.io/address/0xBE456fd14720C3aCCc30A2013Bffd782c9Cb75D5
address internal constant TUSD_Reserves = 0xBE456fd14720C3aCCc30A2013Bffd782c9Cb75D5;
// https://etherscan.io/address/0x66Ab900341C98de949EC31d11b3C4180743844F1
address internal constant Calculated_ETHPlus__USD = 0x66Ab900341C98de949EC31d11b3C4180743844F1;
// https://etherscan.io/address/0x1e9cb00c0AC8d2a171f44E63bE7532AD7224F6D1
address internal constant Real_GDP_Percent_Change_Annual_Rate =
0x1e9cb00c0AC8d2a171f44E63bE7532AD7224F6D1;
// https://etherscan.io/address/0xFF3EEb22B5E3dE6e705b44749C2559d704923FD7
address internal constant AVAX__USD = 0xFF3EEb22B5E3dE6e705b44749C2559d704923FD7;
// https://etherscan.io/address/0xD41390267Afec3fA5b4c0B3aA6c706556CCE75ec
address internal constant C3M__EUR = 0xD41390267Afec3fA5b4c0B3aA6c706556CCE75ec;
// https://etherscan.io/address/0xF017fcB346A1885194689bA23Eff2fE6fA5C483b
address internal constant CBETH__ETH = 0xF017fcB346A1885194689bA23Eff2fE6fA5C483b;
// https://etherscan.io/address/0x9441D7556e7820B5ca42082cfa99487D56AcA958
address internal constant BAT__USD = 0x9441D7556e7820B5ca42082cfa99487D56AcA958;
// https://etherscan.io/address/0x1B39Ee86Ec5979ba5C322b826B3ECb8C79991699
address internal constant COMP__ETH = 0x1B39Ee86Ec5979ba5C322b826B3ECb8C79991699;
// https://etherscan.io/address/0x474Cfe8Ac0CF05986E69631DC144f81D10f72FC1
address internal constant SVR_SPYon_USD_Calculated = 0x474Cfe8Ac0CF05986E69631DC144f81D10f72FC1;
// https://etherscan.io/address/0xd16cC387E87d37350f57421DaDF811968441C1a5
address internal constant SVR_SPYon_USD_Calculated__BASE =
0xd16cC387E87d37350f57421DaDF811968441C1a5;
// https://etherscan.io/address/0x2F1494543bffb3022bf8Cb18C251D2286C98A85F
address internal constant PCE_Price_Index_Level = 0x2F1494543bffb3022bf8Cb18C251D2286C98A85F;
// https://etherscan.io/address/0xbCF5792575bA3A875D8C406F4E7270f51a902539
address internal constant Synthetix_Aggregator_Issued_Synths =
0xbCF5792575bA3A875D8C406F4E7270f51a902539;
// https://etherscan.io/address/0x59c2287c8E848310c809C061a1Be0d1556eFF4e2
address internal constant Optimism_Healthcheck = 0x59c2287c8E848310c809C061a1Be0d1556eFF4e2;
// https://etherscan.io/address/0x5a489EACad4BEc30B5bC3BcE8a0b9301CCDC0f60
address internal constant stGLD__tGLD_Exchange_Rate = 0x5a489EACad4BEc30B5bC3BcE8a0b9301CCDC0f60;
// https://etherscan.io/address/0xdbd020CAeF83eFd542f4De03e3cF0C28A4428bd5
address internal constant COMP__USD = 0xdbd020CAeF83eFd542f4De03e3cF0C28A4428bd5;
// https://etherscan.io/address/0x01435677FB11763550905594A16B645847C1d0F3
address internal constant KRW__USD = 0x01435677FB11763550905594A16B645847C1d0F3;
// https://etherscan.io/address/0xde49c7B5C0E54b1624ED21C7D88bA6593d444Aa0
address internal constant USTB_NAV_Aave_LlamaGuard = 0xde49c7B5C0E54b1624ED21C7D88bA6593d444Aa0;
// https://etherscan.io/address/0x986b5E1e1755e3C2440e960477f25201B0a8bbD4
address internal constant USDC__ETH = 0x986b5E1e1755e3C2440e960477f25201B0a8bbD4;
// https://etherscan.io/address/0xCfE54B5cD566aB89272946F602D76Ea879CAb4a8
address internal constant STETH__USD = 0xCfE54B5cD566aB89272946F602D76Ea879CAb4a8;
// https://etherscan.io/address/0x4720bcC6f940d709D7e2F510936e611Db07C240E
address internal constant GOOGL_USD_24__5 = 0x4720bcC6f940d709D7e2F510936e611Db07C240E;
// https://etherscan.io/address/0xdF2917806E30300537aEB49A7663062F4d1F2b5F
address internal constant BAL__USD = 0xdF2917806E30300537aEB49A7663062F4d1F2b5F;
// https://etherscan.io/address/0x72AFAECF99C9d9C8215fF44C77B94B99C28741e8
address internal constant _1INCH__ETH = 0x72AFAECF99C9d9C8215fF44C77B94B99C28741e8;
// https://etherscan.io/address/0x19e2d716288751c5A59deaB61af012D5DF895962
address internal constant USCC_NAV_Aave_LlamaGuard = 0x19e2d716288751c5A59deaB61af012D5DF895962;
// https://etherscan.io/address/0xF05D9B6C08757EAcb1fbec18e36A1B7566a13DEB
address internal constant Calculated_XSUSHI__ETH = 0xF05D9B6C08757EAcb1fbec18e36A1B7566a13DEB;
// https://etherscan.io/address/0x29d26C008e8f201eD0D864b1Fd9392D29d0C8e96
address internal constant MAVIA__USD = 0x29d26C008e8f201eD0D864b1Fd9392D29d0C8e96;
// https://etherscan.io/address/0x5608C6827031c91e729B81c1633a1511a231CCDb
address internal constant SVR_QQQon_USD_Calculated = 0x5608C6827031c91e729B81c1633a1511a231CCDb;
// https://etherscan.io/address/0x2098C245Fe4C80cdA93cF85Cff0718328D4eEa85
address internal constant SVR_QQQon_USD_Calculated__BASE =
0x2098C245Fe4C80cdA93cF85Cff0718328D4eEa85;
// https://etherscan.io/address/0xDC530D9457755926550b59e8ECcdaE7624181557
address internal constant LINK__ETH = 0xDC530D9457755926550b59e8ECcdaE7624181557;
// https://etherscan.io/address/0x1e4A7099B1aadb303378C496A256697dFE452F51
address internal constant DTA_Live_Simulation = 0x1e4A7099B1aadb303378C496A256697dFE452F51;
// https://etherscan.io/address/0x6Df09E975c830ECae5bd4eD9d90f3A95a4f88012
address internal constant AAVE__ETH = 0x6Df09E975c830ECae5bd4eD9d90f3A95a4f88012;
// https://etherscan.io/address/0x2Da4983a622a8498bb1a21FaE9D8F6C664939962
address internal constant ZRX__ETH = 0x2Da4983a622a8498bb1a21FaE9D8F6C664939962;
// https://etherscan.io/address/0x3D7aE7E594f2f2091Ad8798313450130d0Aba3a0
address internal constant LUSD__USD = 0x3D7aE7E594f2f2091Ad8798313450130d0Aba3a0;
// https://etherscan.io/address/0x7B2Fb2c667af80Bccc0B2556378352dFDE2be914
address internal constant tETH__wstETH_Exchange_Rate = 0x7B2Fb2c667af80Bccc0B2556378352dFDE2be914;
// https://etherscan.io/address/0x1c88503c9A52aE6aaE1f9bb99b3b7e9b8Ab35459
address internal constant TAO__USD = 0x1c88503c9A52aE6aaE1f9bb99b3b7e9b8Ab35459;
// https://etherscan.io/address/0x77F9710E7d0A19669A13c055F62cd80d313dF022
address internal constant AUD__USD = 0x77F9710E7d0A19669A13c055F62cd80d313dF022;
// https://etherscan.io/address/0x8f1dF6D7F2db73eECE86a18b4381F4707b918FB1
address internal constant PYUSD__USD = 0x8f1dF6D7F2db73eECE86a18b4381F4707b918FB1;
// https://etherscan.io/address/0x3F0543aA057BcAeA152Fe9462Cb3ffaB305a6F8D
address internal constant KAG_Reserves = 0x3F0543aA057BcAeA152Fe9462Cb3ffaB305a6F8D;
// https://etherscan.io/address/0xE8E65Fb9116875012F5990Ecaab290B3531DbeB9
address internal constant USYC_NAV_Aave_LlamaGuard = 0xE8E65Fb9116875012F5990Ecaab290B3531DbeB9;
// https://etherscan.io/address/0x2b94a8B3E478a2984A0b50a4bB0F19827Ad0cef3
address internal constant Real_GDP_Level = 0x2b94a8B3E478a2984A0b50a4bB0F19827Ad0cef3;
// https://etherscan.io/address/0xeb988B77b94C186053282BfcD8B7ED55142D3cAB
address internal constant XCN__USD = 0xeb988B77b94C186053282BfcD8B7ED55142D3cAB;
// https://etherscan.io/address/0x5c29868C58b6e15e2b962943278969Ab6a7D3212
address internal constant LBTC__BTC = 0x5c29868C58b6e15e2b962943278969Ab6a7D3212;
// https://etherscan.io/address/0x1E41Ef40AC148706c114534E8192Ca608f80fC48
address internal constant JAAA_NAV_Aave_LlamaGuard = 0x1E41Ef40AC148706c114534E8192Ca608f80fC48;
// https://etherscan.io/address/0xcBe87Dc0Cf9d807848a3E703B01A90B28eCFb2a7
address internal constant cbBTC_Reserves = 0xcBe87Dc0Cf9d807848a3E703B01A90B28eCFb2a7;
// https://etherscan.io/address/0x936B31C428C29713343E05D631e69304f5cF5f49
address internal constant solvBTC__BTC = 0x936B31C428C29713343E05D631e69304f5cF5f49;
// https://etherscan.io/address/0x88E588b2f3C2224fBd9441C49eeF61761a3449e0
address internal constant Mantle_Healthcheck = 0x88E588b2f3C2224fBd9441C49eeF61761a3449e0;
// https://etherscan.io/address/0x759bBC1be8F90eE6457C44abc7d443842a976d02
address internal constant RSR__USD = 0x759bBC1be8F90eE6457C44abc7d443842a976d02;
// https://etherscan.io/address/0xa20623070413d42a5C01Db2c8111640DD7A5A03a
address internal constant USTC__ETH = 0xa20623070413d42a5C01Db2c8111640DD7A5A03a;
// https://etherscan.io/address/0x69B50fF403E995d9c4441a303438D9049dAC8cCD
address internal constant SVR_COMP__USD = 0x69B50fF403E995d9c4441a303438D9049dAC8cCD;
// https://etherscan.io/address/0x203e994f3908cF886C6155c31742557D82c9B4a2
address internal constant SVR_COMP__USD_BASE = 0x203e994f3908cF886C6155c31742557D82c9B4a2;
// https://etherscan.io/address/0x1DE472E766E87eB993d0C7904367014a913E55ee
address internal constant WTGXX_NAV = 0x1DE472E766E87eB993d0C7904367014a913E55ee;
// https://etherscan.io/address/0xB204328559E17F84eE7A285036AA0d47124F85D5
address internal constant TSLA_USD_24__5 = 0xB204328559E17F84eE7A285036AA0d47124F85D5;
// https://etherscan.io/address/0x194a9AaF2e0b67c35915cD01101585A33Fe25CAa
address internal constant ALCX__ETH = 0x194a9AaF2e0b67c35915cD01101585A33Fe25CAa;
// https://etherscan.io/address/0x83B34662f65532e611A87EBed38063Dec889D5A7
address internal constant SVR_LINK__USD = 0x83B34662f65532e611A87EBed38063Dec889D5A7;
// https://etherscan.io/address/0xE5fa3A4e4208858ADdf2CDb4e12651E89f1f1A70
address internal constant SVR_LINK__USD_BASE = 0xE5fa3A4e4208858ADdf2CDb4e12651E89f1f1A70;
// https://etherscan.io/address/0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c
address internal constant BTC__USD = 0xF4030086522a5bEEa4988F8cA5B36dbC97BeE88c;
// https://etherscan.io/address/0xec21B3e882CE09928cb397DcfF31B15cBBD1e1C3
address internal constant SWETH__ETH = 0xec21B3e882CE09928cb397DcfF31B15cBBD1e1C3;
// https://etherscan.io/address/0x17D054eCac33D91F7340645341eFB5DE9009F1C1
address internal constant GRT__ETH = 0x17D054eCac33D91F7340645341eFB5DE9009F1C1;
// https://etherscan.io/address/0xe80baC615c38D01c101B0B1b943b05E20C8c2f76
address internal constant PumpBTC_Proof_of_Reserves = 0xe80baC615c38D01c101B0B1b943b05E20C8c2f76;
// https://etherscan.io/address/0xEC8761a0A73c34329CA5B1D3Dc7eD07F30e836e2
address internal constant Total_Marketcap__USD = 0xEC8761a0A73c34329CA5B1D3Dc7eD07F30e836e2;
// https://etherscan.io/address/0xA027702dbb89fbd58938e4324ac03B58d812b0E1
address internal constant YFI__USD = 0xA027702dbb89fbd58938e4324ac03B58d812b0E1;
// https://etherscan.io/address/0x70c158c7731Da2C14BC84aEBa39A4FF703DDc7d2
address internal constant Lombard_Proof_of_Reserves = 0x70c158c7731Da2C14BC84aEBa39A4FF703DDc7d2;
// https://etherscan.io/address/0x3425455fe737cdaE8564640df27bbF2eCD56E584
address internal constant Metis_Healthcheck = 0x3425455fe737cdaE8564640df27bbF2eCD56E584;
// https://etherscan.io/address/0x3886BA987236181D98F2401c507Fb8BeA7871dF2
address internal constant TUSD__ETH = 0x3886BA987236181D98F2401c507Fb8BeA7871dF2;
// https://etherscan.io/address/0x66704DAD467A7cA508B3be15865D9B9F3E186c90
address internal constant USDtb__USD = 0x66704DAD467A7cA508B3be15865D9B9F3E186c90;
// https://etherscan.io/address/0x5c7a079dbf188dAbc66e389482849b05ACB17421
address internal constant DOLO__USD = 0x5c7a079dbf188dAbc66e389482849b05ACB17421;
// https://etherscan.io/address/0x5c0Ab2d9b5a7ed9f470386e82BB36A3613cDd4b5
address internal constant GBP__USD = 0x5c0Ab2d9b5a7ed9f470386e82BB36A3613cDd4b5;
// https://etherscan.io/address/0x449d117117838fFA61263B61dA6301AA2a88B13A
address internal constant CHF__USD = 0x449d117117838fFA61263B61dA6301AA2a88B13A;
// https://etherscan.io/address/0xfF30586cD0F29eD462364C7e81375FC0C71219b1
address internal constant USDS__USD = 0xfF30586cD0F29eD462364C7e81375FC0C71219b1;
// https://etherscan.io/address/0xf2917e602C2dCa458937fad715bb1E465305A4A1
address internal constant EIGEN__USD = 0xf2917e602C2dCa458937fad715bb1E465305A4A1;
// https://etherscan.io/address/0xAfFd8F5578E8590665de561bdE9E7BAdb99300d9
address internal constant USCC_NAV_per_Share = 0xAfFd8F5578E8590665de561bdE9E7BAdb99300d9;
// https://etherscan.io/address/0xC8cd82067eA907EA4af81b625d2bB653E21b5156
address internal constant eETH_Proof_of_Reserves = 0xC8cd82067eA907EA4af81b625d2bB653E21b5156;
// https://etherscan.io/address/0xADcc914F882965Ef1B2f1043522b3B81ED081491
address internal constant BGBTC_Proof_of_Reserves = 0xADcc914F882965Ef1B2f1043522b3B81ED081491;
// https://etherscan.io/address/0x9a51192e065ECC6BDEafE5e194ce54702DE4f1f5
address internal constant Consumer_Price_Index = 0x9a51192e065ECC6BDEafE5e194ce54702DE4f1f5;
// https://etherscan.io/address/0x498b4e83001acc364b2a73f827e9aB4B034ea215
address internal constant Soneium_Healthcheck = 0x498b4e83001acc364b2a73f827e9aB4B034ea215;
// https://etherscan.io/address/0x2665701293fCbEB223D11A08D826563EDcCE423A
address internal constant cbBTC__USD = 0x2665701293fCbEB223D11A08D826563EDcCE423A;
// https://etherscan.io/address/0x461790bDAF5aeD3df6a88cB97Dec42DD0EFA73c0
address internal constant xSolvBTC_Proof_of_Reserves = 0x461790bDAF5aeD3df6a88cB97Dec42DD0EFA73c0;
// https://etherscan.io/address/0x171e3Ec9377FeBad8d26967f1B1d6383Ae037997
address internal constant SUSD1Plus_USD1_Exchange_Rate =
0x171e3Ec9377FeBad8d26967f1B1d6383Ae037997;
// https://etherscan.io/address/0xE33592594f72Cc7ec8a05788be8E8455746C3a32
address internal constant DOLA__USD = 0xE33592594f72Cc7ec8a05788be8E8455746C3a32;
// https://etherscan.io/address/0x9B4a96210bc8D9D55b1908B465D8B0de68B7fF83
address internal constant frxUSD__USD = 0x9B4a96210bc8D9D55b1908B465D8B0de68B7fF83;
// https://etherscan.io/address/0x24D9aB51950F3d62E9144fdC2f3135DAA6Ce8D1B
address internal constant ENJ__ETH = 0x24D9aB51950F3d62E9144fdC2f3135DAA6Ce8D1B;
// https://etherscan.io/address/0xee10fE5E7aa92dd7b136597449c3d5813cFC5F18
address internal constant SKY__USD = 0xee10fE5E7aa92dd7b136597449c3d5813cFC5F18;
// https://etherscan.io/address/0xF0d9bb015Cd7BfAb877B7156146dc09Bf461370d
address internal constant USD1__USD = 0xF0d9bb015Cd7BfAb877B7156146dc09Bf461370d;
// https://etherscan.io/address/0xa81FE04086865e63E12dD3776978E49DEEa2ea4e
address internal constant WBTC_Proof_of_Reserves = 0xa81FE04086865e63E12dD3776978E49DEEa2ea4e;
// https://etherscan.io/address/0xC7e9b623ed51F033b32AE7f1282b1AD62C28C183
address internal constant AAVE_SVR_LINK__USD = 0xC7e9b623ed51F033b32AE7f1282b1AD62C28C183;
// https://etherscan.io/address/0x76F8C9E423C228E83DCB11d17F0Bd8aEB0Ca01bb
address internal constant AAVE_SVR_LINK__USD_BASE = 0x76F8C9E423C228E83DCB11d17F0Bd8aEB0Ca01bb;
// https://etherscan.io/address/0xCc70F09A6CC17553b2E31954cD36E4A2d89501f7
address internal constant SUSHI__USD = 0xCc70F09A6CC17553b2E31954cD36E4A2d89501f7;
// https://etherscan.io/address/0x25efbA0d9b115D233cfA849F16BA743E8FFba2a1
address internal constant SPY_USD_24__5 = 0x25efbA0d9b115D233cfA849F16BA743E8FFba2a1;
// https://etherscan.io/address/0x9944D86CEB9160aF5C5feB251FD671923323f8C3
address internal constant PAXG__USD = 0x9944D86CEB9160aF5C5feB251FD671923323f8C3;
// https://etherscan.io/address/0xc929ad75B72593967DE83E7F7Cda0493458261D9
address internal constant _1INCH__USD = 0xc929ad75B72593967DE83E7F7Cda0493458261D9;
// https://etherscan.io/address/0x35E3f7E558C04cE7eEE1629258EcbbA03B36Ec56
address internal constant SAND__USD = 0x35E3f7E558C04cE7eEE1629258EcbbA03B36Ec56;
// https://etherscan.io/address/0x6029F53A5Df21E5e70C460F5E4c9Aad20427B090
address internal constant BUIDL_NAV = 0x6029F53A5Df21E5e70C460F5E4c9Aad20427B090;
// https://etherscan.io/address/0x3f929667bdf783b99274F10465a89d6aF772736E
address internal constant ZEC__USD = 0x3f929667bdf783b99274F10465a89d6aF772736E;
// https://etherscan.io/address/0x5C00128d4d1c2F4f652C267d7bcdD7aC99C16E16
address internal constant ENS__USD = 0x5C00128d4d1c2F4f652C267d7bcdD7aC99C16E16;
// https://etherscan.io/address/0x24551a8Fb2A7211A25a17B1481f043A8a8adC7f2
address internal constant MKR__ETH = 0x24551a8Fb2A7211A25a17B1481f043A8a8adC7f2;
// https://etherscan.io/address/0xB51dB716F1558Be00dE3DdAe4a94C9b605dEA526
address internal constant sUSDD__USDD_Exchange_Rate = 0xB51dB716F1558Be00dE3DdAe4a94C9b605dEA526;
// https://etherscan.io/address/0xA1D955b4E582C784583df7071B8a3Fb6d4bcaC42
address internal constant QQQ_USD_24__5 = 0xA1D955b4E582C784583df7071B8a3Fb6d4bcaC42;
// https://etherscan.io/address/0x03c68933f7a3F76875C0bc670a58e69294cDFD01
address internal constant RSETH__ETH = 0x03c68933f7a3F76875C0bc670a58e69294cDFD01;
// https://etherscan.io/address/0x91D32e6f01d6473b596f54c6E304e06d774f86b2
address internal constant SVR_BTC__USD = 0x91D32e6f01d6473b596f54c6E304e06d774f86b2;
// https://etherscan.io/address/0x8adE2c8d55F7ee2C9234ad868D44a60Eb9C07f8c
address internal constant SVR_BTC__USD_BASE = 0x8adE2c8d55F7ee2C9234ad868D44a60Eb9C07f8c;
// https://etherscan.io/address/0xAed0c38402a5d19df6E4c03F4E2DceD6e29c1ee9
address internal constant DAI__USD = 0xAed0c38402a5d19df6E4c03F4E2DceD6e29c1ee9;
// https://etherscan.io/address/0x656c0544eF4C98A6a98491833A89204Abb045d6b
address internal constant KNC__ETH = 0x656c0544eF4C98A6a98491833A89204Abb045d6b;
// https://etherscan.io/address/0x2c47b8CD75C818969b398911b70C633e280552d4
address internal constant NVDA_USD_24__5 = 0x2c47b8CD75C818969b398911b70C633e280552d4;
// https://etherscan.io/address/0x023dfc789db466DD5C900DC04706727a3A9Cf3DE
address internal constant SVR_USDT__USD = 0x023dfc789db466DD5C900DC04706727a3A9Cf3DE;
// https://etherscan.io/address/0xe108E75d6bA28F14EA51F24F886c0B6BBeca575a
address internal constant SVR_USDT__USD_BASE = 0xe108E75d6bA28F14EA51F24F886c0B6BBeca575a;
// https://etherscan.io/address/0x34ad75691e25A8E9b681AAA85dbeB7ef6561B42c
address internal constant USR__USD = 0x34ad75691e25A8E9b681AAA85dbeB7ef6561B42c;
// https://etherscan.io/address/0x2D27d9e1b74936D8E83c4BA118F09A4c4a897f62
address internal constant SXT__USD = 0x2D27d9e1b74936D8E83c4BA118F09A4c4a897f62;
// https://etherscan.io/address/0x9656D3A00402bD9c18EeF89b29ca6810734ABCAd
address internal constant Ink_Healthcheck = 0x9656D3A00402bD9c18EeF89b29ca6810734ABCAd;
// https://etherscan.io/address/0x014f606c37Cfd6Fc42Ec11D10086DF500125e0A5
address internal constant USDD__USDT_Exchange_Rate = 0x014f606c37Cfd6Fc42Ec11D10086DF500125e0A5;
// https://etherscan.io/address/0x833D8Eb16D306ed1FbB5D7A2E019e106B960965A
address internal constant BUSD__USD = 0x833D8Eb16D306ed1FbB5D7A2E019e106B960965A;
// https://etherscan.io/address/0xAc559F25B1619171CbC396a50854A3240b6A4e99
address internal constant ETH__BTC = 0xAc559F25B1619171CbC396a50854A3240b6A4e99;
// https://etherscan.io/address/0x5424384B256154046E9667dDFaaa5e550145215e
address internal constant AAVE_SVR_ETH__USD = 0x5424384B256154046E9667dDFaaa5e550145215e;
// https://etherscan.io/address/0x5147eA642CAEF7BD9c1265AadcA78f997AbB9649
address internal constant AAVE_SVR_ETH__USD_BASE = 0x5147eA642CAEF7BD9c1265AadcA78f997AbB9649;
// https://etherscan.io/address/0x37be050e75C7F0a80F0E8abBFC2c4Ff826728cAa
address internal constant SVR_USDC__USD = 0x37be050e75C7F0a80F0E8abBFC2c4Ff826728cAa;
// https://etherscan.io/address/0x84E045745ED829c5b778aBB17104FC2600020850
address internal constant SVR_USDC__USD_BASE = 0x84E045745ED829c5b778aBB17104FC2600020850;
// https://etherscan.io/address/0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419
address internal constant ETH__USD = 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419;
// https://etherscan.io/address/0x26C46B7aD0012cA71F2298ada567dC9Af14E7f2A
address internal constant RLUSD__USD = 0x26C46B7aD0012cA71F2298ada567dC9Af14E7f2A;
// https://etherscan.io/address/0xe471bc940AA9831a0AeA21E6F40C1A1236EB4BB3
address internal constant sUSDf__USDf_Exchange_Rate = 0xe471bc940AA9831a0AeA21E6F40C1A1236EB4BB3;
// https://etherscan.io/address/0x2a638b1203a3B62FF003598B7165Fc5cd5b13B00
address internal constant SWELL__ETH = 0x2a638b1203a3B62FF003598B7165Fc5cd5b13B00;
// https://etherscan.io/address/0xeD9960f685C3c4d6aa937E56169a41C19D0aC9c6
address internal constant sUSDe__USD_Calculated = 0xeD9960f685C3c4d6aa937E56169a41C19D0aC9c6;
// https://etherscan.io/address/0xE858728eB31a25C4AcCcE17d01B68dCFC3A0ED2C
address internal constant LsETH__ETH_Exchange_Rate = 0xE858728eB31a25C4AcCcE17d01B68dCFC3A0ED2C;
// https://etherscan.io/address/0x43921Ca0eca1EA69722c048A6afbc2CAd0BB80e9
address internal constant _21BTC_Proof_of_Reserves = 0x43921Ca0eca1EA69722c048A6afbc2CAd0BB80e9;
// https://etherscan.io/address/0xc04611C43842220fd941515F86d1DDdB15F04e46
address internal constant SHV__USD = 0xc04611C43842220fd941515F86d1DDdB15F04e46;
// https://etherscan.io/address/0x4e25cfdc5f53c2CdeD13c1472E628eFd35c99C83
address internal constant SOLVBTC__BTC_Exchange_Rate = 0x4e25cfdc5f53c2CdeD13c1472E628eFd35c99C83;
// https://etherscan.io/address/0xeF8A4aF35cd47424672E3C590aBD37FBB7A7759a
address internal constant CNY__USD = 0xeF8A4aF35cd47424672E3C590aBD37FBB7A7759a;
// https://etherscan.io/address/0xC1438AA3823A6Ba0C159CfA8D98dF5A994bA120b
address internal constant BAL__ETH = 0xC1438AA3823A6Ba0C159CfA8D98dF5A994bA120b;
// https://etherscan.io/address/0x79291A9d692Df95334B1a0B3B4AE6bC606782f8c
address internal constant SNX__ETH = 0x79291A9d692Df95334B1a0B3B4AE6bC606782f8c;
// https://etherscan.io/address/0x773616E4d11A78F511299002da57A0a94577F1f4
address internal constant DAI__ETH = 0x773616E4d11A78F511299002da57A0a94577F1f4;
// https://etherscan.io/address/0xA5265f5B54D0AdD0D48BE88BC3CB0Cdb1a54B816
address internal constant Real_Final_Sales_to_Private_Domestic_Purchasers_Level =
0xA5265f5B54D0AdD0D48BE88BC3CB0Cdb1a54B816;
// https://etherscan.io/address/0xD10aBbC76679a20055E167BB80A24ac851b37056
address internal constant APE__USD = 0xD10aBbC76679a20055E167BB80A24ac851b37056;
// https://etherscan.io/address/0x0b9bD3eAac381A1a6731ff6598a50638E5CFFD25
address internal constant CRDYX_NAV = 0x0b9bD3eAac381A1a6731ff6598a50638E5CFFD25;
// https://etherscan.io/address/0xB9E1E3A9feFf48998E45Fa90847ed4D467E8BcfD
address internal constant FRAX__USD = 0xB9E1E3A9feFf48998E45Fa90847ed4D467E8BcfD;
// https://etherscan.io/address/0xAd410E655C0fE4741F573152592eeb766e686CE7
address internal constant stETH_Proof_of_Reserves = 0xAd410E655C0fE4741F573152592eeb766e686CE7;
// https://etherscan.io/address/0x5C8D8AaB4ffa4652753Df94f299330Bb4479bF85
address internal constant HIGH__USD = 0x5C8D8AaB4ffa4652753Df94f299330Bb4479bF85;
// https://etherscan.io/address/0x7c5d4F8345e66f68099581Db340cd65B078C41f4
address internal constant YFI__ETH = 0x7c5d4F8345e66f68099581Db340cd65B078C41f4;
// https://etherscan.io/address/0x82A44D92D6c329826dc557c5E1Be6ebeC5D5FeB9
address internal constant MANA__ETH = 0x82A44D92D6c329826dc557c5E1Be6ebeC5D5FeB9;
// https://etherscan.io/address/0x393CC05baD439c9B36489384F11487d9C8410471
address internal constant RDNT__USD = 0x393CC05baD439c9B36489384F11487d9C8410471;
// https://etherscan.io/address/0x7e891DEbD8FA0A4Cf6BE58Ddff5a8ca174FebDCB
address internal constant USD0__USD = 0x7e891DEbD8FA0A4Cf6BE58Ddff5a8ca174FebDCB;
// https://etherscan.io/address/0x6CE4Ef3689F26edD40ed3ccbE3Cc29dab62C915f
address internal constant PumpBTC__BTC_Exchange_Rate = 0x6CE4Ef3689F26edD40ed3ccbE3Cc29dab62C915f;
// https://etherscan.io/address/0x4E155eD98aFE9034b7A5962f6C84c86d869daA9d
address internal constant RPL__USD = 0x4E155eD98aFE9034b7A5962f6C84c86d869daA9d;
// https://etherscan.io/address/0x5d8017CDC949AA0a6c00999B970892456d4f5fF3
address internal constant Unichain_Healthcheck = 0x5d8017CDC949AA0a6c00999B970892456d4f5fF3;
// https://etherscan.io/address/0x1f34794A16D644b9810477EbF3f0b3870141E2e3
address internal constant SolvBTCBBN__SolvBTC_Exchange_Rate =
0x1f34794A16D644b9810477EbF3f0b3870141E2e3;
// https://etherscan.io/address/0x86cF33a451dE9dc61a2862FD94FF4ad4Bd65A5d2
address internal constant GRT__USD = 0x86cF33a451dE9dc61a2862FD94FF4ad4Bd65A5d2;
// https://etherscan.io/address/0xED4E679adAFA9aBC97a3fA797dEE000d7b0ed247
address internal constant SVR_TSLAon__USD_Ondo_API = 0xED4E679adAFA9aBC97a3fA797dEE000d7b0ed247;
// https://etherscan.io/address/0x737401E0D1299D8A85b653Fd52823501f4FE0be0
address internal constant SVR_TSLAon__USD_Ondo_API__BASE =
0x737401E0D1299D8A85b653Fd52823501f4FE0be0;
// https://etherscan.io/address/0x393899FeF73E3C08100BF9b8a78bA84769Fa5B96
address internal constant SVR_CRCLon__USD_Ondo_API = 0x393899FeF73E3C08100BF9b8a78bA84769Fa5B96;
// https://etherscan.io/address/0xC0457F67cac4eb0567A208955C332897a597A207
address internal constant SVR_CRCLon__USD_Ondo_API__BASE =
0xC0457F67cac4eb0567A208955C332897a597A207;
// https://etherscan.io/address/0xb49f677943BC038e9857d61E7d053CaA2C1734C1
address internal constant EUR__USD = 0xb49f677943BC038e9857d61E7d053CaA2C1734C1;
// https://etherscan.io/address/0x987517b50230De2042750570D8fE3783ee115975
address internal constant ZKsync_Healthcheck = 0x987517b50230De2042750570D8fE3783ee115975;
// https://etherscan.io/address/0x2c1d072e956AFFC0D435Cb7AC38EF18d24d9127c
address internal constant LINK__USD = 0x2c1d072e956AFFC0D435Cb7AC38EF18d24d9127c;
// https://etherscan.io/address/0xDaeA8386611A157B08829ED4997A8A62B557014C
address internal constant MLN__ETH = 0xDaeA8386611A157B08829ED4997A8A62B557014C;
// https://etherscan.io/address/0x8e0b7e6062272B5eF4524250bFFF8e5Bd3497757
address internal constant SUSD__ETH = 0x8e0b7e6062272B5eF4524250bFFF8e5Bd3497757;
// https://etherscan.io/address/0x703118C4CbccCBF2AB31913e0f8075fbbb15f563
address internal constant OETH__ETH = 0x703118C4CbccCBF2AB31913e0f8075fbbb15f563;
// https://etherscan.io/address/0x8c110B94C5f1d347fAcF5E1E938AB2db60E3c9a8
address internal constant SPELL__USD = 0x8c110B94C5f1d347fAcF5E1E938AB2db60E3c9a8;
// https://etherscan.io/address/0xB06A26DF4Ab5853AaCCF2d21FAa00B82362684C3
address
internal constant Real_Final_Sales_to_Private_Domestic_Purchasers_Percent_Change_Annual_Rate =
0xB06A26DF4Ab5853AaCCF2d21FAa00B82362684C3;
// https://etherscan.io/address/0xC557dcbc32A01a4FBf7b9E3107BAF283f059EDc7
address internal constant SVR_TSLAon_USD_Calculated = 0xC557dcbc32A01a4FBf7b9E3107BAF283f059EDc7;
// https://etherscan.io/address/0x89904B6fcF8dAD1e5DA47dFdF69fC38Ad6be0bd5
address internal constant SVR_TSLAon_USD_Calculated__BASE =
0x89904B6fcF8dAD1e5DA47dFdF69fC38Ad6be0bd5;
// https://etherscan.io/address/0xaB5Dd7DD7669072a1Ef27c0ba241120A27A1aeC3
address internal constant KAU_Reserves = 0xaB5Dd7DD7669072a1Ef27c0ba241120A27A1aeC3;
// https://etherscan.io/address/0x3C7dB4D25deAb7c89660512C5494Dc9A3FC40f78
address internal constant PHP__USD = 0x3C7dB4D25deAb7c89660512C5494Dc9A3FC40f78;
// https://etherscan.io/address/0xc9c10271B2B76767C385Ac389C05d77c319DC41C
address internal constant SVR_SPYon__USD_Ondo_API = 0xc9c10271B2B76767C385Ac389C05d77c319DC41C;
// https://etherscan.io/address/0x6EcC1b902dB35eAFE95332443802774Fd1D72576
address internal constant SVR_SPYon__USD_Ondo_API__BASE =
0x6EcC1b902dB35eAFE95332443802774Fd1D72576;
// https://etherscan.io/address/0x62c2ab773B7324ad9e030D777989B3b5d5c54c0A
address internal constant AAVE_SVR_USDT__USD = 0x62c2ab773B7324ad9e030D777989B3b5d5c54c0A;
// https://etherscan.io/address/0x7bB7bF4ca536DbC49545704BFAcaa13633D18718
address internal constant AAVE_SVR_USDT__USD_BASE = 0x7bB7bF4ca536DbC49545704BFAcaa13633D18718;
// https://etherscan.io/address/0xBcE206caE7f0ec07b545EddE332A47C2F75bbeb3
address internal constant JPY__USD = 0xBcE206caE7f0ec07b545EddE332A47C2F75bbeb3;
// https://etherscan.io/address/0x66C0dB1A21047f0c156d2F39b33B1A47E9fE4583
address internal constant CASHPlus_NAV = 0x66C0dB1A21047f0c156d2F39b33B1A47E9fE4583;
// https://etherscan.io/address/0x7f0347903F413a6C4c540f39145E2a2249639931
address internal constant TRUMP__USD = 0x7f0347903F413a6C4c540f39145E2a2249639931;
// https://etherscan.io/address/0xC9CbF687f43176B302F03f5e58470b77D07c61c6
address internal constant CVX__ETH = 0xC9CbF687f43176B302F03f5e58470b77D07c61c6;
// https://etherscan.io/address/0xfdFD9C85aD200c506Cf9e21F1FD8dd01932FBB23
address internal constant WBTC__BTC = 0xfdFD9C85aD200c506Cf9e21F1FD8dd01932FBB23;
// https://etherscan.io/address/0x04F84020Fdf10d9ee64D1dcC2986EDF2F556DA11
address internal constant EURC__USD = 0x04F84020Fdf10d9ee64D1dcC2986EDF2F556DA11;
// https://etherscan.io/address/0x14e613AC84a31f709eadbdF89C6CC390fDc9540A
address internal constant BNB__USD = 0x14e613AC84a31f709eadbdF89C6CC390fDc9540A;
// https://etherscan.io/address/0x32EaFC72772821936BCc9b8A32dC394fEFcDBfD9
address internal constant Arbitrum_Healthcheck = 0x32EaFC72772821936BCc9b8A32dC394fEFcDBfD9;
// https://etherscan.io/address/0xD93571A6201978976e37c4A0F7bE17806f2Feab2
address internal constant stBTC__BTC_Exchange_Rate = 0xD93571A6201978976e37c4A0F7bE17806f2Feab2;
// https://etherscan.io/address/0x379589227b15F1a12195D3f2d90bBc9F31f95235
address internal constant XAG__USD = 0x379589227b15F1a12195D3f2d90bBc9F31f95235;
// https://etherscan.io/address/0x48D9DA600EC48DDd6ce7FC1D47D683818e511c81
address internal constant Base_Healthcheck = 0x48D9DA600EC48DDd6ce7FC1D47D683818e511c81;
// https://etherscan.io/address/0xB09fC5fD3f11Cf9eb5E1C5Dba43114e3C9f477b5
address internal constant TRY__USD = 0xB09fC5fD3f11Cf9eb5E1C5Dba43114e3C9f477b5;
// https://etherscan.io/address/0xb325F0730472204Ef9813cBdaf9D9e97A4a7b5F1
address internal constant savBTC__avBTC_Exchange_Rate =
0xb325F0730472204Ef9813cBdaf9D9e97A4a7b5F1;
// https://etherscan.io/address/0x35DDfB90011E686CCf837a6819562705076207EB
address internal constant ACRED_NAV = 0x35DDfB90011E686CCf837a6819562705076207EB;
// https://etherscan.io/address/0x91b99C9b75aF469a71eE1AB528e8da994A5D7030
address internal constant IDR__USD = 0x91b99C9b75aF469a71eE1AB528e8da994A5D7030;
// https://etherscan.io/address/0x477e363c51Ab0C4D13B22CD6B57D56d4a3Cb7Abe
address internal constant USTBL_NAV = 0x477e363c51Ab0C4D13B22CD6B57D56d4a3Cb7Abe;
// https://etherscan.io/address/0x7bAC85A8a13A4BcD8abb3eB7d6b4d632c5a57676
address internal constant MATIC__USD = 0x7bAC85A8a13A4BcD8abb3eB7d6b4d632c5a57676;
// https://etherscan.io/address/0xd962fC30A72A84cE50161031391756Bf2876Af5D
address internal constant CVX__USD = 0xd962fC30A72A84cE50161031391756Bf2876Af5D;
// https://etherscan.io/address/0x9fBb7D07ae32B3F75c2a5805C2153243A2532589
address internal constant SAVUSD__AVUSD_Exchange_Rate =
0x9fBb7D07ae32B3F75c2a5805C2153243A2532589;
// https://etherscan.io/address/0xC5f8c4aB091Be1A899214c0C3636ca33DcA0C547
address internal constant ETHx__ETH = 0xC5f8c4aB091Be1A899214c0C3636ca33DcA0C547;
// https://etherscan.io/address/0x86392dC19c0b719886221c78AB11eb8Cf5c52812
address internal constant STETH__ETH = 0x86392dC19c0b719886221c78AB11eb8Cf5c52812;
// https://etherscan.io/address/0xB00341502DfEA6Ced8A5786b4059d29dA5E4D1FD
address internal constant AUSD__USD = 0xB00341502DfEA6Ced8A5786b4059d29dA5E4D1FD;
// https://etherscan.io/address/0x60AEd7d20AC6328f7BA771aD58931c996aff30E8
address internal constant ACRED_NAV_Aave_LlamaGuard = 0x60AEd7d20AC6328f7BA771aD58931c996aff30E8;
// https://etherscan.io/address/0xa34317DB73e77d453b1B8d04550c44D10e981C8e
address internal constant CAD__USD = 0xa34317DB73e77d453b1B8d04550c44D10e981C8e;
// https://etherscan.io/address/0xd92095BAf79a6ca6533019e952aDe0d3C5834f4b
address internal constant VBILL_NAV = 0xd92095BAf79a6ca6533019e952aDe0d3C5834f4b;
// https://etherscan.io/address/0xda9258AFc797Cd64d1b6FC651051224cdAB1B25E
address internal constant SolvBTC_Proof_of_Reserves = 0xda9258AFc797Cd64d1b6FC651051224cdAB1B25E;
// https://etherscan.io/address/0x164b276057258d81941e97B0a900D4C7B358bCe0
address internal constant wstETH__USD_Calculated = 0x164b276057258d81941e97B0a900D4C7B358bCe0;
// https://etherscan.io/address/0x14f0737d6b705259e521EA6E9E3506AC78dBd311
address internal constant USDG__USD = 0x14f0737d6b705259e521EA6E9E3506AC78dBd311;
// https://etherscan.io/address/0x8350b7De6a6a2C1368E7D4Bd968190e13E354297
address internal constant TBTC__USD = 0x8350b7De6a6a2C1368E7D4Bd968190e13E354297;
// https://etherscan.io/address/0x83BefF09647663136A00cF2C30Ed948FeaffA2a6
address internal constant M_Reserves = 0x83BefF09647663136A00cF2C30Ed948FeaffA2a6;
// https://etherscan.io/address/0x60cbE8D88EF519cF3C62414D76f50818D211fea1
address internal constant Swell_ETH_Proof_of_Reserves =
0x60cbE8D88EF519cF3C62414D76f50818D211fea1;
// https://etherscan.io/address/0x32d1463EB53b73C095625719Afa544D5426354cB
address internal constant IB01__USD = 0x32d1463EB53b73C095625719Afa544D5426354cB;
// https://etherscan.io/address/0x861d15F8a4059cb918bD6F3670adAEB1220B298f
address internal constant uniBTC__BTC_Exchange_Rate = 0x861d15F8a4059cb918bD6F3670adAEB1220B298f;
// https://etherscan.io/address/0xCc72039A141c6e34a779eF93AEF5eB4C82A893c7
address internal constant Nexus_wETH_Reserves = 0xCc72039A141c6e34a779eF93AEF5eB4C82A893c7;
// https://etherscan.io/address/0xe5346a4Fd329768A99455d969724768a00CA63FB
address internal constant FBTC__BTC_Exchange_Rate = 0xe5346a4Fd329768A99455d969724768a00CA63FB;
// https://etherscan.io/address/0xC28198Df9aee1c4990994B35ff51eFA4C769e534
address internal constant M_NAV = 0xC28198Df9aee1c4990994B35ff51eFA4C769e534;
// https://etherscan.io/address/0xc90E3460424fb8ea79775089E9053113FEE34Ed0
address internal constant MUSD__USD = 0xc90E3460424fb8ea79775089E9053113FEE34Ed0;
// https://etherscan.io/address/0x9a72298ae3886221820B1c878d12D872087D3a23
address internal constant OHMv2__ETH = 0x9a72298ae3886221820B1c878d12D872087D3a23;
// https://etherscan.io/address/0x7Fa89217C9bA5eb1307Aca6B84E99ed9220e076F
address internal constant Celo_Healthcheck = 0x7Fa89217C9bA5eb1307Aca6B84E99ed9220e076F;
// https://etherscan.io/address/0x64c4c1BF5ec145CB6095A289249592B5bb007098
address internal constant PCE_Price_Index_Percent_Change_Annual_Rate =
0x64c4c1BF5ec145CB6095A289249592B5bb007098;
// https://etherscan.io/address/0xFC9e30Cf89f8A00dba3D34edf8b65BCDAdeCC1cB
address internal constant USD0PlusPlus__USD = 0xFC9e30Cf89f8A00dba3D34edf8b65BCDAdeCC1cB;
// https://etherscan.io/address/0x7A9f34a0Aa917D438e9b6E630067062B7F8f6f3d
address internal constant STG__USD = 0x7A9f34a0Aa917D438e9b6E630067062B7F8f6f3d;
// https://etherscan.io/address/0x3147D7203354Dc06D9fd350c7a2437bcA92387a4
address internal constant REN__ETH = 0x3147D7203354Dc06D9fd350c7a2437bcA92387a4;
// https://etherscan.io/address/0xd27e6D02b72eB6FCe04Ad5690C419196B4EF2885
address internal constant IBTA__USD = 0xd27e6D02b72eB6FCe04Ad5690C419196B4EF2885;
// https://etherscan.io/address/0x3BbccB2301759D2e4A5692bA72DAb4b75dC43B1a
address internal constant JAAA_NAV = 0x3BbccB2301759D2e4A5692bA72DAb4b75dC43B1a;
// https://etherscan.io/address/0x0c89c488e763AC2d69cB058CCAC7A8B283EE3DbA
address internal constant Swell_Restaked_ETH_Proof_of_Reserves =
0x0c89c488e763AC2d69cB058CCAC7A8B283EE3DbA;
// https://etherscan.io/address/0x169E633A2D1E6c10dD91238Ba11c4A708dfEF37C
address internal constant Fast_Gas__Gwei = 0x169E633A2D1E6c10dD91238Ba11c4A708dfEF37C;
// https://etherscan.io/address/0x4ffC43a60e009B551865A93d232E33Fce9f01507
address internal constant SOL__USD = 0x4ffC43a60e009B551865A93d232E33Fce9f01507;
// https://etherscan.io/address/0xAFa801e508613be7CA88D2d0fDB3F84f4c1B0384
address internal constant C1USD_Reserves = 0xAFa801e508613be7CA88D2d0fDB3F84f4c1B0384;
// https://etherscan.io/address/0xc0053f3FBcCD593758258334Dfce24C2A9A673aD
address internal constant SVR_ETH__USD = 0xc0053f3FBcCD593758258334Dfce24C2A9A673aD;
// https://etherscan.io/address/0xd82562bb17557231Cd871e1B2525F3AB8d63D409
address internal constant SVR_ETH__USD_BASE = 0xd82562bb17557231Cd871e1B2525F3AB8d63D409;
// https://etherscan.io/address/0xdeb288F737066589598e9214E782fa5A8eD689e8
address internal constant BTC__ETH = 0xdeb288F737066589598e9214E782fa5A8eD689e8;
// https://etherscan.io/address/0x8a12Be339B0cD1829b91Adc01977caa5E9ac121e
address internal constant CRV__ETH = 0x8a12Be339B0cD1829b91Adc01977caa5E9ac121e;
// https://etherscan.io/address/0x0A8cD0115B1EE87EbA5b8E06A9a15ED93e230f7a
address internal constant HBTC_Proof_of_Reserves = 0x0A8cD0115B1EE87EbA5b8E06A9a15ED93e230f7a;
// https://etherscan.io/address/0x09023c0DA49Aaf8fc3fA3ADF34C6A7016D38D5e3
address internal constant USDP__USD = 0x09023c0DA49Aaf8fc3fA3ADF34C6A7016D38D5e3;
// https://etherscan.io/address/0xc590D9fb8eE78a0909dFF341ccf717000b7b7fF2
address internal constant uniBTC_Proof_of_Reserves = 0xc590D9fb8eE78a0909dFF341ccf717000b7b7fF2;
// https://etherscan.io/address/0x3977CFc9e4f29C184D4675f4EB8e0013236e5f3e
address internal constant NZD__USD = 0x3977CFc9e4f29C184D4675f4EB8e0013236e5f3e;
// https://etherscan.io/address/0xa7d76167900493Acf2650Dc001fb2Bc5256579B0
address internal constant CETH_Reserves = 0xa7d76167900493Acf2650Dc001fb2Bc5256579B0;
// https://etherscan.io/address/0x6Ebc52C8C1089be9eB3945C4350B68B8E4C2233f
address internal constant FXS__USD = 0x6Ebc52C8C1089be9eB3945C4350B68B8E4C2233f;
// https://etherscan.io/address/0xBAEbEFc1D023c0feCcc047Bff42E75F15Ff213E6
address internal constant IMX__USD = 0xBAEbEFc1D023c0feCcc047Bff42E75F15Ff213E6;
// https://etherscan.io/address/0xDC3EA94CD0AC27d9A86C180091e7f78C683d3699
address internal constant SNX__USD = 0xDC3EA94CD0AC27d9A86C180091e7f78C683d3699;
// https://etherscan.io/address/0x536218f9E9Eb48863970252233c8F271f554C2d0
address internal constant RETH__ETH = 0x536218f9E9Eb48863970252233c8F271f554C2d0;
// https://etherscan.io/address/0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6
address internal constant USDC__USD = 0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6;
// https://etherscan.io/address/0xc7de7f4d4C9c991fF62a07D18b3E31e349833A18
address internal constant APE__ETH = 0xc7de7f4d4C9c991fF62a07D18b3E31e349833A18;
// https://etherscan.io/address/0xa569d910839Ae8865Da8F8e70FfFb0cBA869F961
address internal constant USDe__USD = 0xa569d910839Ae8865Da8F8e70FfFb0cBA869F961;
// https://etherscan.io/address/0x492575FDD11a0fCf2C6C719867890a7648d526eB
address internal constant AMPL__ETH = 0x492575FDD11a0fCf2C6C719867890a7648d526eB;
// https://etherscan.io/address/0x8dD1CD88F43aF196ae478e91b9F5E4Ac69A97C61
address internal constant SHIB__ETH = 0x8dD1CD88F43aF196ae478e91b9F5E4Ac69A97C61;
// https://etherscan.io/address/0xF02C1e2A3B77c1cacC72f72B44f7d0a4c62e4a85
address internal constant AAVE_SVR_AAVE__USD = 0xF02C1e2A3B77c1cacC72f72B44f7d0a4c62e4a85;
// https://etherscan.io/address/0xbd7F896e60B650C01caf2d7279a1148189A68884
address internal constant AAVE_SVR_AAVE__USD_BASE = 0xbd7F896e60B650C01caf2d7279a1148189A68884;
// https://etherscan.io/address/0x16caE6d6ffb4AE01e206b928de925Ac0C8C8116A
address internal constant cUSD_AUM = 0x16caE6d6ffb4AE01e206b928de925Ac0C8C8116A;
// https://etherscan.io/address/0x269f871c80b50a5cF34cDfCfEC11460adA4D66f1
address internal constant goUSD_Reserves = 0x269f871c80b50a5cF34cDfCfEC11460adA4D66f1;
// https://etherscan.io/address/0x23adce82907D20c509101E2Af0723A9e16224EFb
address internal constant JTRSY_NAV_Aave_LlamaGuard = 0x23adce82907D20c509101E2Af0723A9e16224EFb;
// https://etherscan.io/address/0xBc8f5e8B47D69fa10A4B64eC5B45b466f81B77CA
address internal constant Secured_Overnight_Financing_Rate =
0xBc8f5e8B47D69fa10A4B64eC5B45b466f81B77CA;
// https://etherscan.io/address/0x289B5036cd942e619E1Ee48670F98d214E745AAC
address internal constant USTB_NAV_per_Share = 0x289B5036cd942e619E1Ee48670F98d214E745AAC;
// https://etherscan.io/address/0x547a514d5e3769680Ce22B2361c10Ea13619e8a9
address internal constant AAVE__USD = 0x547a514d5e3769680Ce22B2361c10Ea13619e8a9;
// https://etherscan.io/address/0xCd627aA160A6fA45Eb793D19Ef54f5062F20f33f
address internal constant CRV__USD = 0xCd627aA160A6fA45Eb793D19Ef54f5062F20f33f;
// https://etherscan.io/address/0x553303d460EE0afB37EdFf9bE42922D8FF63220e
address internal constant UNI__USD = 0x553303d460EE0afB37EdFf9bE42922D8FF63220e;
// https://etherscan.io/address/0xfD628af590c4150A9651C1f4ddD0b4f532B703ae
address internal constant EUTBL_NAV = 0xfD628af590c4150A9651C1f4ddD0b4f532B703ae;
// https://etherscan.io/address/0xb41E773f507F7a7EA890b1afB7d2b660c30C8B0A
address internal constant AAVE_SVR_BTC__USD = 0xb41E773f507F7a7EA890b1afB7d2b660c30C8B0A;
// https://etherscan.io/address/0x85355da30ee4b35F4B30759Bd49a1EBE3fc41Bdb
address internal constant AAVE_SVR_BTC__USD_BASE = 0x85355da30ee4b35F4B30759Bd49a1EBE3fc41Bdb;
// https://etherscan.io/address/0xFF3BC18cCBd5999CE63E788A1c250a88626aD099
address internal constant sUSDe__USD = 0xFF3BC18cCBd5999CE63E788A1c250a88626aD099;
// https://etherscan.io/address/0xEa674bBC33AE708Bc9EB4ba348b04E4eB55b496b
address internal constant AAVE_SVR_USDC__USD = 0xEa674bBC33AE708Bc9EB4ba348b04E4eB55b496b;
// https://etherscan.io/address/0xfB6471ACD42c91FF265344Ff73E88353521d099F
address internal constant AAVE_SVR_USDC__USD_BASE = 0xfB6471ACD42c91FF265344Ff73E88353521d099F;
// https://etherscan.io/address/0xa01aFd01f29fd9Cd14f9B6239349219DAE407562
address internal constant xLayer_Healthcheck = 0xa01aFd01f29fd9Cd14f9B6239349219DAE407562;
// https://etherscan.io/address/0xE6417a3B82438f783DC8fd2B1cB6B0808585030B
address internal constant SVR_QQQon__USD_Ondo_API = 0xE6417a3B82438f783DC8fd2B1cB6B0808585030B;
// https://etherscan.io/address/0xE5DF423251c67D85B2D70787Af76069d96BC4D4C
address internal constant SVR_QQQon__USD_Ondo_API__BASE =
0xE5DF423251c67D85B2D70787Af76069d96BC4D4C;
// https://etherscan.io/address/0x2885d15b8Af22648b98B122b22FDF4D2a56c6023
address internal constant ZRX__USD = 0x2885d15b8Af22648b98B122b22FDF4D2a56c6023;
// https://etherscan.io/address/0xec1D1B3b0443256cc3860e24a46F108e699484Aa
address internal constant MKR__USD = 0xec1D1B3b0443256cc3860e24a46F108e699484Aa;
// https://etherscan.io/address/0x14E5FC91Ddb3f97C33013Cc9fA74F54062Ad1Aa1
address internal constant WLFI__USD = 0x14E5FC91Ddb3f97C33013Cc9fA74F54062Ad1Aa1;
// https://etherscan.io/address/0x42fC9d7c315Cf64Edc39ec984Bf89Bc34BbE9FD5
address internal constant ezETH_Proof_of_Reserves = 0x42fC9d7c315Cf64Edc39ec984Bf89Bc34BbE9FD5;
// https://etherscan.io/address/0xAbE7a3643615Ed32d3431e11E0Ee5A486Cb27d48
address internal constant TBILL_NAV = 0xAbE7a3643615Ed32d3431e11E0Ee5A486Cb27d48;
// https://etherscan.io/address/0xEEf0C605546958c1f899b6fB336C20671f9cD49F
address internal constant CRVUSD__USD = 0xEEf0C605546958c1f899b6fB336C20671f9cD49F;
// https://etherscan.io/address/0x5b563107C8666d2142C216114228443B94152362
address internal constant mETH__ETH = 0x5b563107C8666d2142C216114228443B94152362;
// https://etherscan.io/address/0x31697852a68433DbCc2Ff612c516d69E3D9bd08F
address internal constant ARB__USD = 0x31697852a68433DbCc2Ff612c516d69E3D9bd08F;
// https://etherscan.io/address/0x4e844125952D32AcdF339BE976c98E22F6F318dB
address internal constant LDO__ETH = 0x4e844125952D32AcdF339BE976c98E22F6F318dB;
// https://etherscan.io/address/0xe25277fF4bbF9081C75Ab0EB13B4A13a721f3E13
address internal constant SGD__USD = 0xe25277fF4bbF9081C75Ab0EB13B4A13a721f3E13;
// https://etherscan.io/address/0x3f12643D3f6f874d39C2a4c9f2Cd6f2DbAC877FC
address internal constant GHO__USD = 0x3f12643D3f6f874d39C2a4c9f2Cd6f2DbAC877FC;
// https://etherscan.io/address/0xec746eCF986E2927Abd291a2A1716c940100f8Ba
address internal constant TUSD__USD = 0xec746eCF986E2927Abd291a2A1716c940100f8Ba;
}
lib/aave-helpers/lib/aave-address-book/src/MiscEthereum.sol
// AUTOGENERATED - MANUAL CHANGES WILL BE REVERTED BY THE GENERATOR
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;
import {IAaveEcosystemReserveController} from './common/IAaveEcosystemReserveController.sol';
import {IStreamable} from './common/IStreamable.sol';
library MiscEthereum {
// https://etherscan.io/address/0x3d569673dAa0575c936c7c67c4E6AedA69CC630C
IAaveEcosystemReserveController internal constant AAVE_ECOSYSTEM_RESERVE_CONTROLLER =
IAaveEcosystemReserveController(0x3d569673dAa0575c936c7c67c4E6AedA69CC630C);
// https://etherscan.io/address/0x25F2226B597E8F9514B3F68F00f494cF4f286491
address internal constant ECOSYSTEM_RESERVE = 0x25F2226B597E8F9514B3F68F00f494cF4f286491;
// https://etherscan.io/address/0x86C3FfeE349A7cFf7cA88C449717B1b133bfb517
address internal constant PROXY_ADMIN_LONG = 0x86C3FfeE349A7cFf7cA88C449717B1b133bfb517;
// https://etherscan.io/address/0x3ea64b1C0194524b48F9118462C8E9cd61a243c7
address internal constant AAVE_SWAPPER = 0x3ea64b1C0194524b48F9118462C8E9cd61a243c7;
// https://etherscan.io/address/0x1C2BA5b8ab8e795fF44387ba6d251fa65AD20b36
address internal constant AAVE_POL_ETH_BRIDGE = 0x1C2BA5b8ab8e795fF44387ba6d251fa65AD20b36;
// https://etherscan.io/address/0xEB0682d148e874553008730f0686ea89db7DA412
address internal constant TRANSPARENT_PROXY_FACTORY = 0xEB0682d148e874553008730f0686ea89db7DA412;
// https://etherscan.io/address/0xD3cF979e676265e4f6379749DECe4708B9A22476
address internal constant PROXY_ADMIN = 0xD3cF979e676265e4f6379749DECe4708B9A22476;
// https://etherscan.io/address/0xcc3C54B95f3f1867A43009B80ed4DD930E3cE2F7
address internal constant CREATE_3_FACTORY = 0xcc3C54B95f3f1867A43009B80ed4DD930E3cE2F7;
// https://etherscan.io/address/0x1cDF8879eC8bE012bA959EB515b11008E0cb6323
address internal constant AAVE_CL_ROBOT_OPERATOR = 0x1cDF8879eC8bE012bA959EB515b11008E0cb6323;
// https://etherscan.io/address/0x2CFe3ec4d5a6811f4B8067F0DE7e47DfA938Aa30
address internal constant PROTOCOL_GUARDIAN = 0x2CFe3ec4d5a6811f4B8067F0DE7e47DfA938Aa30;
// https://etherscan.io/address/0xa88c6D90eAe942291325f9ae3c66f3563B93FE10
address internal constant AAVE_MERKLE_DISTRIBUTOR = 0xa88c6D90eAe942291325f9ae3c66f3563B93FE10;
// https://etherscan.io/address/0x197E90f9FAD81970bA7976f33CbD77088E5D7cf7
address internal constant sDAI_POT = 0x197E90f9FAD81970bA7976f33CbD77088E5D7cf7;
// https://etherscan.io/address/0x004626A008B1aCdC4c74ab51644093b155e59A23
address internal constant stEUR = 0x004626A008B1aCdC4c74ab51644093b155e59A23;
// https://etherscan.io/address/0xb4d5289C58CE36080b0748B47F859D8F50dFAACb
address internal constant agEUR_EUR_AGGREGATOR = 0xb4d5289C58CE36080b0748B47F859D8F50dFAACb;
// https://etherscan.io/address/0xb49f677943BC038e9857d61E7d053CaA2C1734C1
address internal constant EUR_USD_AGGREGATOR = 0xb49f677943BC038e9857d61E7d053CaA2C1734C1;
// https://etherscan.io/address/0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee
address internal constant weETH_RATIO_PROVIDER = 0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee;
// https://etherscan.io/address/0x22740deBa78d5a0c24C58C740e3715ec29de1bFa
address internal constant AFC_SAFE = 0x22740deBa78d5a0c24C58C740e3715ec29de1bFa;
// https://etherscan.io/address/0xA1c93D2687f7014Aaf588c764E3Ce80aF016229b
address internal constant ALC_SAFE = 0xA1c93D2687f7014Aaf588c764E3Ce80aF016229b;
// https://etherscan.io/address/0xdef1FA4CEfe67365ba046a7C630D6B885298E210
address internal constant MASIV_SAFE = 0xdef1FA4CEfe67365ba046a7C630D6B885298E210;
// https://etherscan.io/address/0xdeadD8aB03075b7FBA81864202a2f59EE25B312b
address internal constant MERIT_AHAB_SAFE = 0xdeadD8aB03075b7FBA81864202a2f59EE25B312b;
// https://etherscan.io/address/0xAA43203167317DeeF8288095C44b84a686918d2E
address internal constant APE_SAFE = 0xAA43203167317DeeF8288095C44b84a686918d2E;
// https://etherscan.io/address/0xa9e777D56C0Ad861f6a03967E080e767ad8D39b6
address internal constant APE_VOTING_SAFE = 0xa9e777D56C0Ad861f6a03967E080e767ad8D39b6;
// https://etherscan.io/address/0xAAB6f926DCDaE536F54ce58478Dbc1a0d0f98871
address internal constant ALC_INCENTIVE_SAFE = 0xAAB6f926DCDaE536F54ce58478Dbc1a0d0f98871;
// https://etherscan.io/address/0xAA484Ba6a7f51f00A3f82a11e73b741AE1dEAB58
address internal constant ALC_VOTING_SAFE = 0xAA484Ba6a7f51f00A3f82a11e73b741AE1dEAB58;
// https://etherscan.io/address/0xCDb4fA6ba08bF1FB7Aa9fDf6002E78EDc431a642
address internal constant FRONTIER_SAFE = 0xCDb4fA6ba08bF1FB7Aa9fDf6002E78EDc431a642;
// https://etherscan.io/address/0xAA870e4B82deaDa3727235f34183Ec9B728714C8
address internal constant MERIT_INCENTIVE_SAFE = 0xAA870e4B82deaDa3727235f34183Ec9B728714C8;
// https://etherscan.io/address/0xAA2461f0f0A3dE5fEAF3273eAe16DEF861cf594e
address internal constant AHAB_SAFE = 0xAA2461f0f0A3dE5fEAF3273eAe16DEF861cf594e;
// https://etherscan.io/address/0xAAd742dd9111373ec3C1E53b005e870d4CfF3be2
address internal constant AHAB_INCENTIVES_SAFE = 0xAAd742dd9111373ec3C1E53b005e870d4CfF3be2;
// https://etherscan.io/address/0xAA12BAd4a501d45A5b771e49C2Fd415BA8BFc79d
address internal constant AFC_CEX_EARN_SAFE = 0xAA12BAd4a501d45A5b771e49C2Fd415BA8BFc79d;
// https://etherscan.io/address/0xaa7A1910BA79B6A2E385ebA26185aA2dCB9B8eAd
address internal constant AFC_CEX_EARN_INCENTIVE_SAFE =
0xaa7A1910BA79B6A2E385ebA26185aA2dCB9B8eAd;
// https://etherscan.io/address/0x2C7f01A1322ce99EEB331d6Eb73Aff400f11C5CB
address internal constant REWARD_STEWARD = 0x2C7f01A1322ce99EEB331d6Eb73Aff400f11C5CB;
// https://etherscan.io/address/0x95E3015c67EF62B866cC28ca5A9AB5017A55e336
address internal constant AGENT_HUB = 0x95E3015c67EF62B866cC28ca5A9AB5017A55e336;
// https://etherscan.io/address/0x5CFc96c396325724D49dfF95Da103feDdbf48E05
address internal constant AGENT_HUB_AUTOMATION = 0x5CFc96c396325724D49dfF95Da103feDdbf48E05;
// https://etherscan.io/address/0x9240a6669CC4782FC98620212862DF5CB2e0Df10
address internal constant RANGE_VALIDATION_MODULE = 0x9240a6669CC4782FC98620212862DF5CB2e0Df10;
// https://etherscan.io/address/0x1a0267E9E5929a5914Ae9DbBf23Bc07B14365471
address internal constant LLAMARISK_RISK_ORACLE_ADMIN_SAFE =
0x1a0267E9E5929a5914Ae9DbBf23Bc07B14365471;
// https://etherscan.io/address/0x683d1A91599F971252Ef171eF1F987172be8369A
address internal constant LLAMARISK_RISK_ORACLE = 0x683d1A91599F971252Ef171eF1F987172be8369A;
// https://etherscan.io/address/0x37370932045d20C01A62b3e7c21134A1C6365D38
address internal constant LLAMARISK_PT_PARAMETER_REGISTRY =
0x37370932045d20C01A62b3e7c21134A1C6365D38;
// https://etherscan.io/address/0x1D85000D54ea1185C43E4f2b32833524d3cF3507
address internal constant LLAMARISK_RISK_ORACLE_ROUTER =
0x1D85000D54ea1185C43E4f2b32833524d3cF3507;
// https://etherscan.io/address/0x529e2374afB38AC465D71979E7540ad93C05F6c5
address internal constant LLAMARISK_PT_DISCOUNT_RATE_AGENT =
0x529e2374afB38AC465D71979E7540ad93C05F6c5;
// https://etherscan.io/address/0xbe2840440d4f77CD98CEC2de09913e6851907744
address internal constant LLAMARISK_PT_EMODE_AGENT = 0xbe2840440d4f77CD98CEC2de09913e6851907744;
// https://etherscan.io/address/0x66Ac7223048037826e12cef9a848199e31AEFabE
address internal constant BUDGET_INCENTIVE_SAFE = 0x66Ac7223048037826e12cef9a848199e31AEFabE;
// https://etherscan.io/address/0x89587ebe7cFF64c6527fE2Deccc3521D75763E8D
address internal constant MERKL_DISTRIBUTION_SAFE = 0x89587ebe7cFF64c6527fE2Deccc3521D75763E8D;
// https://etherscan.io/address/0x441E4053fDDF1e1a77a39d00309Af389096d4124
address internal constant ROBOT_GUARDIAN = 0x441E4053fDDF1e1a77a39d00309Af389096d4124;
// https://etherscan.io/address/0x9bdbB2997D3Aa0bECc56DFC960e0e17d7E9AbAE1
address internal constant ACI_DAO_WALLET_VESTING = 0x9bdbB2997D3Aa0bECc56DFC960e0e17d7E9AbAE1;
// https://etherscan.io/address/0x1aF449783d8EE434a54bA9B1db9186a15B141a2A
address internal constant LLAMARISK_DAO_WALLET_VESTING =
0x1aF449783d8EE434a54bA9B1db9186a15B141a2A;
// https://etherscan.io/address/0x831e9e6D5150c912D0f896142243FF7bC7255D62
address internal constant TOKENLOGIC_DAO_WALLET_VESTING =
0x831e9e6D5150c912D0f896142243FF7bC7255D62;
// https://etherscan.io/address/0x1BDecEAE83c6Ca0f4D78Ee46D40881FAb26b10b1
address internal constant CHAOS_LABS_DAO_WALLET_VESTING =
0x1BDecEAE83c6Ca0f4D78Ee46D40881FAb26b10b1;
// https://etherscan.io/address/0xCD18eAa163733Da39c232722cBC4E8940b1D8888
address internal constant SABLIER = 0xCD18eAa163733Da39c232722cBC4E8940b1D8888;
// https://etherscan.io/address/0xbC540e0729B732fb14afA240aA5A047aE9ba7dF0
address internal constant CHAOS_LABS_FUNDING_RECEIVER =
0xbC540e0729B732fb14afA240aA5A047aE9ba7dF0;
// https://etherscan.io/address/0x9eE16dBDE572886342fc1e2Db8525DEFB007b27c
address internal constant LLAMARISK_FUNDING_RECEIVER = 0x9eE16dBDE572886342fc1e2Db8525DEFB007b27c;
// https://etherscan.io/address/0xAA088dfF3dcF619664094945028d44E779F19894
address internal constant TOKENLOGIC_FUNDING_RECEIVER =
0xAA088dfF3dcF619664094945028d44E779F19894;
// https://etherscan.io/address/0x55Ac902cb75cC15288D473ed8E3E185a75b3f330
address internal constant ACI_FUNDING_RECEIVER = 0x55Ac902cb75cC15288D473ed8E3E185a75b3f330;
// https://etherscan.io/address/0xAAA973Fe8A6202947e21D0a3a43d8E83ABE35C23
address internal constant BALANCER_RECLAMM_SAFE_DAO_WALLET_TREASURY =
0xAAA973Fe8A6202947e21D0a3a43d8E83ABE35C23;
// https://etherscan.io/address/0xAAf400e4Bbc38B5E2136C1a36946Bf841A357307
address internal constant V4_AUDIT_DAO_WALLET_SECURITY =
0xAAf400e4Bbc38B5E2136C1a36946Bf841A357307;
// https://etherscan.io/address/0x0F11640BF66e2D9352d9c41434A5C6E597c5e4c8
address internal constant CERTORA_FUNDING_RECEIVER = 0x0F11640BF66e2D9352d9c41434A5C6E597c5e4c8;
// https://etherscan.io/address/0x3F68D194852Fb0e6F121D0703d2E3f78931D92FB
address internal constant FRONTIER_STADER_DAO_WALLET_STEWARD =
0x3F68D194852Fb0e6F121D0703d2E3f78931D92FB;
// https://etherscan.io/address/0x9DE1d45e2786b03498289959203F25b29B4D1193
address internal constant TOKENLOGIC_EXECUTION_SAFE = 0x9DE1d45e2786b03498289959203F25b29B4D1193;
// https://etherscan.io/address/0x4cc755fBFAE135933b64865E7D7Ea6ae778A4D43
address internal constant STABLE_VAULT_DAO_WALLET_INCENTIVES =
0x4cc755fBFAE135933b64865E7D7Ea6ae778A4D43;
// https://etherscan.io/address/0x187AAE17d4931310B3fc75743e7F16Bdc9eD77e9
address internal constant V4_SECURITY_COUNCIL = 0x187AAE17d4931310B3fc75743e7F16Bdc9eD77e9;
// https://etherscan.io/address/0x14339e2178A954d5FB839D5Ff31644fE0F25F517
address internal constant V4_SECURITY_COUNCIL_EXECUTOR =
0x14339e2178A954d5FB839D5Ff31644fE0F25F517;
}
lib/aave-helpers/lib/aave-address-book/src/common/IAaveEcosystemReserveController.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;
interface IAaveEcosystemReserveController {
/**
* @notice Proxy function for ERC20's approve(), pointing to a specific collector contract
* @param collector The collector contract with funds (Aave ecosystem reserve)
* @param token The asset address
* @param recipient Allowance's recipient
* @param amount Allowance to approve
**/
function approve(
address collector,
// IERC20 token,
address token,
address recipient,
uint256 amount
) external;
/**
* @notice Proxy function for ERC20's transfer(), pointing to a specific collector contract
* @param collector The collector contract with funds (Aave ecosystem reserve)
* @param token The asset address
* @param recipient Transfer's recipient
* @param amount Amount to transfer
**/
function transfer(
address collector,
// IERC20 token,
address token,
address recipient,
uint256 amount
) external;
/**
* @notice Proxy function to create a stream of token on a specific collector contract
* @param collector The collector contract with funds (Aave ecosystem reserve)
* @param recipient The recipient of the stream of token
* @param deposit Total amount to be streamed
* @param tokenAddress The ERC20 token to use as streaming asset
* @param startTime The unix timestamp for when the stream starts
* @param stopTime The unix timestamp for when the stream stops
* @return uint256 The stream id created
**/
function createStream(
address collector,
address recipient,
uint256 deposit,
// IERC20 tokenAddress,
address tokenAddress,
uint256 startTime,
uint256 stopTime
) external returns (uint256);
/**
* @notice Proxy function to withdraw from a stream of token on a specific collector contract
* @param collector The collector contract with funds (Aave ecosystem reserve)
* @param streamId The id of the stream to withdraw tokens from
* @param funds Amount to withdraw
* @return bool If the withdrawal finished properly
**/
function withdrawFromStream(
address collector,
uint256 streamId,
uint256 funds
) external returns (bool);
/**
* @notice Proxy function to cancel a stream of token on a specific collector contract
* @param collector The collector contract with funds (Aave ecosystem reserve)
* @param streamId The id of the stream to cancel
* @return bool If the cancellation happened correctly
**/
function cancelStream(address collector, uint256 streamId) external returns (bool);
}
lib/aave-helpers/lib/aave-address-book/src/common/IStreamable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;
interface IStreamable {
struct Stream {
uint256 deposit;
uint256 ratePerSecond;
uint256 remainingBalance;
uint256 startTime;
uint256 stopTime;
address recipient;
address sender;
address tokenAddress;
bool isEntity;
}
event CreateStream(
uint256 indexed streamId,
address indexed sender,
address indexed recipient,
uint256 deposit,
address tokenAddress,
uint256 startTime,
uint256 stopTime
);
event WithdrawFromStream(uint256 indexed streamId, address indexed recipient, uint256 amount);
event CancelStream(
uint256 indexed streamId,
address indexed sender,
address indexed recipient,
uint256 senderBalance,
uint256 recipientBalance
);
function balanceOf(uint256 streamId, address who) external view returns (uint256 balance);
function getStream(
uint256 streamId
)
external
view
returns (
address sender,
address recipient,
uint256 deposit,
address token,
uint256 startTime,
uint256 stopTime,
uint256 remainingBalance,
uint256 ratePerSecond
);
function createStream(
address recipient,
uint256 deposit,
address tokenAddress,
uint256 startTime,
uint256 stopTime
) external returns (uint256 streamId);
function withdrawFromStream(uint256 streamId, uint256 funds) external returns (bool);
function cancelStream(uint256 streamId) external returns (bool);
function initialize(address fundsAdmin) external;
/**
* @notice Returns the next available stream id
* @return nextStreamId Returns the stream id.
*/
function getNextStreamId() external view returns (uint256);
}
lib/aave-helpers/src/v4-config-engine/AaveV4PayloadEthereum.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {AaveV4Ethereum} from 'aave-address-book/AaveV4Ethereum.sol';
import {AaveV4Payload} from 'aave-v4/config-engine/AaveV4Payload.sol';
/**
* @dev Base smart contract for an Aave V4 governance payload on Ethereum.
* @author Aave Labs
*/
abstract contract AaveV4PayloadEthereum is AaveV4Payload(AaveV4Ethereum.CONFIG_ENGINE) {}
Compiler settingsShow
{
"viaIR": false,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "none",
"useLiteralContent": false
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "shanghai",
"remappings": [
"forge-std/=lib/aave-helpers/lib/forge-std/src/",
"solidity-utils/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/src/",
"aave-v3-origin/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/",
"aave-v3-origin-tests/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/tests/",
"aave-address-book/=lib/aave-helpers/lib/aave-address-book/src/",
"aave-v4/=lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v4/:src/=lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v4/:src/=lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/",
"openzeppelin-contracts/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
"aave-helpers/=lib/aave-helpers/",
"lib/aave-helpers/:src/=lib/aave-helpers/src/",
"lib/aave-helpers/:src/=lib/aave-helpers/src/",
"aave-umbrella/=lib/aave-umbrella/src/contracts/",
"lib/aave-helpers/:aave-v3-origin/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/",
"lib/aave-helpers/:aave-v3-origin/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/",
"lib/aave-address-book/lib/aave-v4/:src/=lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/",
"lib/aave-v4/:src/=lib/aave-helpers/lib/aave-address-book/lib/aave-v4/src/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/forge-std/:ds-test/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/forge-std/:ds-test/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/forge-std/:ds-test/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/forge-std/:ds-test/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:erc4626-tests/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/erc4626-tests/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:erc4626-tests/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/erc4626-tests/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:halmos-cheatcodes/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:halmos-cheatcodes/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/forge-std/:ds-test/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
"lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/forge-std/:ds-test/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/:erc4626-tests/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/:erc4626-tests/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/:halmos-cheatcodes/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/:halmos-cheatcodes/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/forge-std/:ds-test/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
"lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/forge-std/:ds-test/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
"lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:erc4626-tests/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/erc4626-tests/",
"lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:erc4626-tests/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/erc4626-tests/",
"lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:halmos-cheatcodes/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/:halmos-cheatcodes/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/:openzeppelin-contracts-upgradeable/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/:openzeppelin-contracts-upgradeable/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/",
"lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/:erc4626-tests/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/:erc4626-tests/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/:halmos-cheatcodes/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/:halmos-cheatcodes/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v4/:erc4626-tests/=lib/aave-helpers/lib/aave-address-book/lib/aave-v4/lib/erc4626-tests/",
"lib/aave-helpers/lib/aave-address-book/lib/aave-v4/:erc4626-tests/=lib/aave-helpers/lib/aave-address-book/lib/aave-v4/lib/erc4626-tests/",
"lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/:openzeppelin-contracts-upgradeable/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/",
"lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/:openzeppelin-contracts-upgradeable/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/",
"lib/aave-umbrella/:erc4626-tests/=lib/aave-umbrella/lib/erc4626-tests/",
"lib/aave-umbrella/:erc4626-tests/=lib/aave-umbrella/lib/erc4626-tests/",
"@openzeppelin/contracts-upgradeable/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
"ds-test/=lib/aave-umbrella/lib/aave-v3-origin/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/aave-umbrella/lib/erc4626-tests/",
"halmos-cheatcodes/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"openzeppelin-contracts-upgradeable/=lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.