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

Filter by extension

Filter by extension

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

/// @title IOwnable
/// @author Aave Labs
/// @notice Interface for contracts exposing Ownable access control.
interface IOwnable {
/// @notice Returns the address of the current owner.
function owner() external view returns (address);
}
7 changes: 7 additions & 0 deletions src/spoke/TreasurySpoke.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
pragma solidity 0.8.28;

import {Ownable2StepUpgradeable} from 'src/dependencies/openzeppelin-upgradeable/Ownable2StepUpgradeable.sol';
import {OwnableUpgradeable} from 'src/dependencies/openzeppelin-upgradeable/OwnableUpgradeable.sol';
import {SafeERC20, IERC20} from 'src/dependencies/openzeppelin/SafeERC20.sol';
import {IOwnable} from 'src/interfaces/IOwnable.sol';
import {MathUtils} from 'src/libraries/math/MathUtils.sol';
import {IHubBase} from 'src/hub/interfaces/IHubBase.sol';
import {ITreasurySpoke} from 'src/spoke/interfaces/ITreasurySpoke.sol';
Expand All @@ -18,6 +20,11 @@ abstract contract TreasurySpoke is ITreasurySpoke, Ownable2StepUpgradeable {
/// @dev To be overridden by the inheriting TreasurySpoke instance contract.
function initialize(address owner) external virtual;

/// @inheritdoc IOwnable
function owner() public view virtual override(IOwnable, OwnableUpgradeable) returns (address) {
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
1 change: 1 addition & 0 deletions tests/contracts/treasury-spoke/TreasurySpoke.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ contract TreasurySpokeTest is Base {
assertEq(treasurySpoke.getSuppliedShares(address(hub2), underlying), 0);
}
assertEq(Ownable2Step(address(treasurySpoke)).owner(), TREASURY_ADMIN);
assertEq(treasurySpoke.owner(), TREASURY_ADMIN);
assertEq(Ownable2Step(address(treasurySpoke)).pendingOwner(), address(0));
}

Expand Down