Skip to content

Commit 13e09aa

Browse files
committed
move the cow wrapper file out of vendor, and update the docs a bit more
1 parent 242e7c5 commit 13e09aa

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

src/vendor/CowWrapper.sol renamed to src/CowWrapper.sol

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
pragma solidity >=0.7.6 <0.9.0;
33
pragma abicoder v2;
44

5+
/**
6+
* @title CoW Wrapper all-in-one integration file
7+
* @author CoW Protocol Developers
8+
* @notice This file is completely self-contained (ie no dependencies) and can be portably copied to whatever projects it is needed.
9+
* It contains:
10+
* * CowWrapper -- an abstract base contract which should be inherited by all wrappers
11+
* * ICowWrapper -- the required interface for all wrappers
12+
* * ICowSettlement -- A minimized interface and base structures for CoW Protocol settlement contract. From https://github.com/cowprotocol/contracts/blob/main/src/contracts/GPv2Settlement.sol
13+
* * ICowAuthentication -- The authentication interface used by ICowSettlement. From https://github.com/cowprotocol/contracts/blob/main/src/contracts/interfaces/GPv2Authentication.sol
14+
*/
15+
516
/// @title CoW Protocol Authentication Interface
617
/// @author CoW DAO developers
718
interface ICowAuthentication {
@@ -105,7 +116,7 @@ abstract contract CowWrapper is ICowWrapper {
105116
/// validates wrapper data, then delegates to _wrap() for custom logic.
106117
/// @param settleData ABI-encoded call to ICowSettlement.settle() containing trade data
107118
/// @param wrapperData Encoded data for this wrapper and the chain of next wrappers/settlement.
108-
/// Format: [len][wrapper-specific-data][next-address]([len][wrapper-specific-data][next-address]...)
119+
/// Format: [2-byte len][wrapper-specific-data][next-address]([2-byte len][wrapper-specific-data][next-address]...)
109120
function wrappedSettle(bytes calldata settleData, bytes calldata wrapperData) external {
110121
// Revert if not a valid solver
111122
require(AUTHENTICATOR.isSolver(msg.sender), NotASolver(msg.sender));

test/CowWrapper.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity ^0.8;
33

44
import {Test} from "forge-std/Test.sol";
5-
import {CowWrapper, ICowSettlement, ICowAuthentication} from "../src/vendor/CowWrapper.sol";
5+
import {CowWrapper, ICowSettlement, ICowAuthentication} from "../src/CowWrapper.sol";
66
import {IERC20, GPv2Trade, GPv2Interaction} from "cow/GPv2Settlement.sol";
77
import {EmptyWrapper} from "./EmptyWrapper.sol";
88

test/EmptyWrapper.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity ^0.8;
33
pragma abicoder v2;
44

5-
import {ICowSettlement, CowWrapper} from "../src/vendor/CowWrapper.sol";
5+
import {ICowSettlement, CowWrapper} from "../src/CowWrapper.sol";
66

77
contract EmptyWrapper is CowWrapper {
88
string public override name = "Empty Wrapper";

test/helpers/CowWrapperHelpers.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later
22
pragma solidity ^0.8;
33

4-
import {ICowSettlement, ICowAuthentication, ICowWrapper} from "src/vendor/CowWrapper.sol";
4+
import {ICowSettlement, ICowAuthentication, ICowWrapper} from "src/CowWrapper.sol";
55

66
library CowWrapperHelpers {
77
struct SettleCall {

0 commit comments

Comments
 (0)