Skip to content

Commit

Permalink
Virtual _assertCallerHasAccess (#242)
Browse files Browse the repository at this point in the history
* making _assertCallerHasAccess virtual

* fmt
  • Loading branch information
dsshap authored Apr 2, 2024
1 parent 8585a55 commit d157cfd
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/config/enums.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ enum ActionType {
TransferLong, // transfer long directly to another subAccount
TransferShort, // transfer short directly to another subAccount
BurnShortInAccount // decreases short position in one subAccount, decreases long position in another

}
3 changes: 1 addition & 2 deletions src/core/engines/BaseEngine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ abstract contract BaseEngine {
* Constructor
* ========================================================= *
*/

constructor(address _grappa, address _optionToken) {
grappa = IGrappa(_grappa);
optionToken = ICashOptionToken(_optionToken);
Expand Down Expand Up @@ -323,7 +322,7 @@ abstract contract BaseEngine {
* @notice revert if the msg.sender is not authorized to access an subAccount id
* @param _subAccount subaccount id
*/
function _assertCallerHasAccess(address _subAccount) internal {
function _assertCallerHasAccess(address _subAccount) internal virtual {
if (_isPrimaryAccountFor(msg.sender, _subAccount)) return;

// the sender is not the direct owner. check if they're authorized
Expand Down
1 change: 0 additions & 1 deletion src/core/engines/mixins/DebitSpread.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ abstract contract DebitSpread is BaseEngine {
* State changing functions to override
* ========================================================= *
*/

function _mergeLongIntoSpread(address _subAccount, uint256 shortTokenId, uint256 longTokenId, uint64 amount)
internal
virtual
Expand Down
1 change: 0 additions & 1 deletion src/libraries/TokenIdUtil.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import "../config/errors.sol";
* | tokenType (24 bits) | productId (40 bits) | expiry (64 bits) | longStrike (64 bits) | reserved (64 bits) |
* * ------------------- | ------------------- | ---------------- | -------------------- | --------------------- *
*/

library TokenIdUtil {
/**
* @notice calculate ERC1155 token id for given option parameters. See table above for tokenId
Expand Down

0 comments on commit d157cfd

Please sign in to comment.