You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Gnosis Safe delegatecall information to presign CowSwap order
37
+
struct PresignDeletaCallData {
38
+
bytes orderUid;
39
+
address targetAddress;
40
+
bytes data;
41
+
}
42
+
43
+
// Perform sell (exact in) order creation with a max slippage limit
34
44
// Copied from https://github.com/InfiniFi-Labs/infinifi-protocol/blob/888c147c4d0f1848577463bc74680c86b7a5c0ff/src/integrations/farms/CoWSwapFarmBase.sol#L71
35
45
function _createCowSwapOrder(bytes32appdata, addressreceiver, address_tokenIn, address_tokenOut, uint256_amountIn, uint256_minAmountOut)
36
46
internal
@@ -46,23 +56,37 @@ contract SwapCowSwap {
46
56
validTo: uint32(block.timestamp+ _SIGN_COOLDOWN),
47
57
appData: appdata,
48
58
feeAmount: 0,
49
-
kind: GPv2Order.KIND_BUY,
59
+
kind: GPv2Order.KIND_SELL,
50
60
partiallyFillable: false,
51
61
sellTokenBalance: GPv2Order.BALANCE_ERC20,
52
62
buyTokenBalance: GPv2Order.BALANCE_ERC20
53
63
});
54
64
}
55
65
56
66
// Copied from https://github.com/InfiniFi-Labs/infinifi-protocol/blob/888c147c4d0f1848577463bc74680c86b7a5c0ff/src/integrations/farms/CoWSwapFarmBase.sol#L93C1-L102C6
57
-
// The main entry point for performing a swap via CowSwap
58
-
function _signCowSwapOrder(addresssettlementContract, GPv2Order.Data memoryorder) internalreturns (bytesmemory) {
67
+
// Takes the order structure and prepares order UID.
68
+
// This order UID must be passed to Gnosis Safe delegatecall to be called at ICowSettlement.setPreSignature(orderUid, true)
69
+
function _signCowSwapOrder(addresssettlementContract, addressowner, GPv2Order.Data memoryorder) internalreturns (PresignDeletaCallData memory) {
0 commit comments