@@ -17,26 +17,19 @@ import { Generalized4626Strategy } from "../Generalized4626Strategy.sol";
1717import { AbstractCCTPIntegrator } from "./AbstractCCTPIntegrator.sol " ;
1818import { CrossChainStrategyHelper } from "./CrossChainStrategyHelper.sol " ;
1919import { InitializableAbstractStrategy } from "../../utils/InitializableAbstractStrategy.sol " ;
20+ import { Strategizable } from "../../governance/Strategizable.sol " ;
2021
2122contract CrossChainRemoteStrategy is
2223 AbstractCCTPIntegrator ,
23- Generalized4626Strategy
24+ Generalized4626Strategy ,
25+ Strategizable
2426{
2527 using SafeERC20 for IERC20 ;
2628 using CrossChainStrategyHelper for bytes ;
2729
2830 event DepositUnderlyingFailed (string reason );
2931 event WithdrawalFailed (uint256 amountRequested , uint256 amountAvailable );
3032 event WithdrawUnderlyingFailed (string reason );
31- event StrategistUpdated (address _address );
32-
33- /**
34- * @notice Address of the strategist.
35- * This is important to have the variable name same as in IVault.
36- * Because the parent contract (Generalized4626Strategy) uses this
37- * function to get the strategist address.
38- */
39- address public strategistAddr;
4033
4134 modifier onlyOperatorOrStrategistOrGovernor () {
4235 require (
@@ -48,6 +41,24 @@ contract CrossChainRemoteStrategy is
4841 _;
4942 }
5043
44+ /**
45+ * @dev Overriding this modifier is important because the parent
46+ * contract`Generalized4626Strategy` uses `IVault.strategistAddr()`
47+ * in its implementation and there's no Vault on the remote strategy.
48+ * So, we set the Vault address of remote to be the proxy address and
49+ * inherit from Strategizable to get the same function signature.
50+ * Essentially, any calls to `IVault.strategistAddr()` will be equal to
51+ * calling `address(this).strategistAddr()`.
52+ */
53+ modifier onlyGovernorOrStrategist ()
54+ override (InitializableAbstractStrategy, Strategizable) {
55+ require (
56+ msg .sender == strategistAddr || isGovernor (),
57+ "Caller is not the Strategist or Governor "
58+ );
59+ _;
60+ }
61+
5162 constructor (
5263 BaseStrategyConfig memory _baseConfig ,
5364 CCTPIntegrationConfig memory _cctpConfig
@@ -91,26 +102,6 @@ contract CrossChainRemoteStrategy is
91102 );
92103 }
93104
94- /**
95- * @notice Set address of Strategist.
96- * This is important to have the function name same as IVault.
97- * Because the parent contract (Generalized4626Strategy) uses this
98- * function to get/set the strategist address.
99- * @param _address Address of Strategist
100- */
101- function setStrategistAddr (address _address ) external onlyGovernor {
102- _setStrategistAddr (_address);
103- }
104-
105- /**
106- * @dev Set the strategist address
107- * @param _address Address of the strategist
108- */
109- function _setStrategistAddr (address _address ) internal {
110- strategistAddr = _address;
111- emit StrategistUpdated (_address);
112- }
113-
114105 /// @inheritdoc Generalized4626Strategy
115106 function deposit (address _asset , uint256 _amount )
116107 external
0 commit comments