Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions integration/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
});
});

/*
Expand Down Expand Up @@ -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"
);
});
});
});
3 changes: 2 additions & 1 deletion src/HookCoveredCallImplV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ contract HookCoveredCallImplV1 is
function reclaimAsset(uint256 optionId, bool returnNft)
external
nonReentrant
whenNotPaused
{
CallOption storage call = optionParams[optionId];
require(
Expand Down Expand Up @@ -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(
Expand Down