File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,7 @@ abstract contract VaultAdmin is VaultCore {
200200
201201 // Mark the strategy as not supported
202202 strategies[_addr].isSupported = false ;
203+ isMintWhitelistedStrategy[_addr] = false ;
203204
204205 // Withdraw all asset
205206 IStrategy strategy = IStrategy (_addr);
Original file line number Diff line number Diff line change @@ -256,6 +256,39 @@ describe("OETH Vault", function () {
256256 weth . address ,
257257 ] ) ;
258258 } ) ;
259+
260+ it ( "Should reset mint whitelist flag when removing a strategy" , async ( ) => {
261+ const { oethVault, weth, governor } = fixture ;
262+
263+ // Deploy a mock strategy that can be removed
264+ const dMockStrategy = await deployWithConfirmation ( "MockStrategy" ) ;
265+ const mockStrategy = await ethers . getContractAt (
266+ "MockStrategy" ,
267+ dMockStrategy . address
268+ ) ;
269+
270+ // Set up the mock strategy to support withdrawAll
271+ await mockStrategy . setWithdrawAll ( weth . address , oethVault . address ) ;
272+
273+ // Approve the strategy
274+ await oethVault . connect ( governor ) . approveStrategy ( mockStrategy . address ) ;
275+
276+ // Add strategy to mint whitelist
277+ await oethVault
278+ . connect ( governor )
279+ . addStrategyToMintWhitelist ( mockStrategy . address ) ;
280+
281+ // Verify it's whitelisted
282+ expect ( await oethVault . isMintWhitelistedStrategy ( mockStrategy . address ) ) . to
283+ . be . true ;
284+
285+ // Remove the strategy
286+ await oethVault . connect ( governor ) . removeStrategy ( mockStrategy . address ) ;
287+
288+ // Verify the mint whitelist flag is reset
289+ expect ( await oethVault . isMintWhitelistedStrategy ( mockStrategy . address ) ) . to
290+ . be . false ;
291+ } ) ;
259292 } ) ;
260293
261294 describe ( "Remove Asset" , ( ) => {
You can’t perform that action at this time.
0 commit comments