Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Address Zellic audit 2 feedback 3.1 #198

Merged
merged 2 commits into from
Mar 31, 2023
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
8 changes: 2 additions & 6 deletions src/OptionSettlementEngine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ contract OptionSettlementEngine is ERC1155, IOptionSettlementEngine {
underlyingAmount,
exerciseTimestamp,
expiryTimestamp
);
);
}

/// @inheritdoc IOptionSettlementEngine
Expand Down Expand Up @@ -545,7 +545,7 @@ contract OptionSettlementEngine is ERC1155, IOptionSettlementEngine {
msg.sender,
totalExerciseAssetAmount,
totalUnderlyingAssetAmount
);
);

// Burn the claim NFT and make transfers.
_burn(msg.sender, claimId, 1);
Expand Down Expand Up @@ -810,10 +810,6 @@ contract OptionSettlementEngine is ERC1155, IOptionSettlementEngine {
exerciseIndex = (exerciseIndex + 1) % numUnexercisedBuckets;
}
}

// Update the seed for the next exercise.
optionRecord.settlementSeed =
uint160(uint256(keccak256(abi.encode(optionRecord.settlementSeed, exerciseIndex))));
}

/// @notice Adds or updates a bucket as needed for a given option type and amount written.
Expand Down
2 changes: 1 addition & 1 deletion test/OptionSettlementEngine.integration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ contract OptionSettlementIntegrationTest is BaseEngineTest {
totalExercised += claimData.amountExercised;
}

assertEq(totalExercised, bucketsCreated * 1e18 - 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this changing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertEq(totalExercised, bucketsCreated * 1e18);
}

function test_integrationSweepFeesWhenFeesAccruedForWrite() public {
Expand Down
2 changes: 1 addition & 1 deletion test/OptionSettlementEngine.unit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ contract OptionSettlementUnitTest is BaseEngineTest {
testUnderlyingAmount,
testExerciseTimestamp,
testExpiryTimestamp
);
);

engine.newOptionType(
address(DAILIKE),
Expand Down