Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/interfaces/IOwnable.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity 0.8.28;

/// @title IOwnable
/// @notice interface for Ownable to support integrations
interface IOwnable {
///@notice function that returns owner address
function owner() external view returns(address);
}
12 changes: 12 additions & 0 deletions src/spoke/TreasurySpoke.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity 0.8.28;

/// OwnableUpgradeable is only imported to override function owner defined in IOwnable.sol
import {OwnableUpgradeable} from 'src/dependencies/openzeppelin-upgradeable/OwnableUpgradeable.sol';
import {Ownable2StepUpgradeable} from 'src/dependencies/openzeppelin-upgradeable/Ownable2StepUpgradeable.sol';
import {SafeERC20, IERC20} from 'src/dependencies/openzeppelin/SafeERC20.sol';
import {MathUtils} from 'src/libraries/math/MathUtils.sol';
import {IHubBase} from 'src/hub/interfaces/IHubBase.sol';
/// IOwnable is only imported to override function owner defined in IOwnable.sol
import {IOwnable} from 'src/interfaces/IOwnable.sol';
import {ITreasurySpoke} from 'src/spoke/interfaces/ITreasurySpoke.sol';

/// @title TreasurySpoke
Expand All @@ -18,6 +22,14 @@ abstract contract TreasurySpoke is ITreasurySpoke, Ownable2StepUpgradeable {
/// @dev To be overridden by the inheriting TreasurySpoke instance contract.
function initialize(address owner) external virtual;

/* function that overrides function owner defined in IOwnable.sol
using secure code of OwnableUpgradeable
and propagates its effects to contracts inherited from TreasurySpoke */
function owner() public view override(IOwnable, OwnableUpgradeable) returns(address) {
/// Call secure code of OwnableUpgradeable
return super.owner();
}

/// @inheritdoc ITreasurySpoke
function supply(
address hub,
Expand Down
4 changes: 3 additions & 1 deletion src/spoke/interfaces/ITreasurySpoke.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// SPDX-License-Identifier: LicenseRef-BUSL
pragma solidity ^0.8.0;

import {IOwnable} from 'src/interfaces/IOwnable.sol';

/// @title ITreasurySpoke
/// @author Aave Labs
/// @notice Interface for the TreasurySpoke.
interface ITreasurySpoke {
interface ITreasurySpoke is IOwnable {
/// @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.
Expand Down