Skip to content

Instantly share code, notes, and snippets.

@coffiasd
Last active May 23, 2024 02:17
Show Gist options
  • Save coffiasd/d129d572e056df3210dd9dc4d4a4c3b4 to your computer and use it in GitHub Desktop.
Save coffiasd/d129d572e056df3210dd9dc4d4a4c3b4 to your computer and use it in GitHub Desktop.
SettleLongPremium is incorrectly implemented: premium should be deducted instead of added
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "hardhat/console.sol";
contract Panotic{
function exercise(
int128 realizedPremium
) external pure returns (int128) {
int256 tokenToPay = -realizedPremium;
if (tokenToPay > 0) {
console.log("burn user shares");
} else if (tokenToPay < 0) {
console.log("mint user shares.");
}
return 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment