aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/utils
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-03-08 08:06:38 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-04-21 04:56:16 +0800
commit7b166837d3ded48874042347d356dc7e4e02f2c1 (patch)
tree01a112d68fa96408104feac985e8089702b09f81 /packages/contracts/src/utils
parent3ff8a319c5460caaf9edc1bea68e807fe0611aaa (diff)
downloaddexon-sol-tools-7b166837d3ded48874042347d356dc7e4e02f2c1.tar
dexon-sol-tools-7b166837d3ded48874042347d356dc7e4e02f2c1.tar.gz
dexon-sol-tools-7b166837d3ded48874042347d356dc7e4e02f2c1.tar.bz2
dexon-sol-tools-7b166837d3ded48874042347d356dc7e4e02f2c1.tar.lz
dexon-sol-tools-7b166837d3ded48874042347d356dc7e4e02f2c1.tar.xz
dexon-sol-tools-7b166837d3ded48874042347d356dc7e4e02f2c1.tar.zst
dexon-sol-tools-7b166837d3ded48874042347d356dc7e4e02f2c1.zip
Add script for starting testrpc with preconfigured private keys
Diffstat (limited to 'packages/contracts/src/utils')
-rw-r--r--packages/contracts/src/utils/constants.ts22
-rw-r--r--packages/contracts/src/utils/utils.ts7
2 files changed, 29 insertions, 0 deletions
diff --git a/packages/contracts/src/utils/constants.ts b/packages/contracts/src/utils/constants.ts
index d1152e683..09dd65653 100644
--- a/packages/contracts/src/utils/constants.ts
+++ b/packages/contracts/src/utils/constants.ts
@@ -1,3 +1,5 @@
+import * as ethUtil from 'ethereumjs-util';
+
const DUMMY_TOKEN_NAME = '';
const DUMMY_TOKEN_SYMBOL = '';
const DUMMY_TOKEN_DECIMALS = 18;
@@ -11,4 +13,24 @@ export const constants = {
MAX_TOKEN_TRANSFERFROM_GAS: 80000,
MAX_TOKEN_APPROVE_GAS: 60000,
DUMMY_TOKEN_ARGS: [DUMMY_TOKEN_NAME, DUMMY_TOKEN_SYMBOL, DUMMY_TOKEN_DECIMALS, DUMMY_TOKEN_TOTAL_SUPPLY],
+ TESTRPC_PORT: 8545,
+ TESTRPC_INITIAL_BALANCE_HEX: parseInt('100000000000000000000', 16),
+ TESTRPC_ACCOUNTS: [
+ {
+ balance: this.TESTRPC_INITIAL_BALANCE_HEX,
+ secretKey: ethUtil.sha3('secret0'),
+ },
+ {
+ balance: this.TESTRPC_INITIAL_BALANCE_HEX,
+ secretKey: ethUtil.sha3('secret1'),
+ },
+ {
+ balance: this.TESTRPC_INITIAL_BALANCE_HEX,
+ secretKey: ethUtil.sha3('secret2'),
+ },
+ {
+ balance: this.TESTRPC_INITIAL_BALANCE_HEX,
+ secretKey: ethUtil.sha3('secret3'),
+ },
+ ],
};
diff --git a/packages/contracts/src/utils/utils.ts b/packages/contracts/src/utils/utils.ts
new file mode 100644
index 000000000..04ac36b54
--- /dev/null
+++ b/packages/contracts/src/utils/utils.ts
@@ -0,0 +1,7 @@
+export const utils = {
+ consoleLog(message: string): void {
+ /* tslint:disable */
+ console.log(message);
+ /* tslint:enable */
+ },
+};