Skip to content

Commit 5e3e4ee

Browse files
committed
pull in upstream requirements
these changes are ultimately requierd for use in the wrappers later, and they are generally good to have for any wrappers in the future.
1 parent 9bac22f commit 5e3e4ee

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

src/CowWrapper.sol

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,16 @@ interface ICowSettlement {
4949
}
5050

5151
/// @notice Returns the authentication contract used by the settlement contract.
52-
function authenticator() external returns (ICowAuthentication);
52+
function authenticator() external view returns (ICowAuthentication);
53+
54+
/// @notice Returns the address of the vaultRelayer, the target for approvals for funds entering the settlement contract.
55+
function vaultRelayer() external view returns (address);
56+
57+
/// @notice Returns the domain separator for EIP-712 signing
58+
function domainSeparator() external view returns (bytes32);
59+
60+
/// @notice Allows for approval of orders by submitting an authorized hash on-chain prior to order execution.
61+
function setPreSignature(bytes calldata orderUid, bool signed) external;
5362

5463
/// @notice Settles a batch of trades atomically
5564
/// @param tokens Array of token addresses involved in the settlement
@@ -71,6 +80,10 @@ interface ICowWrapper {
7180
/// @notice A human readable label for this wrapper. Used for display in explorer/analysis UIs
7281
function name() external view returns (string memory);
7382

83+
/// @notice The settlement contract used by this wrapper
84+
/// @return The CowSettlement contract address
85+
function SETTLEMENT() external view returns (ICowSettlement);
86+
7487
/// @notice Initiates a wrapped settlement call
7588
/// @dev This is the entry point for wrapped settlements. The wrapper will execute custom logic
7689
/// before calling the next wrapper or settlement contract in the chain.

test/unit/mocks/MockCowProtocol.sol

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pragma solidity ^0.8;
33

44
import {ICowSettlement, ICowAuthentication, CowWrapper} from "../../../src/CowWrapper.sol";
55

6-
/// @title MockICowAuthentication
6+
/// @title MockCowAuthentication
77
/// @notice Mock implementation of CoW Protocol authenticator for unit testing
88
contract MockCowAuthentication is ICowAuthentication {
99
mapping(address => bool) public solvers;
@@ -17,7 +17,7 @@ contract MockCowAuthentication is ICowAuthentication {
1717
}
1818
}
1919

20-
/// @title MockICowSettlement
20+
/// @title MockCowSettlement
2121
/// @notice Mock implementation of CoW Protocol settlement contract for unit testing
2222
contract MockCowSettlement is ICowSettlement {
2323
ICowAuthentication public immutable AUTH;
@@ -31,22 +31,22 @@ contract MockCowSettlement is ICowSettlement {
3131
return AUTH;
3232
}
3333

34-
function vaultRelayer() external pure returns (address) {
34+
function vaultRelayer() external pure override returns (address) {
3535
return address(0x7777);
3636
}
3737

38-
function domainSeparator() external pure returns (bytes32) {
38+
function domainSeparator() external pure override returns (bytes32) {
3939
return keccak256("MockDomainSeparator");
4040
}
4141

42-
function setPreSignature(bytes calldata, bool) external pure {}
42+
function setPreSignature(bytes calldata, bool) external pure override {}
4343

4444
function settle(address[] calldata, uint256[] calldata, Trade[] calldata, Interaction[][3] calldata)
4545
external
4646
view
4747
override
4848
{
49-
require(shouldSucceed, "MockICowSettlement: settle failed");
49+
require(shouldSucceed, "MockCowSettlement: settle failed");
5050
}
5151

5252
function setSuccessfulSettle(bool success) external {
@@ -55,7 +55,7 @@ contract MockCowSettlement is ICowSettlement {
5555
}
5656

5757
contract MockWrapper is CowWrapper {
58-
string public constant name = "Mock Wrapper";
58+
string public override name = "Mock Wrapper";
5959
uint256 public consumeBytes;
6060

6161
constructor(ICowSettlement settlement_, uint256 consumeBytes_) CowWrapper(settlement_) {

0 commit comments

Comments
 (0)