Skip to content

Commit

Permalink
feat: add PERMIT2_TRANSFER_FROM_BATCH to router
Browse files Browse the repository at this point in the history
  • Loading branch information
reednaa committed Mar 26, 2024
1 parent e975abc commit ad97341
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion evm/src/router/base/Dispatcher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ abstract contract Dispatcher is Permit2Payments, CatalystExchange, CancelSwap, L
}
}
} else {
if (command == Commands.TRANSFER_FROM) {
if (command == Commands.PERMIT2_TRANSFER_FROM_BATCH) {
(IAllowanceTransfer.AllowanceTransferDetails[] memory batchDetails) = abi.decode(inputs, (IAllowanceTransfer.AllowanceTransferDetails[]));
permit2TransferFrom(batchDetails, lockedBy);
} else if (command == Commands.TRANSFER_FROM) {
// equivalent: abi.decode(inputs, (address, address, uint160))
address token;
address recipient;
Expand Down
1 change: 1 addition & 0 deletions evm/src/router/libraries/Commands.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ library Commands {

// Command Types where 0x10<=value
uint256 constant EXECUTE_SUB_PLAN = 0x10;
uint256 constant PERMIT2_TRANSFER_FROM_BATCH = 0x1e;
uint256 constant TRANSFER_FROM = 0x1f;
}

0 comments on commit ad97341

Please sign in to comment.