Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1827 from 0xProject/feat/3.0/cancelOrdersNothrow
Browse files Browse the repository at this point in the history
Implement `cancelOrderNoThrow` and `batchCancelOrdersNoThrow`
  • Loading branch information
abandeali1 authored May 21, 2019
2 parents 2a28fcc + 1e7e566 commit 10d3539
Show file tree
Hide file tree
Showing 13 changed files with 169 additions and 262 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import "./DummyERC20Token.sol";


// solhint-disable no-empty-blocks
// solhint-disable no-unused-vars
contract UntransferrableDummyERC20Token is
DummyERC20Token
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ pragma experimental ABIEncoderV2;

import "./libs/LibConstants.sol";
import "./mixins/MExchangeWrapper.sol";
import "@0x/contracts-exchange-libs/contracts/src/LibAbiEncoder.sol";
import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
import "@0x/contracts-exchange-libs/contracts/src/LibFillResults.sol";
import "@0x/contracts-exchange-libs/contracts/src/LibMath.sol";
import "@0x/contracts-exchange-libs/contracts/src/LibExchangeSelectors.sol";


contract MixinExchangeWrapper is
LibAbiEncoder,
LibFillResults,
LibMath,
LibConstants,
LibExchangeSelectors,
MExchangeWrapper
{
/// @dev Fills the input order.
Expand All @@ -49,7 +49,8 @@ contract MixinExchangeWrapper is
returns (FillResults memory fillResults)
{
// ABI encode calldata for `fillOrder`
bytes memory fillOrderCalldata = _abiEncodeFillOrder(
bytes memory fillOrderCalldata = abi.encodeWithSelector(
FILL_ORDER_SELECTOR,
order,
takerAssetFillAmount,
signature
Expand Down
1 change: 0 additions & 1 deletion contracts/exchange-libs/compiler.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
}
},
"contracts": [
"src/LibAbiEncoder.sol",
"src/LibConstants.sol",
"src/LibEIP712ExchangeDomain.sol",
"src/LibFillResults.sol",
Expand Down
215 changes: 0 additions & 215 deletions contracts/exchange-libs/contracts/src/LibAbiEncoder.sol

This file was deleted.

21 changes: 1 addition & 20 deletions contracts/exchange-libs/contracts/test/TestLibs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,20 @@ import "../src/LibEIP712ExchangeDomain.sol";
import "../src/LibMath.sol";
import "../src/LibOrder.sol";
import "../src/LibFillResults.sol";
import "../src/LibAbiEncoder.sol";


// solhint-disable no-empty-blocks
contract TestLibs is
LibEIP712ExchangeDomain,
LibMath,
LibOrder,
LibFillResults,
LibAbiEncoder
LibFillResults
{
constructor (uint256 chainId)
public
LibEIP712ExchangeDomain(chainId, address(0))
{}

function abiEncodeFillOrder(
Order memory order,
uint256 takerAssetFillAmount,
bytes memory signature
)
public
pure
returns (bytes memory fillOrderCalldata)
{
fillOrderCalldata = _abiEncodeFillOrder(
order,
takerAssetFillAmount,
signature
);
return fillOrderCalldata;
}

function getPartialAmountFloor(
uint256 numerator,
uint256 denominator,
Expand Down
2 changes: 1 addition & 1 deletion contracts/exchange-libs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
},
"config": {
"abis": "./generated-artifacts/@(LibAbiEncoder|LibAssetProxyErrors|LibConstants|LibEIP712ExchangeDomain|LibFillResults|LibMath|LibOrder|LibZeroExTransaction|TestLibs).json",
"abis": "./generated-artifacts/@(LibAssetProxyErrors|LibConstants|LibEIP712ExchangeDomain|LibFillResults|LibMath|LibOrder|LibZeroExTransaction|TestLibs).json",
"abis:comment": "This list is auto-generated by contracts-gen. Don't edit manually."
},
"repository": {
Expand Down
2 changes: 0 additions & 2 deletions contracts/exchange-libs/src/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
import { ContractArtifact } from 'ethereum-types';

import * as LibAbiEncoder from '../generated-artifacts/LibAbiEncoder.json';
import * as LibConstants from '../generated-artifacts/LibConstants.json';
import * as LibEIP712ExchangeDomain from '../generated-artifacts/LibEIP712ExchangeDomain.json';
import * as LibFillResults from '../generated-artifacts/LibFillResults.json';
Expand All @@ -14,7 +13,6 @@ import * as LibOrder from '../generated-artifacts/LibOrder.json';
import * as LibZeroExTransaction from '../generated-artifacts/LibZeroExTransaction.json';
import * as TestLibs from '../generated-artifacts/TestLibs.json';
export const artifacts = {
LibAbiEncoder: LibAbiEncoder as ContractArtifact,
LibConstants: LibConstants as ContractArtifact,
LibFillResults: LibFillResults as ContractArtifact,
LibMath: LibMath as ContractArtifact,
Expand Down
1 change: 0 additions & 1 deletion contracts/exchange-libs/src/wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Warning: This file is auto-generated by contracts-gen. Don't edit manually.
* -----------------------------------------------------------------------------
*/
export * from '../generated-wrappers/lib_abi_encoder';
export * from '../generated-wrappers/lib_constants';
export * from '../generated-wrappers/lib_e_i_p712_exchange_domain';
export * from '../generated-wrappers/lib_fill_results';
Expand Down
1 change: 0 additions & 1 deletion contracts/exchange-libs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"compilerOptions": { "outDir": "lib", "rootDir": ".", "resolveJsonModule": true },
"include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"],
"files": [
"generated-artifacts/LibAbiEncoder.json",
"generated-artifacts/LibConstants.json",
"generated-artifacts/LibEIP712ExchangeDomain.json",
"generated-artifacts/LibFillResults.json",
Expand Down
Loading

0 comments on commit 10d3539

Please sign in to comment.