Skip to content

Commit

Permalink
adding burn to execute
Browse files Browse the repository at this point in the history
  • Loading branch information
dsshap committed Oct 5, 2023
1 parent e23f183 commit edc641c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/core-cash
2 changes: 1 addition & 1 deletion lib/core-physical
2 changes: 2 additions & 0 deletions src/settled-cash/AccountCashEngine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ abstract contract AccountCashEngine is BaseEngine {
// update the account in state
_decreaseLongInAccount(from, tokenId, amount);

emit CashOptionTokenBurned(from, tokenId, amount);

// update the account in state
_decreaseShortInAccount(_subAccount, tokenId, amount);

Expand Down
2 changes: 2 additions & 0 deletions src/settled-cash/CrossMarginCashEngine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,8 @@ contract CrossMarginCashEngine is
_mintOptionIntoAccount(_subAccount, actions[i].data);
} else if (actions[i].action == ActionType.BurnShort) {
_burnOption(_subAccount, actions[i].data);
} else if (actions[i].action == ActionType.BurnShortInAccount) {
_burnOptionFromAccount(_subAccount, actions[i].data);
} else if (actions[i].action == ActionType.TransferLong) {
_transferLong(_subAccount, actions[i].data);
} else if (actions[i].action == ActionType.TransferShort) {
Expand Down
2 changes: 2 additions & 0 deletions src/settled-physical/CrossMarginPhysicalEngine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,8 @@ contract CrossMarginPhysicalEngine is
_mintOptionIntoAccount(_subAccount, actions[i].data);
} else if (actions[i].action == ActionType.BurnShort) {
_burnOption(_subAccount, actions[i].data);
} else if (actions[i].action == ActionType.BurnShortInAccount) {
_burnOptionFromAccount(_subAccount, actions[i].data);
} else if (actions[i].action == ActionType.TransferLong) {
_transferLong(_subAccount, actions[i].data);
} else if (actions[i].action == ActionType.TransferShort) {
Expand Down

0 comments on commit edc641c

Please sign in to comment.