-
Notifications
You must be signed in to change notification settings - Fork 0
/
generation-sc-committee.js
129 lines (103 loc) · 34.8 KB
/
generation-sc-committee.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
const fs = require('fs')
const Wallet = require('ethereumjs-wallet')
const EthereumTx = require('ethereumjs-tx').Transaction
const Common = require('ethereumjs-common')
// Sample params, can change to do with arguments
const NUMTX = 1
//const destinationAcccount = "0xBce16ea55bB357B038e612b1722A88879c665a31"
const startBalance = "0xfffc3b15f9926687d2c40534fdb564000000000000"
//var CONTRACTABI = eth.contract([{"constant":false,"inputs":[],"name":"Hello","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"message","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"}]);
var CONTRACTDATA = "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060006010819055506000601d81905550613e3c806100706000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80632e4176cf146100515780637816a3a11461006f5780639fe9d5781461009f578063b66cab3e146100bb575b600080fd5b6100596100d7565b604051610066919061322f565b60405180910390f35b6100896004803603810190610084919061328a565b6100fb565b6040516100969190613347565b60405180910390f35b6100b960048036038101906100b491906133ce565b6101a7565b005b6100d560048036038101906100d0919061341b565b610c9f565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6008818154811061010b57600080fd5b9060005260206000200160009150905080546101269061348a565b80601f01602080910402602001604051908101604052809291908181526020018280546101529061348a565b801561019f5780601f106101745761010080835404028352916020019161019f565b820191906000526020600020905b81548152906001019060200180831161018257829003601f168201915b505050505081565b60005b8282905081101561032a576004600060105481526020019081526020016000208383838181106101dd576101dc6134bb565b5b90506020028101906101ef91906134f9565b90918060018154018082558091505060019003906000526020600020016000909192909192909192909192509182610228929190613742565b50600060058484848181106102405761023f6134bb565b5b905060200281019061025291906134f9565b604051610260929190613851565b9081526020016040518091039020819055506000600d848484818110610289576102886134bb565b5b905060200281019061029b91906134f9565b6040516102a9929190613851565b9081526020016040518091039020819055506000601f8484848181106102d2576102d16134bb565b5b90506020028101906102e491906134f9565b6040516102f2929190613851565b908152602001604051809103902060006101000a81548160ff021916908315150217905550808061032290613899565b9150506101aa565b506000600460006010548152602001908152602001600020805490501461036157600160105461035a91906138e1565b6010819055505b60115460105403610c9b5760005b6010548110156103a55760006007600083815260200190815260200160002081905550808061039d90613899565b91505061036f565b506000601b81905550600060198190555060005b601054811015610483576001600560046000848152602001908152602001600020601b54815481106103ee576103ed6134bb565b5b906000526020600020016040516104059190613998565b90815260200160405180910390205461041e91906138e1565b600560046000848152602001908152602001600020601b5481548110610447576104466134bb565b5b9060005260206000200160405161045e9190613998565b908152602001604051809103902081905550808061047b90613899565b9150506103b9565b505b600c5460088054905010801561049e5750601254601b54105b15610714576000601e60036101000a81548160ff0219169083151502179055506000601e60016101000a81548160ff0219169083151502179055506000601e60026101000a81548160ff0219169083151502179055506104fc610e09565b601e60006101000a81548160ff02191690831515021790555060011515601e60009054906101000a900460ff1615150361054c576001601e60036101000a81548160ff0219169083151502179055505b60001515601e60039054906101000a900460ff161515036106e157620186a060188190555060005b6010548110156106d75760006007600060105481526020019081526020016000205490505b6012548110156106c35760185460056004600085815260200190815260200160002083815481106105cd576105cc6134bb565b5b906000526020600020016040516105e49190613998565b9081526020016040518091039020541080156106575750601f600460008481526020019081526020016000208281548110610622576106216134bb565b5b906000526020600020016040516106399190613998565b908152602001604051809103902060009054906101000a900460ff16155b156106b0576005600460008481526020019081526020016000208281548110610683576106826134bb565b5b9060005260206000200160405161069a9190613998565b9081526020016040518091039020546018819055505b80806106bb90613899565b915050610599565b5080806106cf90613899565b915050610574565b506106e06121a1565b5b600c546019546012546106f491906139af565b0315610714576001601b5461070991906138e1565b601b81905550610485565b61071c612ff8565b6018819055505b600c5460195460125461073691906139af565b11156108c85760005b6010548110156108c25760005b6012548110156108ae5760185460056004600085815260200190815260200160002083815481106107805761077f6134bb565b5b906000526020600020016040516107979190613998565b9081526020016040518091039020541480156107c35750600c546019546012546107c191906139af565b115b801561081e57506298968060056004600085815260200190815260200160002083815481106107f5576107f46134bb565b5b9060005260206000200160405161080c9190613998565b90815260200160405180910390205414155b1561089b5762989680600560046000858152602001908152602001600020838154811061084e5761084d6134bb565b5b906000526020600020016040516108659190613998565b908152602001604051809103902081905550600160195461088691906138e1565b601981905550610894612ff8565b6018819055505b80806108a690613899565b91505061074c565b5080806108ba90613899565b91505061073f565b50610723565b600c546019546012546108db91906139af565b03610ab95760005b601054811015610ab75760005b601254811015610aa357629896806005600460008581526020019081526020016000208381548110610925576109246134bb565b5b9060005260206000200160405161093c9190613998565b908152602001604051809103902054141580156109b05750601f60046000848152602001908152602001600020828154811061097b5761097a6134bb565b5b906000526020600020016040516109929190613998565b908152602001604051809103902060009054906101000a900460ff16155b80156109c25750600c54600880549050105b15610a905760086004600084815260200190815260200160002082815481106109ee576109ed6134bb565b5b90600052602060002001908060018154018082558091505060019003906000526020600020016000909190919091509081610a299190613a0e565b506001601f600460008581526020019081526020016000208381548110610a5357610a526134bb565b5b90600052602060002001604051610a6a9190613998565b908152602001604051809103902060006101000a81548160ff0219169083151502179055505b8080610a9b90613899565b9150506108f0565b508080610aaf90613899565b9150506108e3565b505b7f2926d6ae08a4bf728bae76cc3399da96b2a9e3f6309d697ee4587a730b40de086008604051610ae99190613c51565b60405180910390a160005b601054811015610c225760005b6004600083815260200190815260200160002080549050811015610bd65760006005600460008581526020019081526020016000208381548110610b4857610b476134bb565b5b90600052602060002001604051610b5f9190613998565b9081526020016040518091039020819055506000600d600460008581526020019081526020016000208381548110610b9a57610b996134bb565b5b90600052602060002001604051610bb19190613998565b9081526020016040518091039020819055508080610bce90613899565b915050610b01565b5060006007600083815260200190815260200160002081905550600460008281526020019081526020016000206000610c0f919061314c565b8080610c1a90613899565b915050610af4565b5060086000610c31919061314c565b60006019819055506000601b8190555060006010819055506000601e60036101000a81548160ff0219169083151502179055506000601e60016101000a81548160ff0219169083151502179055506000601e60026101000a81548160ff0219169083151502179055505b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490613cf6565b60405180910390fd5b81601281905550600481610d419190613d45565b600c819055506004601254610d569190613d45565b601c819055506008601254610d6b9190613d45565b60128190555060036001601c54610d8291906139af565b610d8c9190613d45565b601c54610d9991906139af565b6011819055507f2b30d2b80fdecff66de1db81aa5d7ebbb3bf5b32053bb19b5d548169edadd750601154604051610dd09190613d85565b60405180910390a1600180600c54610de891906138e1565b601154610df59190613d45565b610dff91906138e1565b6017819055505050565b600080600090505b601054811015610f075760005b6004600083815260200190815260200160002080549050811015610ef3576000600d600460008581526020019081526020016000208381548110610e6557610e646134bb565b5b90600052602060002001604051610e7c9190613998565b9081526020016040518091039020819055506000600e600460008581526020019081526020016000208381548110610eb757610eb66134bb565b5b90600052602060002001604051610ece9190613998565b9081526020016040518091039020819055508080610eeb90613899565b915050610e1e565b508080610eff90613899565b915050610e11565b5060005b600b80549050811015610f6257600060066000600b8481548110610f3257610f316134bb565b5b90600052602060002001548152602001908152602001600020819055508080610f5a90613899565b915050610f0b565b5060096000610f71919061314c565b6000601e60036101000a81548160ff0219169083151502179055506000601e60016101000a81548160ff021916908315150217905550600c54600880549050101561218c5760005b6010548110156113aa576000600760008381526020019081526020016000205490505b6012548110156113965760175460056004600085815260200190815260200160002083815481106110105761100f6134bb565b5b906000526020600020016040516110279190613998565b90815260200160405180910390205410158015611093575062989680600560046000858152602001908152602001600020838154811061106a576110696134bb565b5b906000526020600020016040516110819190613998565b90815260200160405180910390205414155b80156110fc575060001515601f6004600085815260200190815260200160002083815481106110c5576110c46134bb565b5b906000526020600020016040516110dc9190613998565b908152602001604051809103902060009054906101000a900460ff161515145b15611383576001601f60046000858152602001908152602001600020838154811061112a576111296134bb565b5b906000526020600020016040516111419190613998565b908152602001604051809103902060006101000a81548160ff021916908315150217905550600860046000848152602001908152602001600020828154811061118d5761118c6134bb565b5b906000526020600020019080600181540180825580915050600190039060005260206000200160009091909190915090816111c89190613a0e565b506001601e60036101000a81548160ff021916908315150217905550601754600560046000858152602001908152602001600020838154811061120e5761120d6134bb565b5b906000526020600020016040516112259190613998565b90815260200160405180910390205461123e91906139af565b601481905550601754600560046000858152602001908152602001600020838154811061126e5761126d6134bb565b5b906000526020600020016040516112859190613998565b908152602001604051809103902081905550601454600d6004600085815260200190815260200160002083815481106112c1576112c06134bb565b5b906000526020600020016040516112d89190613998565b9081526020016040518091039020819055506009600460008481526020019081526020016000208281548110611311576113106134bb565b5b9060005260206000200190806001815401808255809150506001900390600052602060002001600090919091909150908161134c9190613a0e565b5080600760006010548152602001908152602001600020819055506001601e60016101000a81548160ff0219169083151502179055505b808061138e90613899565b915050610fdc565b5080806113a290613899565b915050610fb9565b50601e60019054906101000a900460ff161561218b5760005b6010548110156113fa57611b58600f60008381526020019081526020016000208190555080806113f290613899565b9150506113c3565b5060005b601054811015611aae5760006015819055505b6009805490506015541015611a9b57600960155481548110611436576114356134bb565b5b906000526020600020016040516020016114509190613998565b604051602081830303815290604052805190602001206004600083815260200190815260200160002060076000848152602001908152602001600020548154811061149e5761149d6134bb565b5b906000526020600020016040516020016114b89190613998565b6040516020818303038152906040528051906020012003611a7e576001600e6004600084815260200190815260200160002060076000858152602001908152602001600020548154811061150f5761150e6134bb565b5b906000526020600020016040516115269190613998565b90815260200160405180910390205461153f91906138e1565b600e60046000848152602001908152602001600020600760008581526020019081526020016000205481548110611579576115786134bb565b5b906000526020600020016040516115909190613998565b90815260200160405180910390208190555060006001905060016012546115b791906139af565b8160076000858152602001908152602001600020546115d691906138e1565b1015611a7c575b601f6004600084815260200190815260200160002082600760008681526020019081526020016000205461161191906138e1565b81548110611622576116216134bb565b5b906000526020600020016040516116399190613998565b908152602001604051809103902060009054906101000a900460ff16806116cc57506298968060056004600085815260200190815260200160002083600760008781526020019081526020016000205461169391906138e1565b815481106116a4576116a36134bb565b5b906000526020600020016040516116bb9190613998565b908152602001604051809103902054145b8015611703575060026012546116e291906139af565b81600760008581526020019081526020016000205461170191906138e1565b105b1561171c5760018161171591906138e1565b90506115dd565b601f6004600084815260200190815260200160002082600760008681526020019081526020016000205461175091906138e1565b81548110611761576117606134bb565b5b906000526020600020016040516117789190613998565b908152602001604051809103902060009054906101000a900460ff161580156117c057506012548160076000858152602001908152602001600020546117be91906138e1565b105b15611a7b5760016006600060046000868152602001908152602001600020600760008781526020019081526020016000205481548110611803576118026134bb565b5b906000526020600020016004600087815260200190815260200160002085600760008981526020019081526020016000205461183f91906138e1565b815481106118505761184f6134bb565b5b9060005260206000200160405160200161186b929190613da0565b6040516020818303038152906040528051906020012081526020019081526020016000205461189a91906138e1565b60066000600460008681526020019081526020016000206007600087815260200190815260200160002054815481106118d6576118d56134bb565b5b906000526020600020016004600087815260200190815260200160002085600760008981526020019081526020016000205461191291906138e1565b81548110611923576119226134bb565b5b9060005260206000200160405160200161193e929190613da0565b60405160208183030381529060405280519060200120815260200190815260200160002081905550600b600460008481526020019081526020016000206007600085815260200190815260200160002054815481106119a05761199f6134bb565b5b90600052602060002001600460008581526020019081526020016000208360076000878152602001908152602001600020546119dc91906138e1565b815481106119ed576119ec6134bb565b5b90600052602060002001604051602001611a08929190613da0565b604051602081830303815290604052805190602001209080600181540180825580915050600190039060005260206000200160009091909190915055806007600084815260200190815260200160002054611a6391906138e1565b600f6000848152602001908152602001600020819055505b5b505b60156000815480929190611a9190613899565b9190505550611411565b8080611aa690613899565b9150506113fe565b5060005b601054811015612120576000600190505b6001601254611ad291906139af565b81101561210c57601254816007600085815260200190815260200160002054611afb91906138e1565b108015611bd1575060006006600060046000868152602001908152602001600020600760008781526020019081526020016000205481548110611b4157611b406134bb565b5b9060005260206000200160046000878152602001908152602001600020856007600089815260200190815260200160002054611b7d91906138e1565b81548110611b8e57611b8d6134bb565b5b90600052602060002001604051602001611ba9929190613da0565b6040516020818303038152906040528051906020012081526020019081526020016000205414155b8015611c525750601f60046000848152602001908152602001600020826007600086815260200190815260200160002054611c0c91906138e1565b81548110611c1d57611c1c6134bb565b5b90600052602060002001604051611c349190613998565b908152602001604051809103902060009054906101000a900460ff16155b8015611cbe57506000600e60046000858152602001908152602001600020600760008681526020019081526020016000205481548110611c9557611c946134bb565b5b90600052602060002001604051611cac9190613998565b90815260200160405180910390205414155b8015611d2c575062989680600560046000858152602001908152602001600020600760008681526020019081526020016000205481548110611d0357611d026134bb565b5b90600052602060002001604051611d1a9190613998565b90815260200160405180910390205414155b8015611da5575062989680600560046000858152602001908152602001600020836007600087815260200190815260200160002054611d6b91906138e1565b81548110611d7c57611d7b6134bb565b5b90600052602060002001604051611d939190613998565b90815260200160405180910390205414155b156120f957600e60046000848152602001908152602001600020600760008581526020019081526020016000205481548110611de457611de36134bb565b5b90600052602060002001604051611dfb9190613998565b9081526020016040518091039020546006600060046000868152602001908152602001600020600760008781526020019081526020016000205481548110611e4657611e456134bb565b5b9060005260206000200160046000878152602001908152602001600020856007600089815260200190815260200160002054611e8291906138e1565b81548110611e9357611e926134bb565b5b90600052602060002001604051602001611eae929190613da0565b60405160208183030381529060405280519060200120815260200190815260200160002054600d60046000868152602001908152602001600020600760008781526020019081526020016000205481548110611f0d57611f0c6134bb565b5b90600052602060002001604051611f249190613998565b908152602001604051809103902054611f3d9190613dc4565b611f479190613d45565b600560046000858152602001908152602001600020836007600087815260200190815260200160002054611f7b91906138e1565b81548110611f8c57611f8b6134bb565b5b90600052602060002001604051611fa39190613998565b908152602001604051809103902054611fbc91906138e1565b600560046000858152602001908152602001600020836007600087815260200190815260200160002054611ff091906138e1565b81548110612001576120006134bb565b5b906000526020600020016040516120189190613998565b90815260200160405180910390208190555060006006600060046000868152602001908152602001600020600760008781526020019081526020016000205481548110612068576120676134bb565b5b90600052602060002001600460008781526020019081526020016000208560076000898152602001908152602001600020546120a491906138e1565b815481106120b5576120b46134bb565b5b906000526020600020016040516020016120d0929190613da0565b604051602081830303815290604052805190602001208152602001908152602001600020819055505b808061210490613899565b915050611ac3565b50808061211890613899565b915050611ab2565b5060005b60105481101561218957611b58600f6000838152602001908152602001600020541461217657600f60008281526020019081526020016000205460076000838152602001908152602001600020819055505b808061218190613899565b915050612124565b505b5b601e60039054906101000a900460ff16905090565b600080600090505b600b8054905081101561220057600060066000600b84815481106121d0576121cf6134bb565b5b906000526020600020015481526020019081526020016000208190555080806121f890613899565b9150506121a9565b5060005b601054811015612a4b576000600760008381526020019081526020016000205490505b601254811015612a3757601854600560046000858152602001908152602001600020838154811061225b5761225a6134bb565b5b906000526020600020016040516122729190613998565b9081526020016040518091039020541480156122e55750601f6004600084815260200190815260200160002082815481106122b0576122af6134bb565b5b906000526020600020016040516122c79190613998565b908152602001604051809103902060009054906101000a900460ff16155b80156123405750629896806005600460008581526020019081526020016000208381548110612317576123166134bb565b5b9060005260206000200160405161232e9190613998565b90815260200160405180910390205414155b80156123595750601e60029054906101000a900460ff16155b15612a245760006005600460008581526020019081526020016000208381548110612387576123866134bb565b5b9060005260206000200160405161239e9190613998565b90815260200160405180910390205403612670576298968060056004600085815260200190815260200160002083815481106123dd576123dc6134bb565b5b906000526020600020016040516123f49190613998565b9081526020016040518091039020819055506001601e60026101000a81548160ff021916908315150217905550600160195461243091906138e1565b601981905550600192506007600083815260200190815260200160002054811480156124695750600160125461246691906139af565b81105b1561266b575b601f60046000848152602001908152602001600020848361249091906138e1565b815481106124a1576124a06134bb565b5b906000526020600020016040516124b89190613998565b908152602001604051809103902060009054906101000a900460ff168061253857506298968060056004600085815260200190815260200160002085846124ff91906138e1565b815481106125105761250f6134bb565b5b906000526020600020016040516125279190613998565b908152602001604051809103902054145b801561255c5750600160125461254e91906139af565b838261255a91906138e1565b105b156125755760018361256e91906138e1565b925061246f565b601f60046000848152602001908152602001600020848361259691906138e1565b815481106125a7576125a66134bb565b5b906000526020600020016040516125be9190613998565b908152602001604051809103902060009054906101000a900460ff16158015612641575062989680600560046000858152602001908152602001600020858461260791906138e1565b81548110612618576126176134bb565b5b9060005260206000200160405161262f9190613998565b90815260200160405180910390205414155b1561266a57828161265291906138e1565b60076000848152602001908152602001600020819055505b5b612a37565b60019250600160125461268391906139af565b811015612a23575b601f6004600084815260200190815260200160002084836126ac91906138e1565b815481106126bd576126bc6134bb565b5b906000526020600020016040516126d49190613998565b908152602001604051809103902060009054906101000a900460ff1680612754575062989680600560046000858152602001908152602001600020858461271b91906138e1565b8154811061272c5761272b6134bb565b5b906000526020600020016040516127439190613998565b908152602001604051809103902054145b80156127785750600160125461276a91906139af565b838261277691906138e1565b105b156127915760018361278a91906138e1565b925061268b565b601f6004600084815260200190815260200160002084836127b291906138e1565b815481106127c3576127c26134bb565b5b906000526020600020016040516127da9190613998565b908152602001604051809103902060009054906101000a900460ff1615801561280f5750601254838261280d91906138e1565b105b15612a225760016006600060046000868152602001908152602001600020848154811061283f5761283e6134bb565b5b9060005260206000200160046000878152602001908152602001600020878661286891906138e1565b81548110612879576128786134bb565b5b90600052602060002001604051602001612894929190613da0565b604051602081830303815290604052805190602001208152602001908152602001600020546128c391906138e1565b600660006004600086815260200190815260200160002084815481106128ec576128eb6134bb565b5b9060005260206000200160046000878152602001908152602001600020878661291591906138e1565b81548110612926576129256134bb565b5b90600052602060002001604051602001612941929190613da0565b60405160208183030381529060405280519060200120815260200190815260200160002081905550600b6004600084815260200190815260200160002082815481106129905761298f6134bb565b5b906000526020600020016004600085815260200190815260200160002085846129b991906138e1565b815481106129ca576129c96134bb565b5b906000526020600020016040516020016129e5929190613da0565b6040516020818303038152906040528051906020012090806001815401808255809150506001900390600052602060002001600090919091909150555b5b5b8080612a2f90613899565b915050612227565b508080612a4390613899565b915050612204565b5060005b601054811015612ff457600091505b6001601254612a6d91906139af565b82108015612a885750601e60029054906101000a900460ff16155b15612fe157600060066000600460008581526020019081526020016000208581548110612ab857612ab76134bb565b5b9060005260206000200160046000868152602001908152602001600020600187612ae291906138e1565b81548110612af357612af26134bb565b5b90600052602060002001604051602001612b0e929190613da0565b6040516020818303038152906040528051906020012081526020019081526020016000205414158015612b905750629896806005600460008481526020019081526020016000208481548110612b6757612b666134bb565b5b90600052602060002001604051612b7e9190613998565b90815260200160405180910390205414155b8015612bf7575062989680600560046000848152602001908152602001600020600185612bbd91906138e1565b81548110612bce57612bcd6134bb565b5b90600052602060002001604051612be59190613998565b90815260200160405180910390205414155b8015612c5a5750601f600460008381526020019081526020016000208381548110612c2557612c246134bb565b5b90600052602060002001604051612c3c9190613998565b908152602001604051809103902060009054906101000a900460ff16155b15612fcd5760006005600460008481526020019081526020016000208481548110612c8857612c876134bb565b5b90600052602060002001604051612c9f9190613998565b90815260200160405180910390205414612e9f576005600460008381526020019081526020016000208381548110612cda57612cd96134bb565b5b90600052602060002001604051612cf19190613998565b90815260200160405180910390205460066000600460008581526020019081526020016000208581548110612d2957612d286134bb565b5b9060005260206000200160046000868152602001908152602001600020600187612d5391906138e1565b81548110612d6457612d636134bb565b5b90600052602060002001604051602001612d7f929190613da0565b60405160208183030381529060405280519060200120815260200190815260200160002054601854612db19190613dc4565b612dbb9190613d45565b600560046000848152602001908152602001600020600185612ddd91906138e1565b81548110612dee57612ded6134bb565b5b90600052602060002001604051612e059190613998565b908152602001604051809103902054612e1e91906138e1565b600560046000848152602001908152602001600020600185612e4091906138e1565b81548110612e5157612e506134bb565b5b90600052602060002001604051612e689190613998565b908152602001604051809103902081905550600182612e8791906138e1565b60076000838152602001908152602001600020819055505b600060066000600460008581526020019081526020016000208581548110612eca57612ec96134bb565b5b9060005260206000200160046000868152602001908152602001600020600187612ef491906138e1565b81548110612f0557612f046134bb565b5b90600052602060002001604051602001612f20929190613da0565b60405160208183030381529060405280519060200120815260200190815260200160002081905550629896806005600460008481526020019081526020016000208481548110612f7357612f726134bb565b5b90600052602060002001604051612f8a9190613998565b9081526020016040518091039020819055506001601954612fab91906138e1565b6019819055506001601e60026101000a81548160ff0219169083151502179055505b600182612fda91906138e1565b9150612a5e565b8080612fec90613899565b915050612a4f565b5050565b6000620186a0905060005b6010548110156131485760005b60125481101561313457826005600460008581526020019081526020016000208381548110613042576130416134bb565b5b906000526020600020016040516130599190613998565b9081526020016040518091039020541080156130cc5750601f600460008481526020019081526020016000208281548110613097576130966134bb565b5b906000526020600020016040516130ae9190613998565b908152602001604051809103902060009054906101000a900460ff16155b156131215760056004600084815260200190815260200160002082815481106130f8576130f76134bb565b5b9060005260206000200160405161310f9190613998565b90815260200160405180910390205492505b808061312c90613899565b915050613010565b50808061314090613899565b915050613003565b5090565b508054600082559060005260206000209081019061316a919061316d565b50565b5b8082111561318d57600081816131849190613191565b5060010161316e565b5090565b50805461319d9061348a565b6000825580601f106131af57506131ce565b601f0160209004906000526020600020908101906131cd91906131d1565b5b50565b5b808211156131ea5760008160009055506001016131d2565b5090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613219826131ee565b9050919050565b6132298161320e565b82525050565b60006020820190506132446000830184613220565b92915050565b600080fd5b600080fd5b6000819050919050565b61326781613254565b811461327257600080fd5b50565b6000813590506132848161325e565b92915050565b6000602082840312156132a05761329f61324a565b5b60006132ae84828501613275565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156132f15780820151818401526020810190506132d6565b60008484015250505050565b6000601f19601f8301169050919050565b6000613319826132b7565b61332381856132c2565b93506133338185602086016132d3565b61333c816132fd565b840191505092915050565b60006020820190508181036000830152613361818461330e565b905092915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261338e5761338d613369565b5b8235905067ffffffffffffffff8111156133ab576133aa61336e565b5b6020830191508360208202830111156133c7576133c6613373565b5b9250929050565b600080602083850312156133e5576133e461324a565b5b600083013567ffffffffffffffff8111156134035761340261324f565b5b61340f85828601613378565b92509250509250929050565b600080604083850312156134325761343161324a565b5b600061344085828601613275565b925050602061345185828601613275565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806134a257607f821691505b6020821081036134b5576134b461345b565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613516576135156134ea565b5b80840192508235915067ffffffffffffffff821115613538576135376134ef565b5b602083019250600182023603831315613554576135536134f4565b5b509250929050565b600082905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026135f87fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826135bb565b61360286836135bb565b95508019841693508086168417925050509392505050565b6000819050919050565b600061363f61363a61363584613254565b61361a565b613254565b9050919050565b6000819050919050565b61365983613624565b61366d61366582613646565b8484546135c8565b825550505050565b600090565b613682613675565b61368d818484613650565b505050565b5b818110156136b1576136a660008261367a565b600181019050613693565b5050565b601f8211156136f6576136c781613596565b6136d0846135ab565b810160208510156136df578190505b6136f36136eb856135ab565b830182613692565b50505b505050565b600082821c905092915050565b6000613719600019846008026136fb565b1980831691505092915050565b60006137328383613708565b9150826002028217905092915050565b61374c838361355c565b67ffffffffffffffff81111561376557613764613567565b5b61376f825461348a565b61377a8282856136b5565b6000601f8311600181146137a95760008415613797578287013590505b6137a18582613726565b865550613809565b601f1984166137b786613596565b60005b828110156137df578489013582556001820191506020850194506020810190506137ba565b868310156137fc57848901356137f8601f891682613708565b8355505b6001600288020188555050505b50505050505050565b600081905092915050565b82818337600083830152505050565b60006138388385613812565b935061384583858461381d565b82840190509392505050565b600061385e82848661382c565b91508190509392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006138a482613254565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036138d6576138d561386a565b5b600182019050919050565b60006138ec82613254565b91506138f783613254565b925082820190508082111561390f5761390e61386a565b5b92915050565b600081546139228161348a565b61392c8186613812565b94506001821660008114613947576001811461395c5761398f565b60ff198316865281151582028601935061398f565b61396585613596565b60005b8381101561398757815481890152600182019150602081019050613968565b838801955050505b50505092915050565b60006139a48284613915565b915081905092915050565b60006139ba82613254565b91506139c583613254565b92508282039050818111156139dd576139dc61386a565b5b92915050565b6000815490506139f28161348a565b9050919050565b60008190508160005260206000209050919050565b818103613a1c575050613af4565b613a25826139e3565b67ffffffffffffffff811115613a3e57613a3d613567565b5b613a48825461348a565b613a538282856136b5565b6000601f831160018114613a825760008415613a70578287015490505b613a7a8582613726565b865550613aed565b601f198416613a90876139f9565b9650613a9b86613596565b60005b82811015613ac357848901548255600182019150600185019450602081019050613a9e565b86831015613ae05784890154613adc601f891682613708565b8355505b6001600288020188555050505b5050505050505b565b600081549050919050565b600082825260208201905092915050565b60008190508160005260206000209050919050565b600082825260208201905092915050565b60008154613b458161348a565b613b4f8186613b27565b94506001821660008114613b6a5760018114613b8057613bb3565b60ff198316865281151560200286019350613bb3565b613b8985613596565b60005b83811015613bab57815481890152600182019150602081019050613b8c565b808801955050505b50505092915050565b6000613bc88383613b38565b905092915050565b6000600182019050919050565b6000613be882613af6565b613bf28185613b01565b935083602082028501613c0485613b12565b8060005b85811015613c3f57848403895281613c208582613bbc565b9450613c2b83613bd0565b925060208a01995050600181019050613c08565b50829750879550505050505092915050565b60006020820190508181036000830152613c6b8184613bdd565b905092915050565b600082825260208201905092915050565b7f4f6e6c79206368616972706572736f6e2063616e20676976652072696768742060008201527f746f20766f74652e000000000000000000000000000000000000000000000000602082015250565b6000613ce0602883613c73565b9150613ceb82613c84565b604082019050919050565b60006020820190508181036000830152613d0f81613cd3565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613d5082613254565b9150613d5b83613254565b925082613d6b57613d6a613d16565b5b828204905092915050565b613d7f81613254565b82525050565b6000602082019050613d9a6000830184613d76565b92915050565b6000613dac8285613915565b9150613db88284613915565b91508190509392505050565b6000613dcf82613254565b9150613dda83613254565b9250828202613de881613254565b91508282048414831517613dff57613dfe61386a565b5b509291505056fea26469706673582212209d8e618d6def6f87f5414183dbfbdb1783a7735a30d259e7feb5afe2a6905c3064736f6c63430008110033"
// the allocation of the accounts and objects
let accounts = []
let rawTransactions = []
let allocDict = {}
// helper function
let getGenesisTemplate = () => {
return JSON.parse(fs.readFileSync('./genesis_template.json'))
}
// Transaction things
//const txParams = {
//nonce: '0x00',
//gasPrice: '0xff184e72a000',
//gasLimit: '0xfff7100',
//to: "0xBce16ea55bB357B038e612b1722A88879c665a31",
//value: '0x1',
//chainId: 161
//}
const customCommon = Common.default.forCustomChain(
'mainnet',
{
name: 'custom-benchmark-chain',
networkId: 10,
chainId: 161,
},
'petersburg'
)
console.log("[*] Generating " + NUMTX + " transactions")
//let genesisTemplate = getGenesisTemplate()
//let genTemplateCopy = {...genesisTemplate};
var privkey = fs.readFileSync('priv-keys.log').toString().split("\n");
me = []
const data1 = fs.readFileSync('new.log', 'UTF-8');
const lines1 = data1.split(/\r?\n/);
lines1.forEach((address) => {
//console.log(address)
me.push(address)
});
let gas = 0
for (let i = 0; i < NUMTX; i++) {
// generate the account and add to the array
//let a = Wallet.default.generate()
//accounts.push(a.getPrivateKeyString())
// add to the genesis alloc
//allocDict[a.getAddressString()] = startBalance
//text = a.getAddressString() + "\n"
//fs.appendFileSync('new.log', text);
gas = gas + 0xff184e72a000;
const txParams = {
nonce: '0x00',
gasPrice: gas,
gasLimit: '0xffff7100',
to: null,
data: CONTRACTDATA,
value: '0x0',
chainId: 161
}
let newTx = {...txParams}
//read from address from file
newTx["from"] = me[i]
// generate the transaction and sign it
let tx = new EthereumTx(txParams, {common: customCommon})
var privateKey = Buffer.from(privkey[i], 'hex')
tx.sign(privateKey)
rawTransactions.push(
{
'hash': tx.hash().toString('hex'),
'serialized': (tx.serialize()).toString('hex')
}
)
}
//console.log('[*] Done!')
//console.log('[*] Generating Genesis')
// write the genesis file
//let genesisTemplate = getGenesisTemplate()
//let genTemplateCopy = {...genesisTemplate};
//genTemplateCopy.alloc = {...allocDict}
//let b = Buffer.from(JSON.stringify(genTemplateCopy, null, 4))
//try {
//fs.writeFileSync('genesis.json', b)
//} catch(error) {
//console.log(error);
//}
console.log('[*] Done!')
console.log('[*] Generating Transaction file')
b = Buffer.from(JSON.stringify(rawTransactions))
try {
fs.writeFileSync('txs-sc.json', b)
} catch(error) {
console.log(error);
}
console.log('[*] Done! Printing to stdout for sanity')
//console.log(JSON.stringify(genTemplateCopy, null, 4))
console.log(JSON.stringify(rawTransactions, null, 2))