Skip to content

Commit

Permalink
feat: component base
Browse files Browse the repository at this point in the history
  • Loading branch information
jakekidd committed Jul 6, 2024
1 parent 3d3c0f4 commit 11b759b
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
39 changes: 39 additions & 0 deletions src/contracts/child/QWComponentBase.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// SPDX-License-Identifier: APACHE
pragma solidity 0.8.23;

import {IQWChild} from 'interfaces/IQWChild.sol';

// TODO: Inherit and call in constructor of components.

abstract contract QWComponentBase is IQWChild {
address public immutable QW_MANAGER;
address public immutable INVESTMENT_TOKEN;
address public immutable ASSET_TOKEN;

constructor(address _qwManager, address _investmentToken, address _assetToken) {
QW_MANAGER = _qwManager;
INVESTMENT_TOKEN = _investmentToken;
ASSET_TOKEN = _assetToken;
}

/**
* @notice Gets the address of the Quant Wealth Manager contract.
*/
function getQWManager() external view override returns (address) {
return QW_MANAGER;
}

/**
* @notice Gets the address of the investment token, the token input and output for the contract.
*/
function getInvestmentToken() external view override returns (address) {
return INVESTMENT_TOKEN;
}

/**
* @notice Gets the address of the asset token, the token that is purchased and sold using the investment token.
*/
function getAssetToken() external view override returns (address) {
return ASSET_TOKEN;
}
}
14 changes: 13 additions & 1 deletion src/interfaces/IQWChild.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,17 @@ interface IQWChild {
* @notice Gets the address of the Quant Wealth Manager contract.
* @return address The address of the Quant Wealth Manager contract recorded in this child contract.
*/
function QW_MANAGER() external view returns (address);
function getQWManager() external view returns (address);

/**
* @notice Gets the address of the investment token, the token input and output for the contract.
* @return address The address of the investment token.
*/
function getInvestmentToken() external view returns (address);

/**
* @notice Gets the address of the asset token, the token that is purchased and sold using the investment token.
* @return address The address of the asset token.
*/
function getAssetToken() external view returns (address);
}

0 comments on commit 11b759b

Please sign in to comment.