diff --git a/integration/integration.test.ts b/integration/integration.test.ts index 8319773..daa079e 100644 --- a/integration/integration.test.ts +++ b/integration/integration.test.ts @@ -3039,6 +3039,20 @@ describe("Call Instrument Tests", function () { expect(await token.ownerOf(0)).to.eq(writer.address); }); + + it("should not reclaim asset when paused", async function () { + // Pause protocol + await protocol.connect(admin).pause(); + await expect(protocol.throwWhenPaused()).to.be.reverted; + + // Attempt to reclaim asset + const reclaimAsset = calls + .connect(writer) + .reclaimAsset(optionTokenId, false); + await expect(reclaimAsset).to.be.revertedWith( + "Pausable: paused" + ); + }); }); /* @@ -3249,5 +3263,19 @@ describe("Call Instrument Tests", function () { "burnExpiredOption -- the option must not have bids" ); }); + + it("should not burn expired option when paused", async function () { + // Pause protocol + await protocol.connect(admin).pause(); + await expect(protocol.throwWhenPaused()).to.be.reverted; + + // Move forward past expiration + await ethers.provider.send("evm_increaseTime", [2 * SECS_IN_A_DAY]); + + // Attempt to burn expired option + await expect(calls.burnExpiredOption(optionTokenId)).to.be.revertedWith( + "Pausable: paused" + ); + }); }); }); diff --git a/src/HookCoveredCallImplV1.sol b/src/HookCoveredCallImplV1.sol index 7841c36..b754379 100644 --- a/src/HookCoveredCallImplV1.sol +++ b/src/HookCoveredCallImplV1.sol @@ -530,6 +530,7 @@ contract HookCoveredCallImplV1 is function reclaimAsset(uint256 optionId, bool returnNft) external nonReentrant + whenNotPaused { CallOption storage call = optionParams[optionId]; require( @@ -585,7 +586,7 @@ contract HookCoveredCallImplV1 is } /// @dev See {IHookCoveredCall-burnExpiredOption}. - function burnExpiredOption(uint256 optionId) external { + function burnExpiredOption(uint256 optionId) external whenNotPaused { CallOption storage call = optionParams[optionId]; require(