GenesisInfo.cpp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. /*
  2. This file is part of cpp-ethereum.
  3. cpp-ethereum is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 3 of the License, or
  6. (at your option) any later version.
  7. cpp-ethereum is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. /** @file GenesisInfo.cpp
  15. * @author Gav Wood <i@gavwood.com>
  16. * @date 2014
  17. */
  18. #include <libdevcrypto/Common.h>
  19. #include <json_spirit/JsonSpiritHeaders.h>
  20. #include "GenesisInfo.h"
  21. using namespace dev;
  22. using namespace eth;
  23. KeyPair const dev::eth::FluidityTreasure(Secret("a15e7af8ea0a717182d3608e6cdb2bff97ccaad3b6befc8787abe4c937796579"));
  24. std::string const dev::eth::c_genesisInfoFluidity =
  25. R"ETHEREUM(
  26. {
  27. "sealEngine": "BasicAuthority",
  28. "params": {
  29. "accountStartNonce": "0x",
  30. "maximumExtraDataSize": "0x1000000",
  31. "blockReward": "0x",
  32. "registrar": "",
  33. "networkID" : "0x45"
  34. },
  35. "genesis": {
  36. "author": "0x0000000000000000000000000000000000000000",
  37. "timestamp": "0x00",
  38. "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  39. "extraData": "0x",
  40. "gasLimit": "0x1000000000000"
  41. },
  42. "accounts": {
  43. "0000000000000000000000000000000000000001": { "wei": "1", "precompiled": { "name": "ecrecover", "linear": { "base": 3000, "word": 0 } } },
  44. "0000000000000000000000000000000000000002": { "wei": "1", "precompiled": { "name": "sha256", "linear": { "base": 60, "word": 12 } } },
  45. "0000000000000000000000000000000000000003": { "wei": "1", "precompiled": { "name": "ripemd160", "linear": { "base": 600, "word": 120 } } },
  46. "0000000000000000000000000000000000000004": { "wei": "1", "precompiled": { "name": "identity", "linear": { "base": 15, "word": 3 } } },
  47. "00c9b024c2efc853ecabb8be2fb1d16ce8174ab1": { "wei": "1606938044258990275541962092341162602522202993782792835301376" }
  48. }
  49. }
  50. )ETHEREUM";
  51. std::string const dev::eth::c_genesisInfoTestBasicAuthority =
  52. R"E(
  53. {
  54. "sealEngine": "BasicAuthority",
  55. "params": {
  56. "accountStartNonce": "0x00",
  57. "maximumExtraDataSize": "0x20",
  58. "minGasLimit": "0x1388",
  59. "maxGasLimit": "0x7fffffffffffffff",
  60. "gasLimitBoundDivisor": "0x0400",
  61. "minimumDifficulty": "0x020000",
  62. "difficultyBoundDivisor": "0x0800",
  63. "durationLimit": "0x0d",
  64. "blockReward": "0x4563918244F40000",
  65. "registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
  66. "networkID" : "0x1"
  67. },
  68. "genesis": {
  69. "nonce": "0x0000000000000042",
  70. "difficulty": "0x400000000",
  71. "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  72. "author": "0x0000000000000000000000000000000000000000",
  73. "timestamp": "0x00",
  74. "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  75. "extraData": "0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa",
  76. "gasLimit": "0x2fefd8"
  77. },
  78. "accounts": {
  79. "0000000000000000000000000000000000000001": { "wei": "1", "precompiled": { "name": "ecrecover", "linear": { "base": 3000, "word": 0 } } },
  80. "0000000000000000000000000000000000000002": { "wei": "1", "precompiled": { "name": "sha256", "linear": { "base": 60, "word": 12 } } },
  81. "0000000000000000000000000000000000000003": { "wei": "1", "precompiled": { "name": "ripemd160", "linear": { "base": 600, "word": 120 } } },
  82. "0000000000000000000000000000000000000004": { "wei": "1", "precompiled": { "name": "identity", "linear": { "base": 15, "word": 3 } } },
  83. "00c9b024c2efc853ecabb8be2fb1d16ce8174ab1": { "wei": "1606938044258990275541962092341162602522202993782792835301376" }
  84. }
  85. }
  86. )E";
  87. static std::string const c_childDaos =
  88. R"E(
  89. {
  90. "accounts": [
  91. {
  92. "address":"0xd4fe7bc31cedb7bfb8a345f31e668033056b2728",
  93. "extraBalanceAccount":"0xb3fb0e5aba0e20e5c49d252dfd30e102b171a425"
  94. },
  95. {
  96. "address":"0x2c19c7f9ae8b751e37aeb2d93a699722395ae18f",
  97. "extraBalanceAccount":"0xecd135fa4f61a655311e86238c92adcd779555d2"
  98. },
  99. {
  100. "address":"0x1975bd06d486162d5dc297798dfc41edd5d160a7",
  101. "extraBalanceAccount":"0xa3acf3a1e16b1d7c315e23510fdd7847b48234f6"
  102. },
  103. {
  104. "address":"0x319f70bab6845585f412ec7724b744fec6095c85",
  105. "extraBalanceAccount":"0x06706dd3f2c9abf0a21ddcc6941d9b86f0596936"
  106. },
  107. {
  108. "address":"0x5c8536898fbb74fc7445814902fd08422eac56d0",
  109. "extraBalanceAccount":"0x6966ab0d485353095148a2155858910e0965b6f9"
  110. },
  111. {
  112. "address":"0x779543a0491a837ca36ce8c635d6154e3c4911a6",
  113. "extraBalanceAccount":"0x2a5ed960395e2a49b1c758cef4aa15213cfd874c"
  114. },
  115. {
  116. "address":"0x5c6e67ccd5849c0d29219c4f95f1a7a93b3f5dc5",
  117. "extraBalanceAccount":"0x9c50426be05db97f5d64fc54bf89eff947f0a321"
  118. },
  119. {
  120. "address":"0x200450f06520bdd6c527622a273333384d870efb",
  121. "extraBalanceAccount":"0xbe8539bfe837b67d1282b2b1d61c3f723966f049"
  122. },
  123. {
  124. "address":"0x6b0c4d41ba9ab8d8cfb5d379c69a612f2ced8ecb",
  125. "extraBalanceAccount":"0xf1385fb24aad0cd7432824085e42aff90886fef5"
  126. },
  127. {
  128. "address":"0xd1ac8b1ef1b69ff51d1d401a476e7e612414f091",
  129. "extraBalanceAccount":"0x8163e7fb499e90f8544ea62bbf80d21cd26d9efd"
  130. },
  131. {
  132. "address":"0x51e0ddd9998364a2eb38588679f0d2c42653e4a6",
  133. "extraBalanceAccount":"0x627a0a960c079c21c34f7612d5d230e01b4ad4c7"
  134. },
  135. {
  136. "address":"0xf0b1aa0eb660754448a7937c022e30aa692fe0c5",
  137. "extraBalanceAccount":"0x24c4d950dfd4dd1902bbed3508144a54542bba94"
  138. },
  139. {
  140. "address":"0x9f27daea7aca0aa0446220b98d028715e3bc803d",
  141. "extraBalanceAccount":"0xa5dc5acd6a7968a4554d89d65e59b7fd3bff0f90"
  142. },
  143. {
  144. "address":"0xd9aef3a1e38a39c16b31d1ace71bca8ef58d315b",
  145. "extraBalanceAccount":"0x63ed5a272de2f6d968408b4acb9024f4cc208ebf"
  146. },
  147. {
  148. "address":"0x6f6704e5a10332af6672e50b3d9754dc460dfa4d",
  149. "extraBalanceAccount":"0x77ca7b50b6cd7e2f3fa008e24ab793fd56cb15f6"
  150. },
  151. {
  152. "address":"0x492ea3bb0f3315521c31f273e565b868fc090f17",
  153. "extraBalanceAccount":"0x0ff30d6de14a8224aa97b78aea5388d1c51c1f00"
  154. },
  155. {
  156. "address":"0x9ea779f907f0b315b364b0cfc39a0fde5b02a416",
  157. "extraBalanceAccount":"0xceaeb481747ca6c540a000c1f3641f8cef161fa7"
  158. },
  159. {
  160. "address":"0xcc34673c6c40e791051898567a1222daf90be287",
  161. "extraBalanceAccount":"0x579a80d909f346fbfb1189493f521d7f48d52238"
  162. },
  163. {
  164. "address":"0xe308bd1ac5fda103967359b2712dd89deffb7973",
  165. "extraBalanceAccount":"0x4cb31628079fb14e4bc3cd5e30c2f7489b00960c"
  166. },
  167. {
  168. "address":"0xac1ecab32727358dba8962a0f3b261731aad9723",
  169. "extraBalanceAccount":"0x4fd6ace747f06ece9c49699c7cabc62d02211f75"
  170. },
  171. {
  172. "address":"0x440c59b325d2997a134c2c7c60a8c61611212bad",
  173. "extraBalanceAccount":"0x4486a3d68fac6967006d7a517b889fd3f98c102b"
  174. },
  175. {
  176. "address":"0x9c15b54878ba618f494b38f0ae7443db6af648ba",
  177. "extraBalanceAccount":"0x27b137a85656544b1ccb5a0f2e561a5703c6a68f"
  178. },
  179. {
  180. "address":"0x21c7fdb9ed8d291d79ffd82eb2c4356ec0d81241",
  181. "extraBalanceAccount":"0x23b75c2f6791eef49c69684db4c6c1f93bf49a50"
  182. },
  183. {
  184. "address":"0x1ca6abd14d30affe533b24d7a21bff4c2d5e1f3b",
  185. "extraBalanceAccount":"0xb9637156d330c0d605a791f1c31ba5890582fe1c"
  186. },
  187. {
  188. "address":"0x6131c42fa982e56929107413a9d526fd99405560",
  189. "extraBalanceAccount":"0x1591fc0f688c81fbeb17f5426a162a7024d430c2"
  190. },
  191. {
  192. "address":"0x542a9515200d14b68e934e9830d91645a980dd7a",
  193. "extraBalanceAccount":"0xc4bbd073882dd2add2424cf47d35213405b01324"
  194. },
  195. {
  196. "address":"0x782495b7b3355efb2833d56ecb34dc22ad7dfcc4",
  197. "extraBalanceAccount":"0x58b95c9a9d5d26825e70a82b6adb139d3fd829eb"
  198. },
  199. {
  200. "address":"0x3ba4d81db016dc2890c81f3acec2454bff5aada5",
  201. "extraBalanceAccount":"0xb52042c8ca3f8aa246fa79c3feaa3d959347c0ab"
  202. },
  203. {
  204. "address":"0xe4ae1efdfc53b73893af49113d8694a057b9c0d1",
  205. "extraBalanceAccount":"0x3c02a7bc0391e86d91b7d144e61c2c01a25a79c5"
  206. },
  207. {
  208. "address":"0x0737a6b837f97f46ebade41b9bc3e1c509c85c53",
  209. "extraBalanceAccount":"0x97f43a37f595ab5dd318fb46e7a155eae057317a"
  210. },
  211. {
  212. "address":"0x52c5317c848ba20c7504cb2c8052abd1fde29d03",
  213. "extraBalanceAccount":"0x4863226780fe7c0356454236d3b1c8792785748d"
  214. },
  215. {
  216. "address":"0x5d2b2e6fcbe3b11d26b525e085ff818dae332479",
  217. "extraBalanceAccount":"0x5f9f3392e9f62f63b8eac0beb55541fc8627f42c"
  218. },
  219. {
  220. "address":"0x057b56736d32b86616a10f619859c6cd6f59092a",
  221. "extraBalanceAccount":"0x9aa008f65de0b923a2a4f02012ad034a5e2e2192"
  222. },
  223. {
  224. "address":"0x304a554a310c7e546dfe434669c62820b7d83490",
  225. "extraBalanceAccount":"0x914d1b8b43e92723e64fd0a06f5bdb8dd9b10c79"
  226. },
  227. {
  228. "address":"0x4deb0033bb26bc534b197e61d19e0733e5679784",
  229. "extraBalanceAccount":"0x07f5c1e1bc2c93e0402f23341973a0e043f7bf8a"
  230. },
  231. {
  232. "address":"0x35a051a0010aba705c9008d7a7eff6fb88f6ea7b",
  233. "extraBalanceAccount":"0x4fa802324e929786dbda3b8820dc7834e9134a2a"
  234. },
  235. {
  236. "address":"0x9da397b9e80755301a3b32173283a91c0ef6c87e",
  237. "extraBalanceAccount":"0x8d9edb3054ce5c5774a420ac37ebae0ac02343c6"
  238. },
  239. {
  240. "address":"0x0101f3be8ebb4bbd39a2e3b9a3639d4259832fd9",
  241. "extraBalanceAccount":"0x5dc28b15dffed94048d73806ce4b7a4612a1d48f"
  242. },
  243. {
  244. "address":"0xbcf899e6c7d9d5a215ab1e3444c86806fa854c76",
  245. "extraBalanceAccount":"0x12e626b0eebfe86a56d633b9864e389b45dcb260"
  246. },
  247. {
  248. "address":"0xa2f1ccba9395d7fcb155bba8bc92db9bafaeade7",
  249. "extraBalanceAccount":"0xec8e57756626fdc07c63ad2eafbd28d08e7b0ca5"
  250. },
  251. {
  252. "address":"0xd164b088bd9108b60d0ca3751da4bceb207b0782",
  253. "extraBalanceAccount":"0x6231b6d0d5e77fe001c2a460bd9584fee60d409b"
  254. },
  255. {
  256. "address":"0x1cba23d343a983e9b5cfd19496b9a9701ada385f",
  257. "extraBalanceAccount":"0xa82f360a8d3455c5c41366975bde739c37bfeb8a"
  258. },
  259. {
  260. "address":"0x9fcd2deaff372a39cc679d5c5e4de7bafb0b1339",
  261. "extraBalanceAccount":"0x005f5cee7a43331d5a3d3eec71305925a62f34b6"
  262. },
  263. {
  264. "address":"0x0e0da70933f4c7849fc0d203f5d1d43b9ae4532d",
  265. "extraBalanceAccount":"0xd131637d5275fd1a68a3200f4ad25c71a2a9522e"
  266. },
  267. {
  268. "address":"0xbc07118b9ac290e4622f5e77a0853539789effbe",
  269. "extraBalanceAccount":"0x47e7aa56d6bdf3f36be34619660de61275420af8"
  270. },
  271. {
  272. "address":"0xacd87e28b0c9d1254e868b81cba4cc20d9a32225",
  273. "extraBalanceAccount":"0xadf80daec7ba8dcf15392f1ac611fff65d94f880"
  274. },
  275. {
  276. "address":"0x5524c55fb03cf21f549444ccbecb664d0acad706",
  277. "extraBalanceAccount":"0x40b803a9abce16f50f36a77ba41180eb90023925"
  278. },
  279. {
  280. "address":"0xfe24cdd8648121a43a7c86d289be4dd2951ed49f",
  281. "extraBalanceAccount":"0x17802f43a0137c506ba92291391a8a8f207f487d"
  282. },
  283. {
  284. "address":"0x253488078a4edf4d6f42f113d1e62836a942cf1a",
  285. "extraBalanceAccount":"0x86af3e9626fce1957c82e88cbf04ddf3a2ed7915"
  286. },
  287. {
  288. "address":"0xb136707642a4ea12fb4bae820f03d2562ebff487",
  289. "extraBalanceAccount":"0xdbe9b615a3ae8709af8b93336ce9b477e4ac0940"
  290. },
  291. {
  292. "address":"0xf14c14075d6c4ed84b86798af0956deef67365b5",
  293. "extraBalanceAccount":"0xca544e5c4687d109611d0f8f928b53a25af72448"
  294. },
  295. {
  296. "address":"0xaeeb8ff27288bdabc0fa5ebb731b6f409507516c",
  297. "extraBalanceAccount":"0xcbb9d3703e651b0d496cdefb8b92c25aeb2171f7"
  298. },
  299. {
  300. "address":"0x6d87578288b6cb5549d5076a207456a1f6a63dc0",
  301. "extraBalanceAccount":"0xb2c6f0dfbb716ac562e2d85d6cb2f8d5ee87603e"
  302. },
  303. {
  304. "address":"0xaccc230e8a6e5be9160b8cdf2864dd2a001c28b6",
  305. "extraBalanceAccount":"0x2b3455ec7fedf16e646268bf88846bd7a2319bb2"
  306. },
  307. {
  308. "address":"0x4613f3bca5c44ea06337a9e439fbc6d42e501d0a",
  309. "extraBalanceAccount":"0xd343b217de44030afaa275f54d31a9317c7f441e"
  310. },
  311. {
  312. "address":"0x84ef4b2357079cd7a7c69fd7a37cd0609a679106",
  313. "extraBalanceAccount":"0xda2fef9e4a3230988ff17df2165440f37e8b1708"
  314. },
  315. {
  316. "address":"0xf4c64518ea10f995918a454158c6b61407ea345c",
  317. "extraBalanceAccount":"0x7602b46df5390e432ef1c307d4f2c9ff6d65cc97"
  318. },
  319. {
  320. "address":"0xbb9bc244d798123fde783fcc1c72d3bb8c189413",
  321. "extraBalanceAccount":"0x807640a13483f8ac783c557fcdf27be11ea4ac7a"
  322. }]
  323. })E";
  324. dev::Addresses dev::eth::childDaos()
  325. {
  326. Addresses daos;
  327. json_spirit::mValue val;
  328. json_spirit::read_string(c_childDaos, val);
  329. json_spirit::mObject obj = val.get_obj();
  330. for(auto const& items: obj)
  331. {
  332. json_spirit::mArray array = items.second.get_array();
  333. for (auto account: array)
  334. {
  335. daos.push_back(Address(account.get_obj()["address"].get_str()));
  336. daos.push_back(Address(account.get_obj()["extraBalanceAccount"].get_str()));
  337. }
  338. }
  339. return daos;
  340. }