aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/2.0.0/test/ExchangeWrapper/ExchangeWrapper.sol
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contracts/src/2.0.0/test/ExchangeWrapper/ExchangeWrapper.sol')
-rw-r--r--packages/contracts/src/2.0.0/test/ExchangeWrapper/ExchangeWrapper.sol64
1 files changed, 33 insertions, 31 deletions
diff --git a/packages/contracts/src/2.0.0/test/ExchangeWrapper/ExchangeWrapper.sol b/packages/contracts/src/2.0.0/test/ExchangeWrapper/ExchangeWrapper.sol
index 5baaf6e5a..2fa0e3c5e 100644
--- a/packages/contracts/src/2.0.0/test/ExchangeWrapper/ExchangeWrapper.sol
+++ b/packages/contracts/src/2.0.0/test/ExchangeWrapper/ExchangeWrapper.sol
@@ -16,16 +16,18 @@
*/
-pragma solidity ^0.4.24;
+pragma solidity 0.4.24;
pragma experimental ABIEncoderV2;
import "../../protocol/Exchange/interfaces/IExchange.sol";
import "../../protocol/Exchange/libs/LibOrder.sol";
+
contract ExchangeWrapper {
// Exchange contract.
- IExchange EXCHANGE;
+ // solhint-disable-next-line var-name-mixedcase
+ IExchange internal EXCHANGE;
constructor (address _exchange)
public
@@ -33,6 +35,35 @@ contract ExchangeWrapper {
EXCHANGE = IExchange(_exchange);
}
+ /// @dev Cancels all orders created by sender with a salt less than or equal to the targetOrderEpoch
+ /// and senderAddress equal to this contract.
+ /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.
+ /// @param salt Arbitrary value to gaurantee uniqueness of 0x transaction hash.
+ /// @param makerSignature Proof that maker wishes to call this function with given params.
+ function cancelOrdersUpTo(
+ uint256 targetOrderEpoch,
+ uint256 salt,
+ bytes makerSignature
+ )
+ external
+ {
+ address makerAddress = msg.sender;
+
+ // Encode arguments into byte array.
+ bytes memory data = abi.encodeWithSelector(
+ EXCHANGE.cancelOrdersUpTo.selector,
+ targetOrderEpoch
+ );
+
+ // Call `cancelOrdersUpTo` via `executeTransaction`.
+ EXCHANGE.executeTransaction(
+ salt,
+ makerAddress,
+ data,
+ makerSignature
+ );
+ }
+
/// @dev Fills an order using `msg.sender` as the taker.
/// @param order Order struct containing order specifications.
/// @param takerAssetFillAmount Desired amount of takerAsset to sell.
@@ -66,33 +97,4 @@ contract ExchangeWrapper {
takerSignature
);
}
-
- /// @dev Cancels all orders created by sender with a salt less than or equal to the targetOrderEpoch
- /// and senderAddress equal to this contract.
- /// @param targetOrderEpoch Orders created with a salt less or equal to this value will be cancelled.
- /// @param salt Arbitrary value to gaurantee uniqueness of 0x transaction hash.
- /// @param makerSignature Proof that maker wishes to call this function with given params.
- function cancelOrdersUpTo(
- uint256 targetOrderEpoch,
- uint256 salt,
- bytes makerSignature
- )
- external
- {
- address makerAddress = msg.sender;
-
- // Encode arguments into byte array.
- bytes memory data = abi.encodeWithSelector(
- EXCHANGE.cancelOrdersUpTo.selector,
- targetOrderEpoch
- );
-
- // Call `cancelOrdersUpTo` via `executeTransaction`.
- EXCHANGE.executeTransaction(
- salt,
- makerAddress,
- data,
- makerSignature
- );
- }
}