Skip to content

Commit

Permalink
add permitAndCall to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ZumZoom committed Dec 8, 2023
1 parent c454e0f commit 1800be9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contracts/OrderMixin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ abstract contract OrderMixin is IOrderMixin, EIP712, OnlyWethReceiver, Predicate
_WETH = weth;
}

/**
* @notice See {IOrderMixin-permitAndCall}.
*/
function permitAndCall(bytes calldata permit, bytes calldata action) external {
IERC20(address(bytes20(permit))).tryPermit(msg.sender, address(this), permit[20:]);
// solhint-disable-next-line no-inline-assembly
Expand Down
7 changes: 7 additions & 0 deletions contracts/interfaces/IOrderMixin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ interface IOrderMixin {
bytes32 orderHash
);

/**
* @notice Executes a permit and then calls a specified action using delegatecall.
* @param permit The permit data, including the token address, permit parameters and permit signature.
* @param action The action data to be executed using delegatecall.
*/
function permitAndCall(bytes calldata permit, bytes calldata action) external;

/**
* @notice Returns bitmask for double-spend invalidators based on lowest byte of order.info and filled quotes
* @param maker Maker address
Expand Down

0 comments on commit 1800be9

Please sign in to comment.