diff --git a/contracts/erc7683/ERC7683Across.sol b/contracts/erc7683/ERC7683Across.sol index 008de9a17..b9601d8fa 100644 --- a/contracts/erc7683/ERC7683Across.sol +++ b/contracts/erc7683/ERC7683Across.sol @@ -49,13 +49,23 @@ library ERC7683Permit2Lib { "uint32 originChainId,", "uint32 initiateDeadline,", "uint32 fillDeadline,", - "AcrossOrderData orderData)", - ACROSS_ORDER_DATA_TYPE + "AcrossOrderData orderData)" ); - bytes32 internal constant CROSS_CHAIN_ORDER_TYPE_HASH = keccak256(CROSS_CHAIN_ORDER_TYPE); + + bytes internal constant CROSS_CHAIN_ORDER_EIP712_TYPE = + abi.encodePacked(CROSS_CHAIN_ORDER_TYPE, ACROSS_ORDER_DATA_TYPE); + bytes32 internal constant CROSS_CHAIN_ORDER_TYPE_HASH = keccak256(CROSS_CHAIN_ORDER_EIP712_TYPE); + string private constant TOKEN_PERMISSIONS_TYPE = "TokenPermissions(address token,uint256 amount)"; string internal constant PERMIT2_ORDER_TYPE = - string(abi.encodePacked("CrossChainOrder witness)", CROSS_CHAIN_ORDER_TYPE, TOKEN_PERMISSIONS_TYPE)); + string( + abi.encodePacked( + "CrossChainOrder witness)", + ACROSS_ORDER_DATA_TYPE, + CROSS_CHAIN_ORDER_TYPE, + TOKEN_PERMISSIONS_TYPE + ) + ); // Hashes an order to get an order hash. Needed for permit2. function hashOrder(CrossChainOrder memory order, bytes32 orderDataHash) internal pure returns (bytes32) {