aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-03-03 07:54:09 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-04-21 04:56:16 +0800
commitd2be2ee6cd7fd92008404b0260fe665c4e51af9e (patch)
tree594b4a8cd220c34e750903aa72e382647efe7851 /packages/contracts
parent7d63c5d982236b635e5ad4bd96a9c3cd982772e4 (diff)
downloaddexon-sol-tools-d2be2ee6cd7fd92008404b0260fe665c4e51af9e.tar
dexon-sol-tools-d2be2ee6cd7fd92008404b0260fe665c4e51af9e.tar.gz
dexon-sol-tools-d2be2ee6cd7fd92008404b0260fe665c4e51af9e.tar.bz2
dexon-sol-tools-d2be2ee6cd7fd92008404b0260fe665c4e51af9e.tar.lz
dexon-sol-tools-d2be2ee6cd7fd92008404b0260fe665c4e51af9e.tar.xz
dexon-sol-tools-d2be2ee6cd7fd92008404b0260fe665c4e51af9e.tar.zst
dexon-sol-tools-d2be2ee6cd7fd92008404b0260fe665c4e51af9e.zip
Fix compile errors
Diffstat (limited to 'packages/contracts')
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol18
-rw-r--r--packages/contracts/src/contracts/previous/Arbitrage/Arbitrage.sol (renamed from packages/contracts/src/contracts/current/tutorials/Arbitrage/Arbitrage.sol)6
-rw-r--r--packages/contracts/src/contracts/previous/EtherDelta/AccountLevels.sol (renamed from packages/contracts/src/contracts/current/tutorials/EtherDelta/AccountLevels.sol)0
-rw-r--r--packages/contracts/src/contracts/previous/EtherDelta/EtherDelta.sol (renamed from packages/contracts/src/contracts/current/tutorials/EtherDelta/EtherDelta.sol)0
-rw-r--r--packages/contracts/test/exchange/core.ts8
-rw-r--r--packages/contracts/test/tutorials/arbitrage.ts12
6 files changed, 22 insertions, 22 deletions
diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol
index a2a168656..97573a7ed 100644
--- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol
+++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinWrapperFunctions.sol
@@ -86,7 +86,7 @@ contract MixinWrapperFunctions is
// Allocate memory for input
uint256 signatureLength = signature.length;
- uint256 paddingLength = (32 - signatureLength) % 32
+ uint256 paddingLength = (32 - signatureLength) % 32;
uint256 inputSize = 452 + signatureLength + paddingLength;
bytes memory input = new bytes(inputSize);
@@ -106,7 +106,7 @@ contract MixinWrapperFunctions is
// is stored by value as 256-bit and right-padded with zeros.
bytes4 FILL_ORDER_FUNCTION_SIGNATURE = bytes4(keccak256("fillOrder(address[5],uint256[6],uint256,uint8,bytes32,bytes32)"));
assembly {
- mstore(start, FILL_ORDER_FUNCTION_SIGNATURE);
+ mstore(start, FILL_ORDER_FUNCTION_SIGNATURE)
}
// Write orderAddresses, orderValues, takerTokenFillAmount,
@@ -135,7 +135,7 @@ contract MixinWrapperFunctions is
for (uint256 i = 0; i < signatureLength; i++) {
input[452 + i] = signature[i];
}
- for (uint256 i = 0; i < paddingLength; i++) {
+ for (i = 0; i < paddingLength; i++) {
input[452 + signatureLength + i] = 0x00;
}
@@ -166,7 +166,7 @@ contract MixinWrapperFunctions is
uint256[6][] orderValues,
uint256[] takerTokenFillAmounts,
bytes[] signatures)
- external
+ public
{
for (uint256 i = 0; i < orderAddresses.length; i++) {
fillOrder(
@@ -188,7 +188,7 @@ contract MixinWrapperFunctions is
uint[6][] orderValues,
uint[] takerTokenFillAmounts,
bytes[] signatures)
- external
+ public
{
for (uint256 i = 0; i < orderAddresses.length; i++) {
fillOrKillOrder(
@@ -203,14 +203,14 @@ contract MixinWrapperFunctions is
/// @dev Fills an order with specified parameters and ECDSA signature. Returns false if the transaction would otherwise revert.
/// @param orderAddresses Array of order's maker, taker, makerToken, takerToken, and feeRecipient.
/// @param orderValues Array of order's makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, and salt.
- /// @param takerTokenFillAmount Desired amount of takerToken to fill.
+ /// @param takerTokenFillAmounts Array of desired amounts of takerToken to fill in orders.
/// @param signatures Maker's signatures of the orders.
function batchFillOrdersNoThrow(
address[5][] orderAddresses,
uint[6][] orderValues,
uint[] takerTokenFillAmounts,
bytes[] signatures)
- external
+ public
{
for (uint256 i = 0; i < orderAddresses.length; i++) {
fillOrderNoThrow(
@@ -233,7 +233,7 @@ contract MixinWrapperFunctions is
uint256[6][] orderValues,
uint256 takerTokenFillAmount,
bytes[] signatures)
- external
+ public
returns (uint256 totalTakerTokenFilledAmount)
{
for (uint256 i = 0; i < orderAddresses.length; i++) {
@@ -260,7 +260,7 @@ contract MixinWrapperFunctions is
uint256[6][] orderValues,
uint256 takerTokenFillAmount,
bytes[] signatures)
- external
+ public
returns (uint256 totalTakerTokenFilledAmount)
{
for (uint256 i = 0; i < orderAddresses.length; i++) {
diff --git a/packages/contracts/src/contracts/current/tutorials/Arbitrage/Arbitrage.sol b/packages/contracts/src/contracts/previous/Arbitrage/Arbitrage.sol
index a9f3c22e6..5054afc2f 100644
--- a/packages/contracts/src/contracts/current/tutorials/Arbitrage/Arbitrage.sol
+++ b/packages/contracts/src/contracts/previous/Arbitrage/Arbitrage.sol
@@ -1,9 +1,9 @@
pragma solidity ^0.4.19;
-import { Exchange } from "../../protocol/Exchange/Exchange.sol";
+import { IExchange_v1 as Exchange } from "../Exchange/IExchange_v1.sol";
import { EtherDelta } from "../EtherDelta/EtherDelta.sol";
-import { Ownable } from "../../utils/Ownable/Ownable.sol";
-import { Token } from "../../tokens/Token/Token.sol";
+import { Ownable_v1 as Ownable } from "../Ownable/Ownable_v1.sol";
+import { IToken_v1 as Token } from "../Token/IToken_v1.sol";
/// @title Arbitrage - Facilitates atomic arbitrage of ERC20 tokens between EtherDelta and 0x Exchange contract.
/// @author Leonid Logvinov - <leo@0xProject.com>
diff --git a/packages/contracts/src/contracts/current/tutorials/EtherDelta/AccountLevels.sol b/packages/contracts/src/contracts/previous/EtherDelta/AccountLevels.sol
index 8d7a930d3..8d7a930d3 100644
--- a/packages/contracts/src/contracts/current/tutorials/EtherDelta/AccountLevels.sol
+++ b/packages/contracts/src/contracts/previous/EtherDelta/AccountLevels.sol
diff --git a/packages/contracts/src/contracts/current/tutorials/EtherDelta/EtherDelta.sol b/packages/contracts/src/contracts/previous/EtherDelta/EtherDelta.sol
index 49847ab48..49847ab48 100644
--- a/packages/contracts/src/contracts/current/tutorials/EtherDelta/EtherDelta.sol
+++ b/packages/contracts/src/contracts/previous/EtherDelta/EtherDelta.sol
diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts
index e21879c9e..c7724c511 100644
--- a/packages/contracts/test/exchange/core.ts
+++ b/packages/contracts/test/exchange/core.ts
@@ -689,7 +689,7 @@ describe('Exchange', () => {
const res = await exWrapper.fillOrderAsync(signedOrder, taker);
expect(res.logs).to.have.length(1);
const log = res.logs[0] as LogWithDecodedArgs<LogErrorContractEventArgs>;
- const errCode = log.args.errorId.toNumber();
+ const errCode = log.args.errorId;
expect(errCode).to.be.equal(ExchangeContractErrs.ERROR_ORDER_EXPIRED);
});
@@ -700,7 +700,7 @@ describe('Exchange', () => {
const res = await exWrapper.fillOrderAsync(signedOrder, taker);
expect(res.logs).to.have.length(1);
const log = res.logs[0] as LogWithDecodedArgs<LogErrorContractEventArgs>;
- const errCode = log.args.errorId.toNumber();
+ const errCode = log.args.errorId;
expect(errCode).to.be.equal(ExchangeContractErrs.ERROR_ORDER_FULLY_FILLED_OR_CANCELLED);
});
});
@@ -827,7 +827,7 @@ describe('Exchange', () => {
const res = await exWrapper.cancelOrderAsync(signedOrder, maker);
expect(res.logs).to.have.length(1);
const log = res.logs[0] as LogWithDecodedArgs<LogErrorContractEventArgs>;
- const errCode = log.args.errorId.toNumber();
+ const errCode = log.args.errorId;
expect(errCode).to.be.equal(ExchangeContractErrs.ERROR_ORDER_FULLY_FILLED_OR_CANCELLED);
});
@@ -839,7 +839,7 @@ describe('Exchange', () => {
const res = await exWrapper.cancelOrderAsync(signedOrder, maker);
expect(res.logs).to.have.length(1);
const log = res.logs[0] as LogWithDecodedArgs<LogErrorContractEventArgs>;
- const errCode = log.args.errorId.toNumber();
+ const errCode = log.args.errorId;
expect(errCode).to.be.equal(ExchangeContractErrs.ERROR_ORDER_EXPIRED);
});
});
diff --git a/packages/contracts/test/tutorials/arbitrage.ts b/packages/contracts/test/tutorials/arbitrage.ts
index ad83bbca3..8a6d02af4 100644
--- a/packages/contracts/test/tutorials/arbitrage.ts
+++ b/packages/contracts/test/tutorials/arbitrage.ts
@@ -9,12 +9,12 @@ import * as Web3 from 'web3';
import { ArbitrageContract } from '../../src/contract_wrappers/generated/arbitrage';
import { EtherDeltaContract } from '../../src/contract_wrappers/generated/ether_delta';
import { ExchangeContract } from '../../src/contract_wrappers/generated/exchange';
-import { Balances } from '../../util/balances';
-import { constants } from '../../util/constants';
-import { crypto } from '../../util/crypto';
-import { ExchangeWrapper } from '../../util/exchange_wrapper';
-import { OrderFactory } from '../../util/order_factory';
-import { BalancesByOwner, ContractName, ExchangeContractErrs } from '../../util/types';
+import { Balances } from '../../src/utils/balances';
+import { constants } from '../../src/utils/constants';
+import { crypto } from '../../src/utils/crypto';
+import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
+import { OrderFactory } from '../../src/utils/order_factory';
+import { BalancesByOwner, ContractName, ExchangeContractErrs } from '../../src/utils/types';
import { chaiSetup } from '../utils/chai_setup';
import { deployer } from '../utils/deployer';
import { provider, web3Wrapper } from '../utils/web3_wrapper';