Conversation
| function openFor( | ||
| GaslessCrossChainOrder calldata order, | ||
| bytes calldata signature, | ||
| bytes calldata originFillerData | ||
| ) external { | ||
| if (originFillerData.length > 0) revert InvalidOriginFillerData(); | ||
| if (order.orderDataType != GASLESS_ORDER_DATA_TYPEHASH) revert InvalidOrderDataType(); | ||
| if (order.originSettler != address(this)) revert InvalidOriginSettler(); | ||
|
|
||
| GaslessOrderData memory gaslessOrderData = abi.decode(order.orderData, (GaslessOrderData)); | ||
|
|
||
| StandardOrder memory standardOrder = StandardOrder({ | ||
| user: order.user, | ||
| nonce: order.nonce, | ||
| originChainId: order.originChainId, | ||
| expires: gaslessOrderData.expires, | ||
| fillDeadline: order.fillDeadline, | ||
| inputOracle: gaslessOrderData.inputOracle, | ||
| inputs: gaslessOrderData.inputs, | ||
| outputs: gaslessOrderData.outputs | ||
| }); | ||
|
|
||
| _inputSettlerEscrow.openFor(abi.encode(standardOrder), order.user, signature); | ||
|
|
||
| bytes32 orderId = orderIdentifier(standardOrder); | ||
|
|
||
| emit Open(orderId, _resolve(standardOrder)); | ||
| } |
There was a problem hiding this comment.
Not compliant function. The spec says:
/// @title GaslessCrossChainOrder CrossChainOrder type
/// @notice Standard order struct to be signed by users, disseminated to fillers, and submitted to origin settler
/// contracts by fillers
struct GaslessCrossChainOrder {This would not be the case here.
There was a problem hiding this comment.
from the PoV of the filler/user, the adapter is acting as a settler, would make it compliant, no?
There was a problem hiding this comment.
The user does not sign GasslessCrossChainOrder. You should collect the tokens in this contract and then call open on the escrow.
| bytes32 public constant ONCHAIN_ORDER_DATA_TYPEHASH = keccak256( | ||
| "StandardOrder(address user,uint256 nonce,uint256 originChainId,uint32 expires,uint32 fillDeadline,address inputOracle,uint256[2][] inputs,MandateOutput[] outputs)" | ||
| ); | ||
|
|
||
| bytes32 public constant GASLESS_ORDER_DATA_TYPEHASH = | ||
| keccak256("GaslessOrderData(uint32 expires,address inputOracle,uint256[2][] inputs,MandateOutput[] outputs)"); |
There was a problem hiding this comment.
Personal: I dislike having multiple "order_data" for the same order. It increases complexity.
There was a problem hiding this comment.
I understand it, but using the same typehash for both would mean that a lot of data would be duplicated, between the GaslessCrosschainOrder and StandarOrder. This would be both very redundant, as well as we would have to check if the data coming from both structs is the same.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Description
Adds adapter for ERC7683. The adapter is only required on the input side, since the output settler is already compliant with the current version of ERC7683, available here.
Related Issues