diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-07-07 02:45:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-07 02:45:06 +0800 |
commit | 1d3bdfc3746255d4dfe28eabed884c7ef23bf1d8 (patch) | |
tree | 978dd0a5132eee644d2163a33e25a24fdd4a3f14 /packages/contracts/src/2.0.0/test/ExchangeWrapper | |
parent | 16dc4e9f6606b977ea75a6bd2d444dcf060e1617 (diff) | |
parent | d2e422cd5eab26108e6c7a9f73c944f4b6fb4fdd (diff) | |
download | dexon-sol-tools-1d3bdfc3746255d4dfe28eabed884c7ef23bf1d8.tar dexon-sol-tools-1d3bdfc3746255d4dfe28eabed884c7ef23bf1d8.tar.gz dexon-sol-tools-1d3bdfc3746255d4dfe28eabed884c7ef23bf1d8.tar.bz2 dexon-sol-tools-1d3bdfc3746255d4dfe28eabed884c7ef23bf1d8.tar.lz dexon-sol-tools-1d3bdfc3746255d4dfe28eabed884c7ef23bf1d8.tar.xz dexon-sol-tools-1d3bdfc3746255d4dfe28eabed884c7ef23bf1d8.tar.zst dexon-sol-tools-1d3bdfc3746255d4dfe28eabed884c7ef23bf1d8.zip |
Merge pull request #834 from 0xProject/fix/contracts/linter
Apply linter to nested contracts
Diffstat (limited to 'packages/contracts/src/2.0.0/test/ExchangeWrapper')
-rw-r--r-- | packages/contracts/src/2.0.0/test/ExchangeWrapper/ExchangeWrapper.sol | 62 |
1 files changed, 31 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 f20e2a944..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,7 +16,7 @@ */ -pragma solidity ^0.4.24; +pragma solidity 0.4.24; pragma experimental ABIEncoderV2; import "../../protocol/Exchange/interfaces/IExchange.sol"; @@ -27,7 +27,7 @@ contract ExchangeWrapper { // Exchange contract. // solhint-disable-next-line var-name-mixedcase - IExchange EXCHANGE; + IExchange internal EXCHANGE; constructor (address _exchange) public @@ -35,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. @@ -68,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 - ); - } } |