Skip to content

Commit f72e5b2

Browse files
committed
feat: add func to get order hash easly
1 parent 28cc486 commit f72e5b2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Polyswap.sol

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,13 @@ contract Polyswap is BaseConditionalOrder {
6161
revert IConditionalOrder.PollTryNextBlock(CONDITION_NOT_MET);
6262
}
6363
}
64+
65+
/**
66+
* @dev Get the hash of the Polyswap order.
67+
* @param polyswapOrder The Polyswap order to get the hash of.
68+
* @return The hash of the Polyswap order.
69+
*/
70+
function getOrderHash(PolyswapOrder.Data memory polyswapOrder) public view returns (bytes32) {
71+
return GPv2Order.hash(PolyswapOrder.orderFor(polyswapOrder), composableCow.domainSeparator());
72+
}
6473
}

0 commit comments

Comments
 (0)