From e3594aa2283e490ed292536570425860197e377c Mon Sep 17 00:00:00 2001 From: clemlak Date: Fri, 15 Dec 2023 18:47:47 +0400 Subject: [PATCH] feat: add name param to strategy contracts --- contracts/interfaces/IStrategy.sol | 2 ++ contracts/strategies/G3MStrategy.sol | 3 +++ contracts/strategies/NormalStrategy.sol | 3 +++ 3 files changed, 8 insertions(+) diff --git a/contracts/interfaces/IStrategy.sol b/contracts/interfaces/IStrategy.sol index 56b70126..7492680b 100644 --- a/contracts/interfaces/IStrategy.sol +++ b/contracts/interfaces/IStrategy.sol @@ -19,6 +19,8 @@ interface IStrategy is IPortfolioStrategy { // ====== Required ====== // // Includes: IPortfolioStrategy + function name() external view returns (string memory); + /** * @notice * Called by the Portfolio contract after a pool is created. diff --git a/contracts/strategies/G3MStrategy.sol b/contracts/strategies/G3MStrategy.sol index 0355eaff..acb34f5e 100644 --- a/contracts/strategies/G3MStrategy.sol +++ b/contracts/strategies/G3MStrategy.sol @@ -13,6 +13,9 @@ contract G3MStrategy is IG3MStrategy { address public immutable portfolio; + /// @inheritdoc IStrategy + string public constant name = "G3MStrategy"; + mapping(uint64 => IG3MStrategy.Config) public configs; modifier onlyPortfolio() { diff --git a/contracts/strategies/NormalStrategy.sol b/contracts/strategies/NormalStrategy.sol index 024d6edd..431eee2f 100644 --- a/contracts/strategies/NormalStrategy.sol +++ b/contracts/strategies/NormalStrategy.sol @@ -31,6 +31,9 @@ contract NormalStrategy is INormalStrategy { /// @dev Canonical Portfolio smart contract. address public immutable portfolio; + /// @inheritdoc IStrategy + string public constant name = "NormalStrategy"; + /// @dev Tracks each pool strategy configuration. mapping(uint64 poolId => PortfolioConfig config) public configs;