From 7008e882c0508939da117cd90fe06e7006b85300 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Mon, 4 Dec 2017 13:25:01 -0800 Subject: Add version to new EtherToken, fix typos --- packages/contracts/util/artifacts.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packages/contracts/util') diff --git a/packages/contracts/util/artifacts.ts b/packages/contracts/util/artifacts.ts index b15c9216f..12321ac66 100644 --- a/packages/contracts/util/artifacts.ts +++ b/packages/contracts/util/artifacts.ts @@ -7,6 +7,7 @@ export class Artifacts { public ZRXToken: any; public DummyToken: any; public EtherToken: any; + public EtherToken_v2: any; public MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress: any; public MaliciousToken: any; constructor(artifacts: any) { @@ -18,6 +19,7 @@ export class Artifacts { this.ZRXToken = artifacts.require('ZRXToken'); this.DummyToken = artifacts.require('DummyToken'); this.EtherToken = artifacts.require('EtherToken'); + this.EtherToken_v2 = artifacts.require('EtherToken_v2'); this.MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress = artifacts.require( 'MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress'); this.MaliciousToken = artifacts.require('MaliciousToken'); -- cgit v1.2.3 From e6862e973983d478b7683425983f18b4680dd238 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Mon, 4 Dec 2017 16:58:15 -0800 Subject: Fix errors with new testrpc version --- packages/contracts/util/constants.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/contracts/util') diff --git a/packages/contracts/util/constants.ts b/packages/contracts/util/constants.ts index 5beebc68c..733ad2312 100644 --- a/packages/contracts/util/constants.ts +++ b/packages/contracts/util/constants.ts @@ -1,4 +1,5 @@ export const constants = { NULL_BYTES: '0x', INVALID_OPCODE: 'invalid opcode', + REVERT: 'revert', }; -- cgit v1.2.3 From b58bf8259db7378b841e6695d99580027b4e2969 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Tue, 5 Dec 2017 12:45:08 -0800 Subject: Add tests for ERC20Token and EtherToken_v2 --- packages/contracts/util/artifacts.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/contracts/util') diff --git a/packages/contracts/util/artifacts.ts b/packages/contracts/util/artifacts.ts index 12321ac66..cb06739af 100644 --- a/packages/contracts/util/artifacts.ts +++ b/packages/contracts/util/artifacts.ts @@ -7,7 +7,7 @@ export class Artifacts { public ZRXToken: any; public DummyToken: any; public EtherToken: any; - public EtherToken_v2: any; + public EtherTokenV2: any; public MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress: any; public MaliciousToken: any; constructor(artifacts: any) { @@ -19,7 +19,7 @@ export class Artifacts { this.ZRXToken = artifacts.require('ZRXToken'); this.DummyToken = artifacts.require('DummyToken'); this.EtherToken = artifacts.require('EtherToken'); - this.EtherToken_v2 = artifacts.require('EtherToken_v2'); + this.EtherTokenV2 = artifacts.require('EtherToken_v2'); this.MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress = artifacts.require( 'MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress'); this.MaliciousToken = artifacts.require('MaliciousToken'); -- cgit v1.2.3 From 548fda8dbaadc4827137d4b90753b306fdfd554b Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Wed, 6 Dec 2017 20:46:53 -0800 Subject: Add updated contracts, reorganize contract file structure --- packages/contracts/util/artifacts.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packages/contracts/util') diff --git a/packages/contracts/util/artifacts.ts b/packages/contracts/util/artifacts.ts index cb06739af..6b05df78c 100644 --- a/packages/contracts/util/artifacts.ts +++ b/packages/contracts/util/artifacts.ts @@ -6,6 +6,7 @@ export class Artifacts { public Exchange: any; public ZRXToken: any; public DummyToken: any; + public DummyTokenV2: any; public EtherToken: any; public EtherTokenV2: any; public MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress: any; @@ -18,6 +19,7 @@ export class Artifacts { this.Exchange = artifacts.require('Exchange'); this.ZRXToken = artifacts.require('ZRXToken'); this.DummyToken = artifacts.require('DummyToken'); + this.DummyTokenV2 = artifacts.require('DummyToken_v2'); this.EtherToken = artifacts.require('EtherToken'); this.EtherTokenV2 = artifacts.require('EtherToken_v2'); this.MultiSigWalletWithTimeLockExceptRemoveAuthorizedAddress = artifacts.require( -- cgit v1.2.3 From 2cc410e61f75a43ce36416b7d15f897d6e7fc92c Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Thu, 7 Dec 2017 00:45:41 -0800 Subject: Update 0x.js version, fix build errors --- packages/contracts/util/constants.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/contracts/util') diff --git a/packages/contracts/util/constants.ts b/packages/contracts/util/constants.ts index 733ad2312..c28a18e27 100644 --- a/packages/contracts/util/constants.ts +++ b/packages/contracts/util/constants.ts @@ -2,4 +2,5 @@ export const constants = { NULL_BYTES: '0x', INVALID_OPCODE: 'invalid opcode', REVERT: 'revert', + TESTRPC_NETWORK_ID: 50, }; -- cgit v1.2.3 From b97f140b78a0420943291af57d122bc90a488112 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Mon, 11 Dec 2017 22:47:47 -0800 Subject: Add gas limits to failing tests --- packages/contracts/util/constants.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'packages/contracts/util') diff --git a/packages/contracts/util/constants.ts b/packages/contracts/util/constants.ts index c28a18e27..e61b2f802 100644 --- a/packages/contracts/util/constants.ts +++ b/packages/contracts/util/constants.ts @@ -3,4 +3,7 @@ export const constants = { INVALID_OPCODE: 'invalid opcode', REVERT: 'revert', TESTRPC_NETWORK_ID: 50, + MAX_ETHERTOKEN_WITHDRAW_GAS: 43000, + MAX_TOKEN_TRANSFERFROM_GAS: 80000, + MAX_TOKEN_APPROVE_GAS: 60000, }; -- cgit v1.2.3 From cb596c1413938ce23901135f8235bb813cc6e784 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 8 Dec 2017 18:01:40 +0300 Subject: Move more shared utils into utils package and reuse them --- packages/contracts/util/balances.ts | 2 +- packages/contracts/util/bignumber_config.ts | 11 -------- packages/contracts/util/rpc.ts | 43 ----------------------------- 3 files changed, 1 insertion(+), 55 deletions(-) delete mode 100644 packages/contracts/util/bignumber_config.ts delete mode 100644 packages/contracts/util/rpc.ts (limited to 'packages/contracts/util') diff --git a/packages/contracts/util/balances.ts b/packages/contracts/util/balances.ts index fce15db6d..7f5e843a5 100644 --- a/packages/contracts/util/balances.ts +++ b/packages/contracts/util/balances.ts @@ -1,7 +1,7 @@ +import {bigNumberConfigs} from '@0xproject/utils'; import {BigNumber} from 'bignumber.js'; import * as _ from 'lodash'; -import {bigNumberConfigs} from './bignumber_config'; import {BalancesByOwner, ContractInstance} from './types'; bigNumberConfigs.configure(); diff --git a/packages/contracts/util/bignumber_config.ts b/packages/contracts/util/bignumber_config.ts deleted file mode 100644 index 38f59d341..000000000 --- a/packages/contracts/util/bignumber_config.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {BigNumber} from 'bignumber.js'; - -export const bigNumberConfigs = { - configure() { - // By default BigNumber's `toString` method converts to exponential notation if the value has - // more then 20 digits. We want to avoid this behavior, so we set EXPONENTIAL_AT to a high number - BigNumber.config({ - EXPONENTIAL_AT: 1000, - }); - }, -}; diff --git a/packages/contracts/util/rpc.ts b/packages/contracts/util/rpc.ts deleted file mode 100644 index 023602bd6..000000000 --- a/packages/contracts/util/rpc.ts +++ /dev/null @@ -1,43 +0,0 @@ -import 'isomorphic-fetch'; - -import * as truffleConf from '../truffle.js'; - -export class RPC { - private host: string; - private port: number; - private id: number; - constructor() { - this.host = truffleConf.networks.development.host; - this.port = truffleConf.networks.development.port; - this.id = 0; - } - public async increaseTimeAsync(time: number) { - const method = 'evm_increaseTime'; - const params = [time]; - const payload = this.toPayload(method, params); - return this.sendAsync(payload); - } - public async mineBlockAsync() { - const method = 'evm_mine'; - const payload = this.toPayload(method); - return this.sendAsync(payload); - } - private toPayload(method: string, params: any[] = []) { - const payload = JSON.stringify({ - id: this.id, - method, - params, - }); - this.id++; - return payload; - } - private async sendAsync(payload: string): Promise { - const opts = { - method: 'POST', - body: payload, - }; - const response = await fetch(`http://${this.host}:${this.port}`, opts); - const responsePayload = await response.json(); - return responsePayload; - } -} -- cgit v1.2.3 From 126048bac9f52871b841d9898cabe7cfd265ebb6 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 15 Dec 2017 13:58:30 +0100 Subject: Fix connect unused vars --- packages/contracts/util/crypto.ts | 1 - 1 file changed, 1 deletion(-) (limited to 'packages/contracts/util') diff --git a/packages/contracts/util/crypto.ts b/packages/contracts/util/crypto.ts index 5253b8c15..2e43ae816 100644 --- a/packages/contracts/util/crypto.ts +++ b/packages/contracts/util/crypto.ts @@ -1,4 +1,3 @@ -import {BigNumber} from 'bignumber.js'; import BN = require('bn.js'); import ABI = require('ethereumjs-abi'); import ethUtil = require('ethereumjs-util'); -- cgit v1.2.3